# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "surround.fullname" . }}-surround
  labels:
  {{- include "surround.labels" . | nindent 4 }}
data:
  ALLUVIUM: {{ .Values.surround.alluvium | quote }}
  APPLIANCE: {{ .Values.surround.appliance | quote }}
  ARRANGE_COUNCILPERSON_LOT: {{ .Values.surround.arrangeCouncilpersonLot | quote
    }}
  CARBOXYL_SAFE: {{ .Values.surround.carboxylSafe | quote }}
  COCKPIT_MUKLUK: {{ .Values.surround.cockpitMukluk | quote }}
  CREATE_POLL: {{ .Values.surround.createPoll | quote }}
  EICOSANOID_STANDARD_POVERTY: {{ .Values.surround.eicosanoidStandardPoverty | quote
    }}
  LINKAGE_CHALICE_UNDERSTAND: {{ .Values.surround.linkageChaliceUnderstand | quote
    }}
  PREFERENCE: {{ .Values.surround.preference | quote }}
  PREY_TEMPTRESS_PROVE: {{ .Values.surround.preyTemptressProve | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "surround.fullname" . }}-surround
  labels:
  {{- include "surround.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: surround
spec:
  replicas: {{ .Values.surround.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: surround
      app.kubernetes.io/name: slave
    {{- include "surround.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: surround
        app.kubernetes.io/name: slave
      {{- include "surround.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: cef948d10b6c6911b2485adbdb6927a96c246937974b9b60911d0adfd9f169bd
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "surround.fullname" . }}-surround
        image: {{ .Values.surround.surround.image.repository }}:{{ .Values.surround.surround.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.surround.surround.imagePullPolicy }}
        name: surround
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.surround.surround.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.surround.surround.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "surround.fullname" . }}-surround
  labels:
  {{- include "surround.labels" . | nindent 4 }}
spec:
  type: {{ .Values.surround.type }}
  selector:
    app.kubernetes.io/instance: surround
    app.kubernetes.io/name: slave
  {{- include "surround.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.surround.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
surround:
  alluvium: conscience
  appliance: cough
  arrangeCouncilpersonLot: info
  carboxylSafe: particle
  cockpitMukluk: gauge
  createPoll: hall
  eicosanoidStandardPoverty: exhaust
  linkageChaliceUnderstand: commandment
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preference: arrogant
  preyTemptressProve: paperwork
  replicas: 1
  surround:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
