# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "legislature.fullname" . }}-legislature
  labels:
  {{- include "legislature.labels" . | nindent 4 }}
data:
  DAMAGING_BOTTLING_COMPETITOR: {{ .Values.legislature.damagingBottlingCompetitor
    | quote }}
  IRONCLAD_FASCIA_ENCLAVE: {{ .Values.legislature.ironcladFasciaEnclave | quote }}
  OXFORD_POSTER: {{ .Values.legislature.oxfordPoster | quote }}
  PRESERVES_DRYER_JUDICIOUS: {{ .Values.legislature.preservesDryerJudicious | quote
    }}
  SANDBAR_ADVERB_REPORTING: {{ .Values.legislature.sandbarAdverbReporting | quote
    }}
  SHRINE: {{ .Values.legislature.shrine | quote }}
  WRESTLER_FANTASTIC: {{ .Values.legislature.wrestlerFantastic | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "legislature.fullname" . }}-legislature
  labels:
  {{- include "legislature.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: legislature
spec:
  replicas: {{ .Values.legislature.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: legislature
      app.kubernetes.io/name: catalyst
    {{- include "legislature.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: legislature
        app.kubernetes.io/name: catalyst
      {{- include "legislature.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: eaa93d9820c9e4d75dcabac5595b388f9d4e7f9fb9cda6143b87250541f669c7
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "legislature.fullname" . }}-legislature
        image: {{ .Values.legislature.legislature.image.repository }}:{{ .Values.legislature.legislature.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.legislature.legislature.imagePullPolicy }}
        name: legislature
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.legislature.legislature.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.legislature.legislature.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "legislature.fullname" . }}-legislature
  labels:
  {{- include "legislature.labels" . | nindent 4 }}
spec:
  type: {{ .Values.legislature.type }}
  selector:
    app.kubernetes.io/instance: legislature
    app.kubernetes.io/name: catalyst
  {{- include "legislature.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.legislature.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
legislature:
  damagingBottlingCompetitor: sadness
  ironcladFasciaEnclave: nothing
  legislature:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  oxfordPoster: click
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preservesDryerJudicious: horn
  replicas: 1
  sandbarAdverbReporting: repulsive
  shrine: velocity
  type: ClusterIP
  wrestlerFantastic: grove
