# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cuddly.fullname" . }}-cuddly
  labels:
  {{- include "cuddly.labels" . | nindent 4 }}
data:
  BUTTER_INDEPENDENCE_OVERJOYED: {{ .Values.cuddly.butterIndependenceOverjoyed |
    quote }}
  COMMODITY: {{ .Values.cuddly.commodity | quote }}
  FRETFUL: {{ .Values.cuddly.fretful | quote }}
  PENDANT: {{ .Values.cuddly.pendant | quote }}
  PROTECTIVE_POUNDING_TAILBUD: {{ .Values.cuddly.protectivePoundingTailbud | quote
    }}
  SHAKEDOWN_MONK: {{ .Values.cuddly.shakedownMonk | quote }}
  SKULL_SPIKE_PLIGHT: {{ .Values.cuddly.skullSpikePlight | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cuddly.fullname" . }}-cuddly
  labels:
  {{- include "cuddly.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cuddly
spec:
  replicas: {{ .Values.cuddly.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cuddly
      app.kubernetes.io/name: instinctive
    {{- include "cuddly.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cuddly
        app.kubernetes.io/name: instinctive
      {{- include "cuddly.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: c0170394c05a28fa6f11da29697c40c54bf6a8e752aa669e990f2f7397a2acf3
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cuddly.fullname" . }}-cuddly
        image: {{ .Values.cuddly.cuddly.image.repository }}:{{ .Values.cuddly.cuddly.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cuddly.cuddly.imagePullPolicy }}
        name: cuddly
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cuddly.cuddly.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cuddly.cuddly.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cuddly.fullname" . }}-cuddly
  labels:
  {{- include "cuddly.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cuddly.type }}
  selector:
    app.kubernetes.io/instance: cuddly
    app.kubernetes.io/name: instinctive
  {{- include "cuddly.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cuddly.ports | toYaml | nindent 2 -}}
cuddly:
  butterIndependenceOverjoyed: gavel
  commodity: gabby
  cuddly:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fretful: illustrious
  pendant: tab
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  protectivePoundingTailbud: metric
  replicas: 1
  shakedownMonk: yacht
  skullSpikePlight: oboe
  type: ClusterIP
kubernetesClusterDomain: cluster.local
