# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "rancher.fullname" . }}-rancher
  labels:
  {{- include "rancher.labels" . | nindent 4 }}
data:
  CYCLOOXYGENASE_DADDY: {{ .Values.rancher.cyclooxygenaseDaddy | quote }}
  POKE_PANIC: {{ .Values.rancher.pokePanic | quote }}
  SERVER_INJUNCTION_GRANDMA: {{ .Values.rancher.serverInjunctionGrandma | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "rancher.fullname" . }}-rancher
  labels:
  {{- include "rancher.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: rancher
spec:
  replicas: {{ .Values.rancher.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: rancher
      app.kubernetes.io/name: die
    {{- include "rancher.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: rancher
        app.kubernetes.io/name: die
      {{- include "rancher.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: ae4f8a26226383b841acd925868e01b56a41cb78b567aa25b2f8b9e5873c7b8c
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "rancher.fullname" . }}-rancher
        image: {{ .Values.rancher.rancher.image.repository }}:{{ .Values.rancher.rancher.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.rancher.rancher.imagePullPolicy }}
        name: rancher
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.rancher.rancher.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.rancher.rancher.containerSecurityContext |
          nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "rancher.fullname" . }}-rancher
  labels:
  {{- include "rancher.labels" . | nindent 4 }}
spec:
  type: {{ .Values.rancher.type }}
  selector:
    app.kubernetes.io/instance: rancher
    app.kubernetes.io/name: die
  {{- include "rancher.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.rancher.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
rancher:
  cyclooxygenaseDaddy: fawn
  pokePanic: arrogant
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rancher:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  replicas: 1
  serverInjunctionGrandma: kohlrabi
  type: ClusterIP
