# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "strand.fullname" . }}-strand
  labels:
  {{- include "strand.labels" . | nindent 4 }}
data:
  ANGUISH_MILLION_SEVERITY: {{ .Values.strand.anguishMillionSeverity | quote }}
  CHURN_TADPOLE_CAPPUCCINO: {{ .Values.strand.churnTadpoleCappuccino | quote }}
  CONFERENCE: {{ .Values.strand.conference | quote }}
  CROOKED_MACADAMIA_GRAB: {{ .Values.strand.crookedMacadamiaGrab | quote }}
  INFLAMMATION_WEATHER_VIOLET: {{ .Values.strand.inflammationWeatherViolet | quote
    }}
  MALNUTRITION_MARSH_OBEY: {{ .Values.strand.malnutritionMarshObey | quote }}
  PAROLE_WRITING: {{ .Values.strand.paroleWriting | quote }}
  SCREAMER_AD_BROOK: {{ .Values.strand.screamerAdBrook | quote }}
  VECTOR: {{ .Values.strand.vector | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "strand.fullname" . }}-strand
  labels:
  {{- include "strand.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: strand
spec:
  replicas: {{ .Values.strand.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: strand
      app.kubernetes.io/name: neighbour
    {{- include "strand.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: strand
        app.kubernetes.io/name: neighbour
      {{- include "strand.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 78ce1090be2426b5c5b331de75df535694ef73f6563a1fe0ef0882ce539fead0
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "strand.fullname" . }}-strand
        image: {{ .Values.strand.strand.image.repository }}:{{ .Values.strand.strand.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.strand.strand.imagePullPolicy }}
        name: strand
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.strand.strand.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.strand.strand.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "strand.fullname" . }}-strand
  labels:
  {{- include "strand.labels" . | nindent 4 }}
spec:
  type: {{ .Values.strand.type }}
  selector:
    app.kubernetes.io/instance: strand
    app.kubernetes.io/name: neighbour
  {{- include "strand.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.strand.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
strand:
  anguishMillionSeverity: physics
  churnTadpoleCappuccino: determination
  conference: egg
  crookedMacadamiaGrab: odometer
  inflammationWeatherViolet: destination
  malnutritionMarshObey: enchanting
  paroleWriting: permission
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  replicas: 1
  screamerAdBrook: flume
  strand:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  type: ClusterIP
  vector: spark
