# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "righteous.fullname" . }}-righteous
  labels:
  {{- include "righteous.labels" . | nindent 4 }}
data:
  APRON_SUNDIAL: {{ .Values.righteous.apronSundial | quote }}
  BURLESQUE: {{ .Values.righteous.burlesque | quote }}
  CERTIFICATE_TRANSCRIPT_MISOGYNY: {{ .Values.righteous.certificateTranscriptMisogyny
    | quote }}
  FONDUE: {{ .Values.righteous.fondue | quote }}
  HOMELESS_LACK_TRACT: {{ .Values.righteous.homelessLackTract | quote }}
  JEALOUSY_BEND_HUT: {{ .Values.righteous.jealousyBendHut | quote }}
  LIQUIDITY_OVERHEAD_CURE: {{ .Values.righteous.liquidityOverheadCure | quote }}
  MECCA: {{ .Values.righteous.mecca | quote }}
  RIB_FOUNDING_TROT: {{ .Values.righteous.ribFoundingTrot | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "righteous.fullname" . }}-righteous
  labels:
  {{- include "righteous.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: righteous
spec:
  replicas: {{ .Values.righteous.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: righteous
      app.kubernetes.io/name: porpoise
    {{- include "righteous.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: righteous
        app.kubernetes.io/name: porpoise
      {{- include "righteous.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 8d509ff9b7716bc886f8c343d539722d757670ae18b68c7ad2ba1247c39922ad
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "righteous.fullname" . }}-righteous
        image: {{ .Values.righteous.righteous.image.repository }}:{{ .Values.righteous.righteous.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.righteous.righteous.imagePullPolicy }}
        name: righteous
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.righteous.righteous.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.righteous.righteous.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "righteous.fullname" . }}-righteous
  labels:
  {{- include "righteous.labels" . | nindent 4 }}
spec:
  type: {{ .Values.righteous.type }}
  selector:
    app.kubernetes.io/instance: righteous
    app.kubernetes.io/name: porpoise
  {{- include "righteous.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.righteous.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
righteous:
  apronSundial: riddle
  burlesque: precision
  certificateTranscriptMisogyny: energy
  fondue: wonder
  homelessLackTract: wild
  jealousyBendHut: cruise
  liquidityOverheadCure: enactment
  mecca: passage
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  ribFoundingTrot: hardware
  righteous:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
