# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "lettuce.fullname" . }}-lettuce
  labels:
  {{- include "lettuce.labels" . | nindent 4 }}
data:
  COYOTE_QUINCE: {{ .Values.lettuce.coyoteQuince | quote }}
  SONNET_STREAM_FAV: {{ .Values.lettuce.sonnetStreamFav | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "lettuce.fullname" . }}-lettuce
  labels:
  {{- include "lettuce.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: lettuce
spec:
  replicas: {{ .Values.lettuce.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: lettuce
      app.kubernetes.io/name: hesitant
    {{- include "lettuce.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: lettuce
        app.kubernetes.io/name: hesitant
      {{- include "lettuce.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 7a673e2f680dba876e37fe0014888b36a2474a5a74ea4d9958082c7e0de9cd13
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "lettuce.fullname" . }}-lettuce
        image: {{ .Values.lettuce.lettuce.image.repository }}:{{ .Values.lettuce.lettuce.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.lettuce.lettuce.imagePullPolicy }}
        name: lettuce
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.lettuce.lettuce.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.lettuce.lettuce.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "lettuce.fullname" . }}-lettuce
  labels:
  {{- include "lettuce.labels" . | nindent 4 }}
spec:
  type: {{ .Values.lettuce.type }}
  selector:
    app.kubernetes.io/instance: lettuce
    app.kubernetes.io/name: hesitant
  {{- include "lettuce.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.lettuce.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
lettuce:
  coyoteQuince: shorts
  lettuce:
    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
  sonnetStreamFav: gliding
  type: ClusterIP
