# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cuff-link.fullname" . }}-cuff-link
  labels:
  {{- include "cuff-link.labels" . | nindent 4 }}
data:
  CONSIGNMENT_CUSHION_CARTILAGE: {{ .Values.cuffLink.consignmentCushionCartilage
    | quote }}
  ROCKET_VEIL: {{ .Values.cuffLink.rocketVeil | quote }}
  SCORCH_SIMPLIFICATION_PAINTWORK: {{ .Values.cuffLink.scorchSimplificationPaintwork
    | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cuff-link.fullname" . }}-cuff-link
  labels:
  {{- include "cuff-link.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cuff-link
spec:
  replicas: {{ .Values.cuffLink.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cuff-link
      app.kubernetes.io/name: lush
    {{- include "cuff-link.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cuff-link
        app.kubernetes.io/name: lush
      {{- include "cuff-link.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 52055298e1eeb6b6414e21b95cf8eb595c51899387bfcff9bd313e0a8d51e7df
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cuff-link.fullname" . }}-cuff-link
        image: {{ .Values.cuffLink.cuffLink.image.repository }}:{{ .Values.cuffLink.cuffLink.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cuffLink.cuffLink.imagePullPolicy }}
        name: cuff-link
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cuffLink.cuffLink.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cuffLink.cuffLink.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cuff-link.fullname" . }}-cuff-link
  labels:
  {{- include "cuff-link.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cuffLink.type }}
  selector:
    app.kubernetes.io/instance: cuff-link
    app.kubernetes.io/name: lush
  {{- include "cuff-link.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cuffLink.ports | toYaml | nindent 2 -}}
cuffLink:
  consignmentCushionCartilage: glider
  cuffLink:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  rocketVeil: forego
  scorchSimplificationPaintwork: drab
  type: ClusterIP
kubernetesClusterDomain: cluster.local
