# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "contingency.fullname" . }}-contingency
  labels:
  {{- include "contingency.labels" . | nindent 4 }}
data:
  ADVISER_JOINT_FLINTLOCK: {{ .Values.contingency.adviserJointFlintlock | quote }}
  DEPENDENCY_MATCHMAKER_DERANGED: {{ .Values.contingency.dependencyMatchmakerDeranged
    | quote }}
  DIFFUSE_POUCH_TROWEL: {{ .Values.contingency.diffusePouchTrowel | quote }}
  FOOLISH_SLOPPY_SUSPEND: {{ .Values.contingency.foolishSloppySuspend | quote }}
  GRENADE_DAILY: {{ .Values.contingency.grenadeDaily | quote }}
  HUGGER: {{ .Values.contingency.hugger | quote }}
  INHIBITOR_TENSOR_FOOL: {{ .Values.contingency.inhibitorTensorFool | quote }}
  JEALOUS_ASTRAKHAN: {{ .Values.contingency.jealousAstrakhan | quote }}
  PASSENGER: {{ .Values.contingency.passenger | quote }}
  QUAIL_DISCOURSE_AARDVARK: {{ .Values.contingency.quailDiscourseAardvark | quote
    }}
  TOURIST_CRITERION_PROVIDER: {{ .Values.contingency.touristCriterionProvider | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "contingency.fullname" . }}-contingency
  labels:
  {{- include "contingency.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: contingency
spec:
  replicas: {{ .Values.contingency.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: contingency
      app.kubernetes.io/name: sidewalk
    {{- include "contingency.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: contingency
        app.kubernetes.io/name: sidewalk
      {{- include "contingency.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ee295dcd57cdd4c037088e331845490beab2d93144010dadb523f90bcaf69b72
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "contingency.fullname" . }}-contingency
        image: {{ .Values.contingency.contingency.image.repository }}:{{ .Values.contingency.contingency.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.contingency.contingency.imagePullPolicy }}
        name: contingency
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.contingency.contingency.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.contingency.contingency.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "contingency.fullname" . }}-contingency
  labels:
  {{- include "contingency.labels" . | nindent 4 }}
spec:
  type: {{ .Values.contingency.type }}
  selector:
    app.kubernetes.io/instance: contingency
    app.kubernetes.io/name: sidewalk
  {{- include "contingency.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.contingency.ports | toYaml | nindent 2 -}}
contingency:
  adviserJointFlintlock: delay
  contingency:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  dependencyMatchmakerDeranged: empty
  diffusePouchTrowel: census
  foolishSloppySuspend: tenement
  grenadeDaily: contrast
  hugger: porpoise
  inhibitorTensorFool: inscription
  jealousAstrakhan: shearling
  passenger: cash
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  quailDiscourseAardvark: boy
  replicas: 1
  touristCriterionProvider: poppy
  type: ClusterIP
kubernetesClusterDomain: cluster.local
