# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "laughter.fullname" . }}-laughter
  labels:
  {{- include "laughter.labels" . | nindent 4 }}
data:
  BUZE_ECONOMICS: {{ .Values.laughter.buzeEconomics | quote }}
  COLOR: {{ .Values.laughter.color | quote }}
  DETECTIVE_LEADERSHIP: {{ .Values.laughter.detectiveLeadership | quote }}
  MINDLESS_GASOLINE: {{ .Values.laughter.mindlessGasoline | quote }}
  NOTION_TRAPEZOID_PLACID: {{ .Values.laughter.notionTrapezoidPlacid | quote }}
  PRINCE_FUNDRAISING: {{ .Values.laughter.princeFundraising | quote }}
  SCOTCH_PLATINUM_DRESSER: {{ .Values.laughter.scotchPlatinumDresser | quote }}
  TAWDRY_LEG_MOONLIGHT: {{ .Values.laughter.tawdryLegMoonlight | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "laughter.fullname" . }}-laughter
  labels:
  {{- include "laughter.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: laughter
spec:
  replicas: {{ .Values.laughter.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: laughter
      app.kubernetes.io/name: degree
    {{- include "laughter.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: laughter
        app.kubernetes.io/name: degree
      {{- include "laughter.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 12cbbbac7939e9e4db672a53203933237e4835bf702fc4828519e72a854e6a5b
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "laughter.fullname" . }}-laughter
        image: {{ .Values.laughter.laughter.image.repository }}:{{ .Values.laughter.laughter.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.laughter.laughter.imagePullPolicy }}
        name: laughter
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.laughter.laughter.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.laughter.laughter.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "laughter.fullname" . }}-laughter
  labels:
  {{- include "laughter.labels" . | nindent 4 }}
spec:
  type: {{ .Values.laughter.type }}
  selector:
    app.kubernetes.io/instance: laughter
    app.kubernetes.io/name: degree
  {{- include "laughter.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.laughter.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
laughter:
  buzeEconomics: succeed
  color: sweltering
  detectiveLeadership: lush
  laughter:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  mindlessGasoline: mink
  notionTrapezoidPlacid: embellishment
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  princeFundraising: webinar
  replicas: 1
  scotchPlatinumDresser: jockey
  tawdryLegMoonlight: lyre
  type: ClusterIP
