# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "electronics.fullname" . }}-electronics
  labels:
  {{- include "electronics.labels" . | nindent 4 }}
data:
  CORPORAL: {{ .Values.electronics.corporal | quote }}
  DEPTH_MONKEY: {{ .Values.electronics.depthMonkey | quote }}
  GO-KART: {{ .Values.electronics.goKart | quote }}
  INJUNCTION_FORK: {{ .Values.electronics.injunctionFork | quote }}
  PARADE_FAUCET: {{ .Values.electronics.paradeFaucet | quote }}
  PARCEL: {{ .Values.electronics.parcel | quote }}
  PENITENT_BOX_CLASSIFICATION: {{ .Values.electronics.penitentBoxClassification |
    quote }}
  WAX_RAPE_RESPITE: {{ .Values.electronics.waxRapeRespite | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "electronics.fullname" . }}-electronics
  labels:
  {{- include "electronics.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: electronics
spec:
  replicas: {{ .Values.electronics.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: electronics
      app.kubernetes.io/name: painful
    {{- include "electronics.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: electronics
        app.kubernetes.io/name: painful
      {{- include "electronics.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6210d73955f433c3f16604ed6b2dbc2819e1dbaae24fa539b17d94a02eaed470
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "electronics.fullname" . }}-electronics
        image: {{ .Values.electronics.electronics.image.repository }}:{{ .Values.electronics.electronics.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.electronics.electronics.imagePullPolicy }}
        name: electronics
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.electronics.electronics.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.electronics.electronics.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "electronics.fullname" . }}-electronics
  labels:
  {{- include "electronics.labels" . | nindent 4 }}
spec:
  type: {{ .Values.electronics.type }}
  selector:
    app.kubernetes.io/instance: electronics
    app.kubernetes.io/name: painful
  {{- include "electronics.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.electronics.ports | toYaml | nindent 2 -}}
electronics:
  corporal: jackfruit
  depthMonkey: shake
  electronics:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  goKart: devilish
  injunctionFork: conscience
  paradeFaucet: yellow
  parcel: step-son
  penitentBoxClassification: society
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  type: ClusterIP
  waxRapeRespite: fine
kubernetesClusterDomain: cluster.local
