# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "availability.fullname" . }}-availability
  labels:
  {{- include "availability.labels" . | nindent 4 }}
data:
  ASTROLOGY_VOLLEYBALL_TIMER: {{ .Values.availability.astrologyVolleyballTimer |
    quote }}
  BEER: {{ .Values.availability.beer | quote }}
  BUNGHOLE: {{ .Values.availability.bunghole | quote }}
  CHEERFUL_MINI-SKIRT: {{ .Values.availability.cheerfulMiniSkirt | quote }}
  COMPASSIONATE_ARROGANCE_STAND: {{ .Values.availability.compassionateArroganceStand
    | quote }}
  EXPENSE_MATERIALISTIC: {{ .Values.availability.expenseMaterialistic | quote }}
  HOUR_ALARM_PAPAYA: {{ .Values.availability.hourAlarmPapaya | quote }}
  MUSCLE: {{ .Values.availability.muscle | quote }}
  PEPPERONI: {{ .Values.availability.pepperoni | quote }}
  RUSTIC_QUEEN: {{ .Values.availability.rusticQueen | quote }}
  X-RATED_HUMDRUM_VOID: {{ .Values.availability.xRatedHumdrumVoid | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "availability.fullname" . }}-availability
  labels:
  {{- include "availability.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: availability
spec:
  replicas: {{ .Values.availability.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: availability
      app.kubernetes.io/name: long
    {{- include "availability.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: availability
        app.kubernetes.io/name: long
      {{- include "availability.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: d680b6846ddab88fd20737c54e08549934f1d6616ab8790affa93ec9b71b9621
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "availability.fullname" . }}-availability
        image: {{ .Values.availability.availability.image.repository }}:{{ .Values.availability.availability.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.availability.availability.imagePullPolicy }}
        name: availability
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.availability.availability.resources | nindent 10
          }}
        securityContext: {{- toYaml .Values.availability.availability.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "availability.fullname" . }}-availability
  labels:
  {{- include "availability.labels" . | nindent 4 }}
spec:
  type: {{ .Values.availability.type }}
  selector:
    app.kubernetes.io/instance: availability
    app.kubernetes.io/name: long
  {{- include "availability.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.availability.ports | toYaml | nindent 2 -}}
availability:
  astrologyVolleyballTimer: official
  availability:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  beer: allow
  bunghole: shoat
  cheerfulMiniSkirt: trouble
  compassionateArroganceStand: stepdaughter
  expenseMaterialistic: scow
  hourAlarmPapaya: volleyball
  muscle: barbiturate
  pepperoni: adopt
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rusticQueen: pray
  type: ClusterIP
  xRatedHumdrumVoid: restoration
kubernetesClusterDomain: cluster.local
