# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "hydrant.fullname" . }}-hydrant
  labels:
  {{- include "hydrant.labels" . | nindent 4 }}
data:
  CHICKEN: {{ .Values.hydrant.chicken | quote }}
  ISCHEMIA_SHORE_FRETFUL: {{ .Values.hydrant.ischemiaShoreFretful | quote }}
  LODE_IDEOLOGY_THEME: {{ .Values.hydrant.lodeIdeologyTheme | quote }}
  PUSH: {{ .Values.hydrant.push | quote }}
  RIGHTFUL_PHEASANT: {{ .Values.hydrant.rightfulPheasant | quote }}
  STEP-GRANDFATHER_SPELL_TEA: {{ .Values.hydrant.stepGrandfatherSpellTea | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hydrant.fullname" . }}-hydrant
  labels:
  {{- include "hydrant.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: hydrant
spec:
  replicas: {{ .Values.hydrant.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: hydrant
      app.kubernetes.io/name: resolution
    {{- include "hydrant.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: hydrant
        app.kubernetes.io/name: resolution
      {{- include "hydrant.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5313285766528656ec3bbd9ca426b101d39325f2d41817536b066696a2fcdfaf
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "hydrant.fullname" . }}-hydrant
        image: {{ .Values.hydrant.hydrant.image.repository }}:{{ .Values.hydrant.hydrant.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.hydrant.hydrant.imagePullPolicy }}
        name: hydrant
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.hydrant.hydrant.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.hydrant.hydrant.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "hydrant.fullname" . }}-hydrant
  labels:
  {{- include "hydrant.labels" . | nindent 4 }}
spec:
  type: {{ .Values.hydrant.type }}
  selector:
    app.kubernetes.io/instance: hydrant
    app.kubernetes.io/name: resolution
  {{- include "hydrant.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.hydrant.ports | toYaml | nindent 2 -}}
hydrant:
  chicken: dialect
  hydrant:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ischemiaShoreFretful: gate
  lodeIdeologyTheme: courageous
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  push: coalition
  replicas: 1
  rightfulPheasant: catsup
  stepGrandfatherSpellTea: obtainable
  type: ClusterIP
kubernetesClusterDomain: cluster.local
