# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "zampone.fullname" . }}-zampone
  labels:
  {{- include "zampone.labels" . | nindent 4 }}
data:
  AGENT_TOWER: {{ .Values.zampone.agentTower | quote }}
  ALTITUDE_URN: {{ .Values.zampone.altitudeUrn | quote }}
  CRITIQUE: {{ .Values.zampone.critique | quote }}
  MEASLY: {{ .Values.zampone.measly | quote }}
  SHUTDOWN: {{ .Values.zampone.shutdown | quote }}
  SOOTHE_ABOARD: {{ .Values.zampone.sootheAboard | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "zampone.fullname" . }}-zampone
  labels:
  {{- include "zampone.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: zampone
spec:
  replicas: {{ .Values.zampone.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: zampone
      app.kubernetes.io/name: reject
    {{- include "zampone.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: zampone
        app.kubernetes.io/name: reject
      {{- include "zampone.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 3e617964f11df71d8b2a3733ba3d6fd2d527edd566b53acc9d549486e9df3823
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "zampone.fullname" . }}-zampone
        image: {{ .Values.zampone.zampone.image.repository }}:{{ .Values.zampone.zampone.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.zampone.zampone.imagePullPolicy }}
        name: zampone
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.zampone.zampone.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.zampone.zampone.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "zampone.fullname" . }}-zampone
  labels:
  {{- include "zampone.labels" . | nindent 4 }}
spec:
  type: {{ .Values.zampone.type }}
  selector:
    app.kubernetes.io/instance: zampone
    app.kubernetes.io/name: reject
  {{- include "zampone.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.zampone.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
zampone:
  agentTower: major
  altitudeUrn: insure
  critique: judgment
  measly: equipment
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  shutdown: wolf
  sootheAboard: somber
  type: ClusterIP
  zampone:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
