<commit_before>#
# Copyright (c) 2012-2017 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    io.kompose.service: keycloak
  name: keycloak
spec:
  replicas: 1
  template:
    metadata:
      labels:
        io.kompose.service: keycloak
    spec:
      initContainers:
      - name: wait-for-postgres
        image: alpine:3.5
        command: ["sh", "-c", "apk --no-cache add curl jq ; adresses_length=0; until [ $adresses_length -gt 0 ]; do echo waiting for postgres to be ready...; sleep 2; endpoints=`curl -s --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\"     https://kubernetes.default/api/v1/namespaces/$POD_NAMESPACE/endpoints/postgres`; adresses_length=`echo $endpoints | jq -r \".subsets[]?.addresses // [] | length\"`; done;"]
        env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
      containers:
      - env:
        - name: POSTGRES_PORT_5432_TCP_ADDR
          value: postgres
        - name: POSTGRES_PORT_5432_TCP_PORT
          value: "5432"
        - name: POSTGRES_DATABASE
          value: keycloak
        - name: POSTGRES_USER
          value: keycloak
        - name: POSTGRES_PASSWORD
          value: keycloak
        - name: KEYCLOAK_USER
          value: admin
        - name: KEYCLOAK_PASSWORD
          value: <PASSWORD>
        - name: CHE_HOST
          value: {{ template "cheHost" . }}
        - name: ROUTING_SUFFIX
          value: {{ .Values.global.ingressDomain }}
        - name: NAMESPACE
          value: {{ .Release.Namespace }}
        - name: PROTOCOL
{{- if .Values.global.tls.enabled }}
          value: "https"
{{- else }}
          value: "http"
{{- end }}

        image: {{ .Values.image }}
        command: ["/scripts/kc_realm_user.sh"]
        imagePullPolicy: Always
        name: keycloak
        livenessProbe:
          failureThreshold: 11
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          tcpSocket:
            port: 8080
          timeoutSeconds: 30
        readinessProbe:
          failureThreshold: 10
          httpGet:<commit_msg>set PROXY_ADDRESS_FORWARDING in keycloak deployment when tls is enabled<commit_after>#
# Copyright (c) 2012-2017 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    io.kompose.service: keycloak
  name: keycloak
spec:
  replicas: 1
  template:
    metadata:
      labels:
        io.kompose.service: keycloak
    spec:
      initContainers:
      - name: wait-for-postgres
        image: alpine:3.5
        command: ["sh", "-c", "apk --no-cache add curl jq ; adresses_length=0; until [ $adresses_length -gt 0 ]; do echo waiting for postgres to be ready...; sleep 2; endpoints=`curl -s --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\"     https://kubernetes.default/api/v1/namespaces/$POD_NAMESPACE/endpoints/postgres`; adresses_length=`echo $endpoints | jq -r \".subsets[]?.addresses // [] | length\"`; done;"]
        env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
      containers:
      - env:
        - name: POSTGRES_PORT_5432_TCP_ADDR
          value: postgres
        - name: POSTGRES_PORT_5432_TCP_PORT
          value: "5432"
        - name: POSTGRES_DATABASE
          value: keycloak
        - name: POSTGRES_USER
          value: keycloak
        - name: POSTGRES_PASSWORD
          value: <PASSWORD>
        - name: KEYCLOAK_USER
          value: admin
        - name: KEYCLOAK_PASSWORD
          value: <PASSWORD>
        - name: CHE_HOST
          value: {{ template "cheHost" . }}
        - name: ROUTING_SUFFIX
          value: {{ .Values.global.ingressDomain }}
        - name: NAMESPACE
          value: {{ .Release.Namespace }}
        - name: PROTOCOL
{{- if .Values.global.tls.enabled }}
          value: "https"
        - name: PROXY_ADDRESS_FORWARDING
          value: "true"
{{- else }}
          value: "http"
{{- end }}

        image: {{ .Values.image }}
        command: ["/scripts/kc_realm_user.sh"]
        imagePullPolicy: Always
        name: keycloak
        livenessProbe:
          failureThreshold: 11
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          tcpSocket:
            port: 8080
          timeoutSeconds: 30
        readinessProbe:
          failureThreshold: 10
          httpGet:
{'fraction_non_alphanumeric': 0.10688370268680134, 'fraction_numerical': 0.018827221023730144, 'mean_word_length': 2.0704394942805537, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '5013827', 'n_tokens_mistral': 1678, 'n_tokens_neox': 1573, 'n_words': 375}