<commit_before>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "cas.fullname" . }}
  labels:
    app: {{ template "cas.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  selector:
    matchLabels:
      app: {{ template "cas.name" . }}
      release: {{ .Release.Name }}
  replicas: {{ .Values.replicaCount }}
  {{- if .Values.strategy }}
  strategy:
    {{- toYaml .Values.strategy | nindent 4 }}
  {{- end }}
  template:
    metadata:
      labels:
        app: {{ template "cas.name" . }}
        release: {{ .Release.Name }}
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
        checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
        {{- if and (eq .Capabilities.KubeVersion.Major "1") (lt .Capabilities.KubeVersion.Minor "8") }}
        pod.alpha.kubernetes.io/init-containers: null
        pod.beta.kubernetes.io/init-containers: null
        {{- end }}
    spec:
      affinity:
        {{- if .Values.additionalAffinities }}
        {{- toYaml .Values.additionalAffinities | nindent 8 }}
        {{- end }}
        {{- if eq .Values.antiAffinity "hard" }}
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - topologyKey: kubernetes.io/hostname
              labelSelector:
                matchLabels:
                  app: {{ template "cas.name" . }}
                  release: {{ .Release.Name }}
        {{- else if eq .Values.antiAffinity "soft" }}
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              podAffinityTerm:
                topologyKey: kubernetes.io/hostname
                labelSelector:
                  matchLabels:
                    app: {{ template "cas.name" . }}
                    release: {{ .Release.Name }}
        {{- end }}
      {{- if .Values.tls.enabled }}
      initContainers:
        - name: certificates
          image: "{{ .Values.jetty.image.repository }}:{{ .Values.jetty.image.tag }}"
          imagePullPolicy: {{ .Values.jetty.image.pullPolicy }}
          securityContext:
            runAsUser: 0
          command:
            - /bin/sh
            - -c
            - |-
              set -ex
              export dir=/root/.postgresql
              cp -f /certs/* ${dir}
              chmod 0700 ${dir}
              chmod -R 0600 ${dir}/*
          volumeMounts:
            - mountPath: /root/.postgresql
              name: certs
            {{- range $key := keys .Values.tls.files }}
            - mountPath: /certs/{{ $key }}
              name: secret
              subPath: certs-{{ $key }}
              readOnly: true
            {{- end }}
            {{- range $key := keys .Values.tls.base64Files }}
            - mountPath: /certs/{{ $key }}
              name: secret
              subPath: certs-{{ $key }}
              readOnly: true
            {{- end }}
      {{- end }}
      containers:
        - name: apache
          image: "{{ .Values.apache.image.repository }}:{{ .Values.apache.image.tag }}"
          im: {{ .Values.apache.image.pullPolicy }}
          env:
            {{- include "cas.apache.environment" . | nindent 12 }}
          ports:
            - name: http
              containerPort: {{ .Values.service.internalPort }}
          livenessProbe:
            httpGet:
              httpHeaders:
                - name: Host
                  value: health
              path: /healthz
              port: {{ .Values.service.internalPort }}
            initialDelaySeconds: 300
            timeoutSeconds: {{ default "1" .Values.apache.livenessProbe.timeoutSeconds }}
            periodSeconds: {{ default "10" .Values.apache.livenessProbe.periodSeconds }}
            successThreshold: {{ default "1" .Values.apache.livenessProbe.successThreshold }}
            failureThreshold: {{ default "10" .Values.apache.livenessProbe.failureThreshold }}
          readinessProbe:
            httpGet:
              httpHeaders:
                - name: Host
                  value: {{ .Values.casDomain }}
              path: /Shibboleth.sso/Status
              port: {{ .Values.service.internalPort }}
            initialDelaySeconds: 10
            timeoutSeconds: {{ default "1" .Values.apache.readinessProbe.timeoutSeconds }}
            periodSeconds: {{ default "10" .Values.apache.readinessProbe.periodSeconds }}
            successThreshold: {{ default "1" .Values.apache.readinessProbe.successThreshold }}
            failureThreshold: {{ default "3" .Values.apache.readinessProbe.failureThreshold }}
          resources:
            {{- toYaml .Values.apache.resources | nindent 12 }}
          volumeMounts:
            {{- include "cas.apache.volumeMounts" . | nindent 12 }}
        - name: jetty
          image: "{{ .Values.jetty.image.repository }}:{{ .Values.jetty.image.tag }}"
          imagePullPolicy: {{ .Values.jetty.image.pullPolicy }}
          env:
            {{- include "cas.jetty.environment" . | nindent 12 }}
          ports:
            - name: http
              containerPort: {{ .Values.service.externalPort }}
          livenessProbe:
            httpGet:
              path: /login
              port: {{ .Values.service.externalPort }}
            initialDelaySeconds: 300
            timeoutSeconds: {{ default "1" .Values.jetty.livenessProbe.timeoutSeconds }}
            periodSeconds: {{ default "10" .Values.jetty.livenessProbe.periodSeconds }}
            successThreshold: {{ default "1" .Values.jetty.livenessProbe.successThreshold }}
            failureThreshold: {{ default "10" .Values.jetty.livenessProbe.failureThreshold }}
          readinessProbe:
            httpGet:
              path: /login
              port: {{ .Values.service.externalPort }}
            initialDelaySeconds: 10
            timeoutSeconds: {{ default "1" .Values.jetty.readinessProbe.timeoutSeconds }}<commit_msg>Allow live/readi-ness path config for jetty<commit_after>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "cas.fullname" . }}
  labels:
    app: {{ template "cas.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  selector:
    matchLabels:
      app: {{ template "cas.name" . }}
      release: {{ .Release.Name }}
  replicas: {{ .Values.replicaCount }}
  {{- if .Values.strategy }}
  strategy:
    {{- toYaml .Values.strategy | nindent 4 }}
  {{- end }}
  template:
    metadata:
      labels:
        app: {{ template "cas.name" . }}
        release: {{ .Release.Name }}
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
        checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
        {{- if and (eq .Capabilities.KubeVersion.Major "1") (lt .Capabilities.KubeVersion.Minor "8") }}
        pod.alpha.kubernetes.io/init-containers: null
        pod.beta.kubernetes.io/init-containers: null
        {{- end }}
    spec:
      affinity:
        {{- if .Values.additionalAffinities }}
        {{- toYaml .Values.additionalAffinities | nindent 8 }}
        {{- end }}
        {{- if eq .Values.antiAffinity "hard" }}
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - topologyKey: kubernetes.io/hostname
              labelSelector:
                matchLabels:
                  app: {{ template "cas.name" . }}
                  release: {{ .Release.Name }}
        {{- else if eq .Values.antiAffinity "soft" }}
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              podAffinityTerm:
                topologyKey: kubernetes.io/hostname
                labelSelector:
                  matchLabels:
                    app: {{ template "cas.name" . }}
                    release: {{ .Release.Name }}
        {{- end }}
      {{- if .Values.tls.enabled }}
      initContainers:
        - name: certificates
          image: "{{ .Values.jetty.image.repository }}:{{ .Values.jetty.image.tag }}"
          imagePullPolicy: {{ .Values.jetty.image.pullPolicy }}
          securityContext:
            runAsUser: 0
          command:
            - /bin/sh
            - -c
            - |-
              set -ex
              export dir=/root/.postgresql
              cp -f /certs/* ${dir}
              chmod 0700 ${dir}
              chmod -R 0600 ${dir}/*
          volumeMounts:
            - mountPath: /root/.postgresql
              name: certs
            {{- range $key := keys .Values.tls.files }}
            - mountPath: /certs/{{ $key }}
              name: secret
              subPath: certs-{{ $key }}
              readOnly: true
            {{- end }}
            {{- range $key := keys .Values.tls.base64Files }}
            - mountPath: /certs/{{ $key }}
              name: secret
              subPath: certs-{{ $key }}
              readOnly: true
            {{- end }}
      {{- end }}
      containers:
        - name: apache
          image: "{{ .Values.apache.image.repository }}:{{ .Values.apache.image.tag }}"
          im: {{ .Values.apache.image.pullPolicy }}
          env:
            {{- include "cas.apache.environment" . | nindent 12 }}
          ports:
            - name: http
              containerPort: {{ .Values.service.internalPort }}
          livenessProbe:
            httpGet:
              httpHeaders:
                - name: Host
                  value: health
              path: /healthz
              port: {{ .Values.service.internalPort }}
            initialDelaySeconds: 300
            timeoutSeconds: {{ default "1" .Values.apache.livenessProbe.timeoutSeconds }}
            periodSeconds: {{ default "10" .Values.apache.livenessProbe.periodSeconds }}
            successThreshold: {{ default "1" .Values.apache.livenessProbe.successThreshold }}
            failureThreshold: {{ default "10" .Values.apache.livenessProbe.failureThreshold }}
          readinessProbe:
            httpGet:
              httpHeaders:
                - name: Host
                  value: {{ .Values.casDomain }}
              path: /Shibboleth.sso/Status
              port: {{ .Values.service.internalPort }}
            initialDelaySeconds: 10
            timeoutSeconds: {{ default "1" .Values.apache.readinessProbe.timeoutSeconds }}
            periodSeconds: {{ default "10" .Values.apache.readinessProbe.periodSeconds }}
            successThreshold: {{ default "1" .Values.apache.readinessProbe.successThreshold }}
            failureThreshold: {{ default "3" .Values.apache.readinessProbe.failureThreshold }}
          resources:
            {{- toYaml .Values.apache.resources | nindent 12 }}
          volumeMounts:
            {{- include "cas.apache.volumeMounts" . | nindent 12 }}
        - name: jetty
          image: "{{ .Values.jetty.image.repository }}:{{ .Values.jetty.image.tag }}"
          imagePullPolicy: {{ .Values.jetty.image.pullPolicy }}
          env:
            {{- include "cas.jetty.environment" . | nindent 12 }}
          ports:
            - name: http
              containerPort: {{ .Values.service.externalPort }}
          livenessProbe:
            httpGet:
              path: {{ default "/login" .Values.jetty.livenessProbe.path}}
              port: {{ .Values.service.externalPort }}
            initialDelaySeconds: 300
            timeoutSeconds: {{ default "1" .Values.jetty.livenessProbe.timeoutSeconds }}
            periodSeconds: {{ default "10" .Values.jetty.livenessProbe.periodSeconds }}
            successThreshold: {{ default "1" .Values.jetty.livenessProbe.successThreshold }}
            failureThreshold: {{ default "10" .Values.jetty.livenessProbe.failureThreshold }}
          readinessProbe:
            httpGet:
              path: {{ default "/login" .Values.jetty.readinessProbe.path }}
              port: {{ .Values.service.externalPort }}
            initialDelaySeconds: 10
            timeoutSeconds: {{ default "1" .Values.jetty.readinessProbe.timeoutSeconds }}
{'fraction_non_alphanumeric': 0.1296145714750366, 'fraction_numerical': 0.009595056106684013, 'mean_word_length': 1.6812731632875517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4020086', 'n_tokens_mistral': 3444, 'n_tokens_neox': 3311, 'n_words': 653}