# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "alcoholic.fullname" . }}-alcoholic
  labels:
  {{- include "alcoholic.labels" . | nindent 4 }}
data:
  GIDDY_ATTENDANCE_CALM: {{ .Values.alcoholic.giddyAttendanceCalm | quote }}
  GIRAFFE: {{ .Values.alcoholic.giraffe | quote }}
  MENU_FEDERATION: {{ .Values.alcoholic.menuFederation | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "alcoholic.fullname" . }}-alcoholic
  labels:
  {{- include "alcoholic.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: alcoholic
spec:
  replicas: {{ .Values.alcoholic.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: alcoholic
      app.kubernetes.io/name: omission
    {{- include "alcoholic.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: alcoholic
        app.kubernetes.io/name: omission
      {{- include "alcoholic.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8596473cd1d832169fdf19dc30f03806b6ab29d90624b83d8b1118ddf19aa1ea
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "alcoholic.fullname" . }}-alcoholic
        image: {{ .Values.alcoholic.alcoholic.image.repository }}:{{ .Values.alcoholic.alcoholic.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.alcoholic.alcoholic.imagePullPolicy }}
        name: alcoholic
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.alcoholic.alcoholic.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.alcoholic.alcoholic.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "alcoholic.fullname" . }}-alcoholic
  labels:
  {{- include "alcoholic.labels" . | nindent 4 }}
spec:
  type: {{ .Values.alcoholic.type }}
  selector:
    app.kubernetes.io/instance: alcoholic
    app.kubernetes.io/name: omission
  {{- include "alcoholic.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.alcoholic.ports | toYaml | nindent 2 -}}
alcoholic:
  alcoholic:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  giddyAttendanceCalm: bootee
  giraffe: dive
  menuFederation: crinoline
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
