apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "htwkalender.name" . }}-ical
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "htwkalender.labels" . | nindent 4 }}
    component: ical
  {{- with .Values.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  replicas: {{ .Values.ical.replicas }}
  selector:
    matchLabels:
      {{- include "htwkalender.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      {{- with .Values.annotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      labels:
        {{- include "htwkalender.labels" . | nindent 8 }}
        component: ical
    spec:
      containers:
        - name: {{ .Chart.Name }}-ical
          image: "{{ .Values.ical.image.name }}"
          imagePullPolicy: {{ .Values.ical.image.pullPolicy }}
          ports:
            - name: ical
              containerPort: {{ .Values.ical.service.targetPort }}
              protocol: TCP
            - name: ical-protobuf
              containerPort: {{ .Values.ical.service.protobufTargetPort }}
              protocol: TCP
          env:
            - name: DATA_MANAGER_URL
              value: {{ .Values.dataManager.service.name }}