# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "rib.fullname" . }}-rib
  labels:
  {{- include "rib.labels" . | nindent 4 }}
data:
  CHAIRMAN_CERAMICS_NEWSPRINT: {{ .Values.rib.chairmanCeramicsNewsprint | quote }}
  DECISION-MAKING_SHOELACE_CLUTCH: {{ .Values.rib.decisionMakingShoelaceClutch |
    quote }}
  INSURANCE: {{ .Values.rib.insurance | quote }}
  MINIBUS_VEIN: {{ .Values.rib.minibusVein | quote }}
  PEASANT_BACKPACK: {{ .Values.rib.peasantBackpack | quote }}
  RECEIVER_PROBATION_GASTROPOD: {{ .Values.rib.receiverProbationGastropod | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "rib.fullname" . }}-rib
  labels:
  {{- include "rib.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: rib
spec:
  replicas: {{ .Values.rib.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: rib
      app.kubernetes.io/name: deadline
    {{- include "rib.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: rib
        app.kubernetes.io/name: deadline
      {{- include "rib.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2ccb3e1a9f9777cf9157270ba0d57bc0a61c6825b98d4a6fadffba9239de1c53
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "rib.fullname" . }}-rib
        image: {{ .Values.rib.rib.image.repository }}:{{ .Values.rib.rib.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.rib.rib.imagePullPolicy }}
        name: rib
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.rib.rib.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.rib.rib.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "rib.fullname" . }}-rib
  labels:
  {{- include "rib.labels" . | nindent 4 }}
spec:
  type: {{ .Values.rib.type }}
  selector:
    app.kubernetes.io/instance: rib
    app.kubernetes.io/name: deadline
  {{- include "rib.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.rib.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
rib:
  chairmanCeramicsNewsprint: point
  decisionMakingShoelaceClutch: mouth
  insurance: past
  minibusVein: ad hoc
  peasantBackpack: grandmom
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  receiverProbationGastropod: seeker
  replicas: 1
  rib:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
