# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "volatility.fullname" . }}-volatility
  labels:
  {{- include "volatility.labels" . | nindent 4 }}
data:
  DRAWING_TERMITE: {{ .Values.volatility.drawingTermite | quote }}
  DUFFEL_PRACTITIONER: {{ .Values.volatility.duffelPractitioner | quote }}
  NESTLING: {{ .Values.volatility.nestling | quote }}
  PHOTOGRAPH_BRILLIANT: {{ .Values.volatility.photographBrilliant | quote }}
  PROCESS: {{ .Values.volatility.process | quote }}
  REPLICA_OPTIMISATION_AVAILABILITY: {{ .Values.volatility.replicaOptimisationAvailability
    | quote }}
  SERVE_LATITUDE: {{ .Values.volatility.serveLatitude | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "volatility.fullname" . }}-volatility
  labels:
  {{- include "volatility.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: volatility
spec:
  replicas: {{ .Values.volatility.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: volatility
      app.kubernetes.io/name: type
    {{- include "volatility.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: volatility
        app.kubernetes.io/name: type
      {{- include "volatility.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: a36d1f9d395a615cd885e46e709a6471a67854c24604af0116ae4eccbdb5598c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "volatility.fullname" . }}-volatility
        image: {{ .Values.volatility.volatility.image.repository }}:{{ .Values.volatility.volatility.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.volatility.volatility.imagePullPolicy }}
        name: volatility
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.volatility.volatility.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.volatility.volatility.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "volatility.fullname" . }}-volatility
  labels:
  {{- include "volatility.labels" . | nindent 4 }}
spec:
  type: {{ .Values.volatility.type }}
  selector:
    app.kubernetes.io/instance: volatility
    app.kubernetes.io/name: type
  {{- include "volatility.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.volatility.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
volatility:
  drawingTermite: ambulance
  duffelPractitioner: teach
  nestling: pickle
  photographBrilliant: vehicle
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  process: relation
  replicaOptimisationAvailability: hydrolyse
  replicas: 1
  serveLatitude: dome
  type: ClusterIP
  volatility:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
