# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "adjective.fullname" . }}-adjective
  labels:
  {{- include "adjective.labels" . | nindent 4 }}
data:
  APPLEWOOD: {{ .Values.adjective.applewood | quote }}
  DO: {{ .Values.adjective.do | quote }}
  HARD-HAT_EMAIL_ICICLE: {{ .Values.adjective.hardHatEmailIcicle | quote }}
  MIDWIFE_WATERY_PROFESS: {{ .Values.adjective.midwifeWateryProfess | quote }}
  SEW_EX-HUSBAND_EQUITY: {{ .Values.adjective.sewExHusbandEquity | quote }}
  SMITH: {{ .Values.adjective.smith | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "adjective.fullname" . }}-adjective
  labels:
  {{- include "adjective.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: adjective
spec:
  replicas: {{ .Values.adjective.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: adjective
      app.kubernetes.io/name: gemsbok
    {{- include "adjective.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: adjective
        app.kubernetes.io/name: gemsbok
      {{- include "adjective.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: b949b85dbd610ad201da240eb37c0c7783726117df26c6d7448a23809929dc4b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "adjective.fullname" . }}-adjective
        image: {{ .Values.adjective.adjective.image.repository }}:{{ .Values.adjective.adjective.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.adjective.adjective.imagePullPolicy }}
        name: adjective
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.adjective.adjective.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.adjective.adjective.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "adjective.fullname" . }}-adjective
  labels:
  {{- include "adjective.labels" . | nindent 4 }}
spec:
  type: {{ .Values.adjective.type }}
  selector:
    app.kubernetes.io/instance: adjective
    app.kubernetes.io/name: gemsbok
  {{- include "adjective.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.adjective.ports | toYaml | nindent 2 -}}
adjective:
  adjective:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  applewood: production
  do: latte
  hardHatEmailIcicle: plier
  midwifeWateryProfess: colonialism
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sewExHusbandEquity: soprano
  smith: side
  type: ClusterIP
kubernetesClusterDomain: cluster.local
