# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "sentiment.fullname" . }}-sentiment
  labels:
  {{- include "sentiment.labels" . | nindent 4 }}
data:
  AFFECT_SEPTICAEMIA: {{ .Values.sentiment.affectSepticaemia | quote }}
  AMAZON_ZIP_REFORM: {{ .Values.sentiment.amazonZipReform | quote }}
  COHERENT: {{ .Values.sentiment.coherent | quote }}
  CORNER_SWITCHBOARD_LICENSING: {{ .Values.sentiment.cornerSwitchboardLicensing |
    quote }}
  GUMSHOE_IMPROVISE: {{ .Values.sentiment.gumshoeImprovise | quote }}
  LOGIC: {{ .Values.sentiment.logic | quote }}
  SEPARATION: {{ .Values.sentiment.separation | quote }}
  STOLE: {{ .Values.sentiment.stole | quote }}
  SUBSTANCE_CONSTANT_MATURE: {{ .Values.sentiment.substanceConstantMature | quote
    }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "sentiment.fullname" . }}-sentiment
  labels:
  {{- include "sentiment.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: sentiment
spec:
  replicas: {{ .Values.sentiment.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: sentiment
      app.kubernetes.io/name: dynamo
    {{- include "sentiment.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: sentiment
        app.kubernetes.io/name: dynamo
      {{- include "sentiment.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 05e58cebadeefdf3d088a3c97809114cec6b2aca4a53f1f7da62e4f5a017200a
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "sentiment.fullname" . }}-sentiment
        image: {{ .Values.sentiment.sentiment.image.repository }}:{{ .Values.sentiment.sentiment.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.sentiment.sentiment.imagePullPolicy }}
        name: sentiment
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.sentiment.sentiment.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.sentiment.sentiment.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "sentiment.fullname" . }}-sentiment
  labels:
  {{- include "sentiment.labels" . | nindent 4 }}
spec:
  type: {{ .Values.sentiment.type }}
  selector:
    app.kubernetes.io/instance: sentiment
    app.kubernetes.io/name: dynamo
  {{- include "sentiment.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.sentiment.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
sentiment:
  affectSepticaemia: dreamer
  amazonZipReform: puritan
  coherent: zany
  cornerSwitchboardLicensing: invite
  gumshoeImprovise: trachoma
  logic: sweet
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  sentiment:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  separation: middleman
  stole: niche
  substanceConstantMature: wed
  type: ClusterIP
