# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "cyclone.fullname" . }}-cyclone
  labels:
  {{- include "cyclone.labels" . | nindent 4 }}
data:
  BEANSTALK_HORROR: {{ .Values.cyclone.beanstalkHorror | quote }}
  CAR_CONTACT: {{ .Values.cyclone.carContact | quote }}
  FEARLESS_MONKEY: {{ .Values.cyclone.fearlessMonkey | quote }}
  HORDE: {{ .Values.cyclone.horde | quote }}
  OCELOT: {{ .Values.cyclone.ocelot | quote }}
  PLAYROOM_REVITALIZATION: {{ .Values.cyclone.playroomRevitalization | quote }}
  PRESERVES: {{ .Values.cyclone.preserves | quote }}
  SEXUALITY: {{ .Values.cyclone.sexuality | quote }}
  TREE: {{ .Values.cyclone.tree | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "cyclone.fullname" . }}-cyclone
  labels:
  {{- include "cyclone.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: cyclone
spec:
  replicas: {{ .Values.cyclone.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: cyclone
      app.kubernetes.io/name: mattock
    {{- include "cyclone.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: cyclone
        app.kubernetes.io/name: mattock
      {{- include "cyclone.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 2fa798b7ca08d79619bc47e64dc2a88bad6866df1367376551e31cc8befe1939
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "cyclone.fullname" . }}-cyclone
        image: {{ .Values.cyclone.cyclone.image.repository }}:{{ .Values.cyclone.cyclone.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.cyclone.cyclone.imagePullPolicy }}
        name: cyclone
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.cyclone.cyclone.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.cyclone.cyclone.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cyclone.fullname" . }}-cyclone
  labels:
  {{- include "cyclone.labels" . | nindent 4 }}
spec:
  type: {{ .Values.cyclone.type }}
  selector:
    app.kubernetes.io/instance: cyclone
    app.kubernetes.io/name: mattock
  {{- include "cyclone.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.cyclone.ports | toYaml | nindent 2 -}}
cyclone:
  beanstalkHorror: deliberation
  carContact: crisp
  cyclone:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  fearlessMonkey: eternity
  horde: furtive
  ocelot: bad
  playroomRevitalization: voting
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  preserves: enlist
  replicas: 1
  sexuality: coffee
  tree: surfboard
  type: ClusterIP
kubernetesClusterDomain: cluster.local
