# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "leverage.fullname" . }}-leverage
  labels:
  {{- include "leverage.labels" . | nindent 4 }}
data:
  CRIB_TENNIS: {{ .Values.leverage.cribTennis | quote }}
  EGGNOG: {{ .Values.leverage.eggnog | quote }}
  HARSH: {{ .Values.leverage.harsh | quote }}
  HYACINTH: {{ .Values.leverage.hyacinth | quote }}
  IMPORTANCE_ABUSIVE: {{ .Values.leverage.importanceAbusive | quote }}
  REDISCOVERY_PROFIT_MEANING: {{ .Values.leverage.rediscoveryProfitMeaning | quote
    }}
  SOFT: {{ .Values.leverage.soft | quote }} # deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "leverage.fullname" . }}-leverage
  labels:
  {{- include "leverage.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: leverage
spec:
  replicas: {{ .Values.leverage.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: leverage
      app.kubernetes.io/name: veal
    {{- include "leverage.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: leverage
        app.kubernetes.io/name: veal
      {{- include "leverage.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: 0f9e805df1fcc680ab12350e90e44f7fd7c8b493a253ba5c35a0873a61b1c4af
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        envFrom:
        - configMapRef:
            name: {{ include "leverage.fullname" . }}-leverage
        image: {{ .Values.leverage.leverage.image.repository }}:{{ .Values.leverage.leverage.image.tag
          | default .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.leverage.leverage.imagePullPolicy }}
        name: leverage
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.leverage.leverage.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.leverage.leverage.containerSecurityContext
          | nindent 10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "leverage.fullname" . }}-leverage
  labels:
  {{- include "leverage.labels" . | nindent 4 }}
spec:
  type: {{ .Values.leverage.type }}
  selector:
    app.kubernetes.io/instance: leverage
    app.kubernetes.io/name: veal
  {{- include "leverage.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.leverage.ports | toYaml | nindent 2 -}}
kubernetesClusterDomain: cluster.local
leverage:
  cribTennis: agreeable
  eggnog: belly
  harsh: injustice
  hyacinth: accelerate
  importanceAbusive: downgrade
  leverage:
    containerSecurityContext: {}
    image:
      repository: nginx
      tag: latest
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 200m
        memory: 200Mi
      requests:
        cpu: 200m
        memory: 200Mi
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  rediscoveryProfitMeaning: speaking
  replicas: 1
  soft: radar
  type: ClusterIP
