# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "screeching.fullname" . }}-screeching
  labels:
  {{- include "screeching.labels" . | nindent 4 }}
data:
  ALBUM: {{ .Values.screeching.album | quote }}
  ECCLESIA_HACKSAW: {{ .Values.screeching.ecclesiaHacksaw | quote }}
  PASSING: {{ .Values.screeching.passing | quote }}
  SPOKESMAN_WRECKER: {{ .Values.screeching.spokesmanWrecker | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "screeching.fullname" . }}-screeching
  labels:
  {{- include "screeching.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: screeching
spec:
  replicas: {{ .Values.screeching.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: screeching
      app.kubernetes.io/name: embossing
    {{- include "screeching.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: screeching
        app.kubernetes.io/name: embossing
      {{- include "screeching.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: fca0060e49c336b29b01af68ad5c2ebe4249c7c9e9d2c44f1652e11a597b6fdb
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "screeching.fullname" . }}-screeching
        image: {{ .Values.screeching.screeching.image.repository }}:{{ .Values.screeching.screeching.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.screeching.screeching.imagePullPolicy }}
        name: screeching
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.screeching.screeching.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.screeching.screeching.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "screeching.fullname" . }}-screeching
  labels:
  {{- include "screeching.labels" . | nindent 4 }}
spec:
  type: {{ .Values.screeching.type }}
  selector:
    app.kubernetes.io/instance: screeching
    app.kubernetes.io/name: embossing
  {{- include "screeching.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.screeching.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
screeching:
  album: final
  ecclesiaHacksaw: amazon
  passing: ram
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  screeching:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  spokesmanWrecker: grumpy
  type: ClusterIP
