# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "relationship.fullname" . }}-relationship
  labels:
  {{- include "relationship.labels" . | nindent 4 }}
data:
  COB: {{ .Values.relationship.cob | quote }}
  CONGO_MISSPELL: {{ .Values.relationship.congoMisspell | quote }}
  CURTAILMENT_BEWILDERED: {{ .Values.relationship.curtailmentBewildered | quote }}
  HARBOR_METHANE_BERRY: {{ .Values.relationship.harborMethaneBerry | quote }}
  HARDHAT: {{ .Values.relationship.hardhat | quote }}
  HYPE_ENTRY: {{ .Values.relationship.hypeEntry | quote }}
  KNOTTY_PROGRAMMING_PANSY: {{ .Values.relationship.knottyProgrammingPansy | quote
    }}
  MOTORCYCLE_DEPRESSED_PHENOTYPE: {{ .Values.relationship.motorcycleDepressedPhenotype
    | quote }}
  OWN: {{ .Values.relationship.own | quote }}
  POLITICIAN_RUCKUS_COUCH: {{ .Values.relationship.politicianRuckusCouch | quote
    }}
  PROPOSITION_ENTER: {{ .Values.relationship.propositionEnter | quote }}
  VINTAGE_FREIGHT: {{ .Values.relationship.vintageFreight | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "relationship.fullname" . }}-relationship
  labels:
  {{- include "relationship.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: relationship
spec:
  replicas: {{ .Values.relationship.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: relationship
      app.kubernetes.io/name: regulator
    {{- include "relationship.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: relationship
        app.kubernetes.io/name: regulator
      {{- include "relationship.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 56021dcb44857c952c2c461ec721c88dd098668a634d5076cb4ff7bc7174a00d
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "relationship.fullname" . }}-relationship
        image: {{ .Values.relationship.relationship.image.repository }}:{{ .Values.relationship.relationship.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.relationship.relationship.imagePullPolicy }}
        name: relationship
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.relationship.relationship.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.relationship.relationship.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "relationship.fullname" . }}-relationship
  labels:
  {{- include "relationship.labels" . | nindent 4 }}
spec:
  type: {{ .Values.relationship.type }}
  selector:
    app.kubernetes.io/instance: relationship
    app.kubernetes.io/name: regulator
  {{- include "relationship.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.relationship.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
relationship:
  cob: touch
  congoMisspell: connection
  curtailmentBewildered: hospitalization
  harborMethaneBerry: humor
  hardhat: balcony
  hypeEntry: soup
  knottyProgrammingPansy: human
  motorcycleDepressedPhenotype: utilize
  own: pen
  politicianRuckusCouch: founding
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  propositionEnter: aggression
  relationship:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  type: ClusterIP
  vintageFreight: frog
