# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "decoration.fullname" . }}-decoration
  labels:
  {{- include "decoration.labels" . | nindent 4 }}
data:
  BAKER_CREME BRULEE_FRIEND: {{ .Values.decoration.bakerCremeBruleeFriend | quote
    }}
  EVOLUTION_CONTAINER_FLIPPANT: {{ .Values.decoration.evolutionContainerFlippant
    | quote }}
  FABRIC: {{ .Values.decoration.fabric | quote }}
  MOTIVATION: {{ .Values.decoration.motivation | quote }}
  RAKE: {{ .Values.decoration.rake | quote }}
  STILETTO_CHRONOGRAPH: {{ .Values.decoration.stilettoChronograph | quote }}
  SUBJECT: {{ .Values.decoration.subject | quote }}
  TAME_LEATHER: {{ .Values.decoration.tameLeather | quote }}
  TAPE: {{ .Values.decoration.tape | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "decoration.fullname" . }}-decoration
  labels:
  {{- include "decoration.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: decoration
spec:
  replicas: {{ .Values.decoration.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: decoration
      app.kubernetes.io/name: ivory
    {{- include "decoration.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: decoration
        app.kubernetes.io/name: ivory
      {{- include "decoration.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 709e4a6b3bbfc73f47a693d09419a0b4149cc6893e814e0ce8eaeed7209c2cb9
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "decoration.fullname" . }}-decoration
        image: {{ .Values.decoration.decoration.image.repository }}:{{ .Values.decoration.decoration.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.decoration.decoration.imagePullPolicy }}
        name: decoration
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.decoration.decoration.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.decoration.decoration.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "decoration.fullname" . }}-decoration
  labels:
  {{- include "decoration.labels" . | nindent 4 }}
spec:
  type: {{ .Values.decoration.type }}
  selector:
    app.kubernetes.io/instance: decoration
    app.kubernetes.io/name: ivory
  {{- include "decoration.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.decoration.ports | toYaml | nindent 2 -}}
decoration:
  bakerCremeBruleeFriend: sash
  decoration:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  evolutionContainerFlippant: catalog
  fabric: gaming
  motivation: pneumonia
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rake: aquatic
  replicas: 1
  stilettoChronograph: marines
  subject: walkway
  tameLeather: recall
  tape: bin
  type: ClusterIP
kubernetesClusterDomain: cluster.local
