# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "surroundings.fullname" . }}-surroundings
  labels:
  {{- include "surroundings.labels" . | nindent 4 }}
data:
  CAULIFLOWER_DISCREET: {{ .Values.surroundings.cauliflowerDiscreet | quote }}
  CHECK_SLICE: {{ .Values.surroundings.checkSlice | quote }}
  CONDEMNED_TRIM_SWEEP: {{ .Values.surroundings.condemnedTrimSweep | quote }}
  DETECT_DELEGATE: {{ .Values.surroundings.detectDelegate | quote }}
  GOAL_WHALE_TUNA: {{ .Values.surroundings.goalWhaleTuna | quote }}
  IMAGINARY_COOPERATIVE_SCRATCH: {{ .Values.surroundings.imaginaryCooperativeScratch
    | quote }}
  POCKETBOOK_HOLISTIC: {{ .Values.surroundings.pocketbookHolistic | quote }}
  PURITAN_TOWNHOUSE: {{ .Values.surroundings.puritanTownhouse | quote }}
  STYLING_FILTH_FUNERAL: {{ .Values.surroundings.stylingFilthFuneral | quote }}
  TAVERN: {{ .Values.surroundings.tavern | quote }}
  WRY_DIVER: {{ .Values.surroundings.wryDiver | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "surroundings.fullname" . }}-surroundings
  labels:
  {{- include "surroundings.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: surroundings
spec:
  replicas: {{ .Values.surroundings.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: surroundings
      app.kubernetes.io/name: insolence
    {{- include "surroundings.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: surroundings
        app.kubernetes.io/name: insolence
      {{- include "surroundings.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 05c8cadcb82be15129485106c6ace5922f398153d27b59a966e20afc914ffb3a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "surroundings.fullname" . }}-surroundings
        image: {{ .Values.surroundings.surroundings.image.repository }}:{{ .Values.surroundings.surroundings.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.surroundings.surroundings.imagePullPolicy }}
        name: surroundings
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.surroundings.surroundings.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.surroundings.surroundings.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "surroundings.fullname" . }}-surroundings
  labels:
  {{- include "surroundings.labels" . | nindent 4 }}
spec:
  type: {{ .Values.surroundings.type }}
  selector:
    app.kubernetes.io/instance: surroundings
    app.kubernetes.io/name: insolence
  {{- include "surroundings.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.surroundings.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
surroundings:
  cauliflowerDiscreet: mortality
  checkSlice: rambunctious
  condemnedTrimSweep: haircut
  detectDelegate: quarter
  goalWhaleTuna: figure
  imaginaryCooperativeScratch: aback
  pocketbookHolistic: rubbish
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  puritanTownhouse: flip-flops
  replicas: 1
  stylingFilthFuneral: cabin
  surroundings:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  tavern: exile
  type: ClusterIP
  wryDiver: con
