# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "guava.fullname" . }}-guava
  labels:
  {{- include "guava.labels" . | nindent 4 }}
data:
  BALLOT: {{ .Values.guava.ballot | quote }}
  CHARITY: {{ .Values.guava.charity | quote }}
  ISOLATION_HAMMER: {{ .Values.guava.isolationHammer | quote }}
  MARSHLAND: {{ .Values.guava.marshland | quote }}
  SATIRE_REVOLUTION_ANGER: {{ .Values.guava.satireRevolutionAnger | quote }}
  SIDEWALK: {{ .Values.guava.sidewalk | quote }}
  VERIFICATION_WHIRL_CANAL: {{ .Values.guava.verificationWhirlCanal | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "guava.fullname" . }}-guava
  labels:
  {{- include "guava.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: guava
spec:
  replicas: {{ .Values.guava.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: guava
      app.kubernetes.io/name: conversation
    {{- include "guava.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: guava
        app.kubernetes.io/name: conversation
      {{- include "guava.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e166d7262030fcbc88147b42086352436bcaa140c1c21ec0f9a5868e9173e88e
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "guava.fullname" . }}-guava
        image: {{ .Values.guava.guava.image.repository }}:{{ .Values.guava.guava.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.guava.guava.imagePullPolicy }}
        name: guava
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.guava.guava.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.guava.guava.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "guava.fullname" . }}-guava
  labels:
  {{- include "guava.labels" . | nindent 4 }}
spec:
  type: {{ .Values.guava.type }}
  selector:
    app.kubernetes.io/instance: guava
    app.kubernetes.io/name: conversation
  {{- include "guava.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.guava.ports | toYaml | nindent 2 -}}
guava:
  ballot: sage
  charity: whispering
  guava:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  isolationHammer: pollution
  marshland: space
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  satireRevolutionAnger: juggernaut
  sidewalk: dot
  type: ClusterIP
  verificationWhirlCanal: chalk
kubernetesClusterDomain: cluster.local
