# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "handgun.fullname" . }}-handgun
  labels:
  {{- include "handgun.labels" . | nindent 4 }}
data:
  COMPLETION_PURITY_DISAGREE: {{ .Values.handgun.completionPurityDisagree | quote
    }}
  EICOSANOID: {{ .Values.handgun.eicosanoid | quote }}
  ENGINEERING_SUBCOMPONENT_TOOTHPASTE: {{ .Values.handgun.engineeringSubcomponentToothpaste
    | quote }}
  NOODLES_PERCH_ZIGGURAT: {{ .Values.handgun.noodlesPerchZiggurat | quote }}
  PARTY_FORTRESS: {{ .Values.handgun.partyFortress | quote }}
  SATIRE: {{ .Values.handgun.satire | quote }}
  TELESCREEN_CHOLESTEROL_TUB: {{ .Values.handgun.telescreenCholesterolTub | quote
    }}
  TOURIST_SINGER: {{ .Values.handgun.touristSinger | quote }}
  WEB_KEYSTONE_PLOVER: {{ .Values.handgun.webKeystonePlover | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "handgun.fullname" . }}-handgun
  labels:
  {{- include "handgun.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: handgun
spec:
  replicas: {{ .Values.handgun.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: handgun
      app.kubernetes.io/name: freeze
    {{- include "handgun.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: handgun
        app.kubernetes.io/name: freeze
      {{- include "handgun.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 30279d474e159edd593c7d7de43f235ea7e8c97ea8e0050fa1b5c4ff663b77f3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "handgun.fullname" . }}-handgun
        image: {{ .Values.handgun.handgun.image.repository }}:{{ .Values.handgun.handgun.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.handgun.handgun.imagePullPolicy }}
        name: handgun
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.handgun.handgun.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.handgun.handgun.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "handgun.fullname" . }}-handgun
  labels:
  {{- include "handgun.labels" . | nindent 4 }}
spec:
  type: {{ .Values.handgun.type }}
  selector:
    app.kubernetes.io/instance: handgun
    app.kubernetes.io/name: freeze
  {{- include "handgun.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.handgun.ports | toYaml | nindent 2 -}}
handgun:
  completionPurityDisagree: weave
  eicosanoid: booster
  engineeringSubcomponentToothpaste: first
  handgun:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  noodlesPerchZiggurat: onset
  partyFortress: shield
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  satire: documentation
  telescreenCholesterolTub: quiver
  touristSinger: satire
  type: ClusterIP
  webKeystonePlover: boar
kubernetesClusterDomain: cluster.local
