# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "terrible.fullname" . }}-terrible
  labels:
  {{- include "terrible.labels" . | nindent 4 }}
data:
  ANGRY: {{ .Values.terrible.angry | quote }}
  GOING_RECOLLECTION: {{ .Values.terrible.goingRecollection | quote }}
  HIRE: {{ .Values.terrible.hire | quote }}
  INCOME: {{ .Values.terrible.income | quote }}
  JUGGLE_TRADITIONALISM: {{ .Values.terrible.juggleTraditionalism | quote }}
  KILLER_ACHIEVER_NOSY: {{ .Values.terrible.killerAchieverNosy | quote }}
  RIFLE: {{ .Values.terrible.rifle | quote }}
  WHISKER_BADGER_SWALLOW: {{ .Values.terrible.whiskerBadgerSwallow | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "terrible.fullname" . }}-terrible
  labels:
  {{- include "terrible.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: terrible
spec:
  replicas: {{ .Values.terrible.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: terrible
      app.kubernetes.io/name: precious
    {{- include "terrible.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: terrible
        app.kubernetes.io/name: precious
      {{- include "terrible.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: bcbdc088eca7f2ba2475ab5458af919879c5b00501c1a892334bc697c9968a6a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "terrible.fullname" . }}-terrible
        image: {{ .Values.terrible.terrible.image.repository }}:{{ .Values.terrible.terrible.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.terrible.terrible.imagePullPolicy }}
        name: terrible
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.terrible.terrible.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.terrible.terrible.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "terrible.fullname" . }}-terrible
  labels:
  {{- include "terrible.labels" . | nindent 4 }}
spec:
  type: {{ .Values.terrible.type }}
  selector:
    app.kubernetes.io/instance: terrible
    app.kubernetes.io/name: precious
  {{- include "terrible.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.terrible.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
terrible:
  angry: high-rise
  goingRecollection: measly
  hire: dragon
  income: zoology
  juggleTraditionalism: revise
  killerAchieverNosy: bronco
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rifle: naive
  terrible:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  whiskerBadgerSwallow: stuff
