# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "kielbasa.fullname" . }}-kielbasa
  labels:
  {{- include "kielbasa.labels" . | nindent 4 }}
data:
  INITIALIZE_EARN: {{ .Values.kielbasa.initializeEarn | quote }}
  NORMALIZATION_HEADACHE_INJUNCTION: {{ .Values.kielbasa.normalizationHeadacheInjunction
    | quote }}
  POSSESS_SURROUNDS: {{ .Values.kielbasa.possessSurrounds | quote }}
  SAVORY_CORRECT_ADDICTED: {{ .Values.kielbasa.savoryCorrectAddicted | quote }}
  SPREADSHEET_ASSISTANT: {{ .Values.kielbasa.spreadsheetAssistant | quote }}
  TENNIS: {{ .Values.kielbasa.tennis | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "kielbasa.fullname" . }}-kielbasa
  labels:
  {{- include "kielbasa.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: kielbasa
spec:
  replicas: {{ .Values.kielbasa.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: kielbasa
      app.kubernetes.io/name: caftan
    {{- include "kielbasa.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: kielbasa
        app.kubernetes.io/name: caftan
      {{- include "kielbasa.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 603897822c60ad41e63b5fa265f87a98c88a8c0c9cc964219d88a8d06ddd8f7a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "kielbasa.fullname" . }}-kielbasa
        image: {{ .Values.kielbasa.kielbasa.image.repository }}:{{ .Values.kielbasa.kielbasa.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.kielbasa.kielbasa.imagePullPolicy }}
        name: kielbasa
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.kielbasa.kielbasa.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.kielbasa.kielbasa.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "kielbasa.fullname" . }}-kielbasa
  labels:
  {{- include "kielbasa.labels" . | nindent 4 }}
spec:
  type: {{ .Values.kielbasa.type }}
  selector:
    app.kubernetes.io/instance: kielbasa
    app.kubernetes.io/name: caftan
  {{- include "kielbasa.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.kielbasa.ports | toYaml | nindent 2 -}}
kielbasa:
  initializeEarn: ton
  kielbasa:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  normalizationHeadacheInjunction: ashtray
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  possessSurrounds: intent
  replicas: 1
  savoryCorrectAddicted: tempo
  spreadsheetAssistant: zealous
  tennis: tonality
  type: ClusterIP
kubernetesClusterDomain: cluster.local
