# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "fry.fullname" . }}-fry
  labels:
  {{- include "fry.labels" . | nindent 4 }}
  annotations:
    kubectl.kubernetes.io/default-container: fry
spec:
  replicas: {{ .Values.fry.replicas }}
  selector:
    matchLabels:
      app.kubernetes.io/instance: fry
      app.kubernetes.io/name: graph
    {{- include "fry.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: fry
        app.kubernetes.io/name: graph
      {{- include "fry.selectorLabels" . | nindent 8 }}
      annotations:
        checksum/config: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
    spec:
      containers:
      - env:
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        image: {{ .Values.fry.fry.image.repository }}:{{ .Values.fry.fry.image.tag | default
          .Chart.AppVersion }}
        imagePullPolicy: {{ .Values.fry.fry.imagePullPolicy }}
        name: fry
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        resources: {{- toYaml .Values.fry.fry.resources | nindent 10 }}
        securityContext: {{- toYaml .Values.fry.fry.containerSecurityContext | nindent
          10 }}
      securityContext:
        fsGroup: 999 # service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "fry.fullname" . }}-fry
  labels:
  {{- include "fry.labels" . | nindent 4 }}
spec:
  type: {{ .Values.fry.type }}
  selector:
    app.kubernetes.io/instance: fry
    app.kubernetes.io/name: graph
  {{- include "fry.selectorLabels" . | nindent 4 }}
  ports:
	{{- .Values.fry.ports | toYaml | nindent 2 -}}
fry:
  fry:
    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
  replicas: 1
  type: ClusterIP
kubernetesClusterDomain: cluster.local
