# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "testimonial.fullname" . }}-testimonial
  labels:
  {{- include "testimonial.labels" . | nindent 4 }}
data:
  ADOBE_MANUFACTURER: {{ .Values.testimonial.adobeManufacturer | quote }}
  JEWELLER_METRIC: {{ .Values.testimonial.jewellerMetric | quote }}
  MAYONNAISE_OPERATE: {{ .Values.testimonial.mayonnaiseOperate | quote }}
  MOODY_SNIFF_CROSS-CONTAMINATION: {{ .Values.testimonial.moodySniffCrossContamination
    | quote }}
  PRIVACY: {{ .Values.testimonial.privacy | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "testimonial.fullname" . }}-testimonial
  labels:
  {{- include "testimonial.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: testimonial
spec:
  replicas: {{ .Values.testimonial.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: testimonial
      app.kubernetes.io/name: beach
    {{- include "testimonial.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: testimonial
        app.kubernetes.io/name: beach
      {{- include "testimonial.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: fc35d82e0d2ae734f8d9368cd2a64b23db418c70c7e61da937d98e74b89fdf73
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "testimonial.fullname" . }}-testimonial
        image: {{ .Values.testimonial.testimonial.image.repository }}:{{ .Values.testimonial.testimonial.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.testimonial.testimonial.imagePullPolicy }}
        name: testimonial
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.testimonial.testimonial.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.testimonial.testimonial.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "testimonial.fullname" . }}-testimonial
  labels:
  {{- include "testimonial.labels" . | nindent 4 }}
spec:
  type: {{ .Values.testimonial.type }}
  selector:
    app.kubernetes.io/instance: testimonial
    app.kubernetes.io/name: beach
  {{- include "testimonial.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.testimonial.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
testimonial:
  adobeManufacturer: judicious
  jewellerMetric: poke
  mayonnaiseOperate: barium
  moodySniffCrossContamination: reliability
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  privacy: colossal
  replicas: 1
  testimonial:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
