# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "crack.fullname" . }}-crack
  labels:
  {{- include "crack.labels" . | nindent 4 }}
data:
  EGGNOG: {{ .Values.crack.eggnog | quote }}
  JACKFRUIT_AVALANCHE_CONFRONT: {{ .Values.crack.jackfruitAvalancheConfront | quote
    }}
  MONITOR_FAIR: {{ .Values.crack.monitorFair | quote }}
  PASSBOOK_NIECE_ONION: {{ .Values.crack.passbookNieceOnion | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "crack.fullname" . }}-crack
  labels:
  {{- include "crack.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: crack
spec:
  replicas: {{ .Values.crack.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: crack
      app.kubernetes.io/name: western
    {{- include "crack.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: crack
        app.kubernetes.io/name: western
      {{- include "crack.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: cb1fd73bc6800fb9c1cd85fc9e413263ad1b16850aa3d46385ae99defc83a6a5
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "crack.fullname" . }}-crack
        image: {{ .Values.crack.crack.image.repository }}:{{ .Values.crack.crack.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.crack.crack.imagePullPolicy }}
        name: crack
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.crack.crack.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.crack.crack.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "crack.fullname" . }}-crack
  labels:
  {{- include "crack.labels" . | nindent 4 }}
spec:
  type: {{ .Values.crack.type }}
  selector:
    app.kubernetes.io/instance: crack
    app.kubernetes.io/name: western
  {{- include "crack.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.crack.ports | toYaml | nindent 2 -}}
crack:
  crack:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  eggnog: assault
  jackfruitAvalancheConfront: jumbled
  monitorFair: snail
  passbookNieceOnion: noisy
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
