# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "widow.fullname" . }}-widow
  labels:
  {{- include "widow.labels" . | nindent 4 }}
data:
  BOWTIE: {{ .Values.widow.bowtie | quote }}
  DIGIT_ROBOT_DEFENDER: {{ .Values.widow.digitRobotDefender | quote }}
  HAPPINESS_STABILITY_CUCKOO: {{ .Values.widow.happinessStabilityCuckoo | quote }}
  HARDSHIP_SUPPORTER_FORSAKE: {{ .Values.widow.hardshipSupporterForsake | quote }}
  MAJOR-LEAGUE: {{ .Values.widow.majorLeague | quote }}
  MAKEUP_HEAP_RETAILER: {{ .Values.widow.makeupHeapRetailer | quote }}
  MAT_STENCH_TOE: {{ .Values.widow.matStenchToe | quote }}
  PROCEEDINGS_TUNE: {{ .Values.widow.proceedingsTune | quote }}
  PROTECTIVE_WACKY: {{ .Values.widow.protectiveWacky | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "widow.fullname" . }}-widow
  labels:
  {{- include "widow.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: widow
spec:
  replicas: {{ .Values.widow.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: widow
      app.kubernetes.io/name: expose
    {{- include "widow.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: widow
        app.kubernetes.io/name: expose
      {{- include "widow.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 5bcbd9c61f15faf3eefd0ad097affbfd559c8bdcd46829a98deebab43b215090
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "widow.fullname" . }}-widow
        image: {{ .Values.widow.widow.image.repository }}:{{ .Values.widow.widow.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.widow.widow.imagePullPolicy }}
        name: widow
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.widow.widow.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.widow.widow.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "widow.fullname" . }}-widow
  labels:
  {{- include "widow.labels" . | nindent 4 }}
spec:
  type: {{ .Values.widow.type }}
  selector:
    app.kubernetes.io/instance: widow
    app.kubernetes.io/name: expose
  {{- include "widow.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.widow.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
widow:
  bowtie: lying
  digitRobotDefender: bump
  happinessStabilityCuckoo: anarchist
  hardshipSupporterForsake: mallet
  majorLeague: decay
  makeupHeapRetailer: CD
  matStenchToe: horizon
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  proceedingsTune: bass
  protectiveWacky: lounge
  replicas: 1
  type: ClusterIP
  widow:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
