# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "suicide.fullname" . }}-suicide
  labels:
  {{- include "suicide.labels" . | nindent 4 }}
data:
  PHRASING_CRUDE_HALL: {{ .Values.suicide.phrasingCrudeHall | quote }}
  SPORK: {{ .Values.suicide.spork | quote }}
  TRAIL_LEGGING: {{ .Values.suicide.trailLegging | quote }}
  WHISTLE_INDUSTRY_DEFENDER: {{ .Values.suicide.whistleIndustryDefender | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "suicide.fullname" . }}-suicide
  labels:
  {{- include "suicide.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: suicide
spec:
  replicas: {{ .Values.suicide.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: suicide
      app.kubernetes.io/name: adult
    {{- include "suicide.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: suicide
        app.kubernetes.io/name: adult
      {{- include "suicide.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 070cefc7dc2bf99b19ea8cf9d72d8d95bbe7f25d575d7ebd7f2c9a1bdd497685
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "suicide.fullname" . }}-suicide
        image: {{ .Values.suicide.suicide.image.repository }}:{{ .Values.suicide.suicide.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.suicide.suicide.imagePullPolicy }}
        name: suicide
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.suicide.suicide.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.suicide.suicide.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "suicide.fullname" . }}-suicide
  labels:
  {{- include "suicide.labels" . | nindent 4 }}
spec:
  type: {{ .Values.suicide.type }}
  selector:
    app.kubernetes.io/instance: suicide
    app.kubernetes.io/name: adult
  {{- include "suicide.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.suicide.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
suicide:
  phrasingCrudeHall: small
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  spork: unaccountable
  suicide:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  trailLegging: transit
  type: ClusterIP
  whistleIndustryDefender: housewife
