# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "sundial.fullname" . }}-sundial
  labels:
  {{- include "sundial.labels" . | nindent 4 }}
data:
  DETENTION: {{ .Values.sundial.detention | quote }}
  DOMINEERING: {{ .Values.sundial.domineering | quote }}
  GIGANTIC_NONCONFORMIST_EMERY: {{ .Values.sundial.giganticNonconformistEmery | quote
    }}
  GRUB_TOWNHOUSE: {{ .Values.sundial.grubTownhouse | quote }}
  GRUBBY_TELESCREEN: {{ .Values.sundial.grubbyTelescreen | quote }}
  INDIGENCE_STEP-MOTHER: {{ .Values.sundial.indigenceStepMother | quote }}
  INVESTMENT: {{ .Values.sundial.investment | quote }}
  IVORY: {{ .Values.sundial.ivory | quote }}
  LABOR_ENSURE: {{ .Values.sundial.laborEnsure | quote }}
  MISNOMER: {{ .Values.sundial.misnomer | quote }}
  SIP: {{ .Values.sundial.sip | quote }}
  YEW_PORK: {{ .Values.sundial.yewPork | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "sundial.fullname" . }}-sundial
  labels:
  {{- include "sundial.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: sundial
spec:
  replicas: {{ .Values.sundial.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: sundial
      app.kubernetes.io/name: matrix
    {{- include "sundial.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: sundial
        app.kubernetes.io/name: matrix
      {{- include "sundial.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 6be136829a4847f84b821cbb9f18f21b02740bf17c59c70782b0cb8f83f299dc
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "sundial.fullname" . }}-sundial
        image: {{ .Values.sundial.sundial.image.repository }}:{{ .Values.sundial.sundial.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.sundial.sundial.imagePullPolicy }}
        name: sundial
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.sundial.sundial.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.sundial.sundial.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "sundial.fullname" . }}-sundial
  labels:
  {{- include "sundial.labels" . | nindent 4 }}
spec:
  type: {{ .Values.sundial.type }}
  selector:
    app.kubernetes.io/instance: sundial
    app.kubernetes.io/name: matrix
  {{- include "sundial.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.sundial.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
sundial:
  detention: reporting
  domineering: philosopher
  giganticNonconformistEmery: humour
  grubTownhouse: unbiased
  grubbyTelescreen: horde
  indigenceStepMother: proposal
  investment: inheritance
  ivory: chip
  laborEnsure: twitter
  misnomer: gentle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sip: request
  sundial:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  yewPork: pocket-watch
