# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "preserve.fullname" . }}-preserve
  labels:
  {{- include "preserve.labels" . | nindent 4 }}
data:
  ACTOR_UNDERPASS: {{ .Values.preserve.actorUnderpass | quote }}
  IMPLEMENTATION: {{ .Values.preserve.implementation | quote }}
  PINTO_LONG_CUCUMBER: {{ .Values.preserve.pintoLongCucumber | quote }}
  TIGHTS: {{ .Values.preserve.tights | quote }}
  WIFE_LAUGHABLE_BANDANNA: {{ .Values.preserve.wifeLaughableBandanna | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "preserve.fullname" . }}-preserve
  labels:
  {{- include "preserve.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: preserve
spec:
  replicas: {{ .Values.preserve.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: preserve
      app.kubernetes.io/name: undertake
    {{- include "preserve.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: preserve
        app.kubernetes.io/name: undertake
      {{- include "preserve.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a7f7ab86b6daaec4f83461b1165e3950bc80cda25404b7a1ec2ad194a9f048d2
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "preserve.fullname" . }}-preserve
        image: {{ .Values.preserve.preserve.image.repository }}:{{ .Values.preserve.preserve.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.preserve.preserve.imagePullPolicy }}
        name: preserve
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.preserve.preserve.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.preserve.preserve.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "preserve.fullname" . }}-preserve
  labels:
  {{- include "preserve.labels" . | nindent 4 }}
spec:
  type: {{ .Values.preserve.type }}
  selector:
    app.kubernetes.io/instance: preserve
    app.kubernetes.io/name: undertake
  {{- include "preserve.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.preserve.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
preserve:
  actorUnderpass: identification
  implementation: basement
  pintoLongCucumber: kazoo
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preserve:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  tights: bride
  type: ClusterIP
  wifeLaughableBandanna: wind-chime
