# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "commonsense.fullname" . }}-commonsense
  labels:
  {{- include "commonsense.labels" . | nindent 4 }}
data:
  BARN_QUESTIONNAIRE_EPISODE: {{ .Values.commonsense.barnQuestionnaireEpisode | quote
    }}
  BROKEN_ELECTION_BIRD: {{ .Values.commonsense.brokenElectionBird | quote }}
  CRAVAT: {{ .Values.commonsense.cravat | quote }}
  ENTHUSIASTIC_EPITHELIUM_FUNCTION: {{ .Values.commonsense.enthusiasticEpitheliumFunction
    | quote }}
  HURRIED: {{ .Values.commonsense.hurried | quote }}
  KILLING: {{ .Values.commonsense.killing | quote }}
  RUTHLESS_VANE_SUGAR: {{ .Values.commonsense.ruthlessVaneSugar | quote }}
  SOLITAIRE: {{ .Values.commonsense.solitaire | quote }}
  SUPERVISE_SPOKESMAN: {{ .Values.commonsense.superviseSpokesman | quote }}
  WEBINAR_PORCH: {{ .Values.commonsense.webinarPorch | quote }}
  WOLF: {{ .Values.commonsense.wolf | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "commonsense.fullname" . }}-commonsense
  labels:
  {{- include "commonsense.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: commonsense
spec:
  replicas: {{ .Values.commonsense.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: commonsense
      app.kubernetes.io/name: bulb
    {{- include "commonsense.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: commonsense
        app.kubernetes.io/name: bulb
      {{- include "commonsense.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: aabdcfe95e2063434f6ba5998e7acac6aadcce0ed32c44c4bebe52534d30f899
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "commonsense.fullname" . }}-commonsense
        image: {{ .Values.commonsense.commonsense.image.repository }}:{{ .Values.commonsense.commonsense.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.commonsense.commonsense.imagePullPolicy }}
        name: commonsense
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.commonsense.commonsense.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.commonsense.commonsense.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "commonsense.fullname" . }}-commonsense
  labels:
  {{- include "commonsense.labels" . | nindent 4 }}
spec:
  type: {{ .Values.commonsense.type }}
  selector:
    app.kubernetes.io/instance: commonsense
    app.kubernetes.io/name: bulb
  {{- include "commonsense.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.commonsense.ports | toYaml | nindent 2 -}}
commonsense:
  barnQuestionnaireEpisode: journal
  brokenElectionBird: asphalt
  commonsense:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  cravat: exclamation
  enthusiasticEpitheliumFunction: traffic
  hurried: hydrolyse
  killing: solid
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  ruthlessVaneSugar: priesthood
  solitaire: trail
  superviseSpokesman: appetizer
  type: ClusterIP
  webinarPorch: saviour
  wolf: albatross
kubernetesClusterDomain: cluster.local
