# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "ribbon.fullname" . }}-ribbon
  labels:
  {{- include "ribbon.labels" . | nindent 4 }}
data:
  HANDOVER: {{ .Values.ribbon.handover | quote }}
  METAPHOR_CROSS-STITCH: {{ .Values.ribbon.metaphorCrossStitch | quote }}
  OBTAINABLE_AFTERNOON: {{ .Values.ribbon.obtainableAfternoon | quote }}
  PUNCH_SPOOL_TACO: {{ .Values.ribbon.punchSpoolTaco | quote }}
  QUICKSAND_SLINK: {{ .Values.ribbon.quicksandSlink | quote }}
  SKIRT: {{ .Values.ribbon.skirt | quote }}
  SPIRITUAL: {{ .Values.ribbon.spiritual | quote }}
  TINTYPE_DIVING: {{ .Values.ribbon.tintypeDiving | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "ribbon.fullname" . }}-ribbon
  labels:
  {{- include "ribbon.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: ribbon
spec:
  replicas: {{ .Values.ribbon.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: ribbon
      app.kubernetes.io/name: mundane
    {{- include "ribbon.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ribbon
        app.kubernetes.io/name: mundane
      {{- include "ribbon.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 4e9ebef704a83480629670634fe3ec46f87808f43c6fa50d680f6a90c8989a71
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "ribbon.fullname" . }}-ribbon
        image: {{ .Values.ribbon.ribbon.image.repository }}:{{ .Values.ribbon.ribbon.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.ribbon.ribbon.imagePullPolicy }}
        name: ribbon
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.ribbon.ribbon.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.ribbon.ribbon.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "ribbon.fullname" . }}-ribbon
  labels:
  {{- include "ribbon.labels" . | nindent 4 }}
spec:
  type: {{ .Values.ribbon.type }}
  selector:
    app.kubernetes.io/instance: ribbon
    app.kubernetes.io/name: mundane
  {{- include "ribbon.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.ribbon.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
ribbon:
  handover: hallway
  metaphorCrossStitch: casserole
  obtainableAfternoon: popsicle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  punchSpoolTaco: marshmallow
  quicksandSlink: bibliography
  replicas: 1
  ribbon:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  skirt: volatile
  spiritual: chrome
  tintypeDiving: wrist
  type: ClusterIP
