---
apiVersion: v1
kind: Template
metadata:
  labels:
    app: fabric8-tenant-che
    provider: fabric8
    version: 2.0.75
    group: io.fabric8.tenant.packages
  name: fabric8-tenant-che
objects:
- apiVersion: v1
  kind: RoleBindingRestriction
  metadata:
    labels:
      app: fabric8-tenant-che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.packages
    name: dsaas-user-access
  spec:
    userrestriction:
      users:
      - ${PROJECT_USER}
- apiVersion: v1
  kind: Secret
  metadata:
    labels:
      app: fabric8-tenant-che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.packages
    name: che-recommender-api-token
  data:
    token: ${RECOMMENDER_API_TOKEN}
  type: fabric8.io/che-recommender-api-token
- apiVersion: v1
  kind: ServiceAccount
  metadata:
    annotations:
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: che
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      fabric8.io/app-menu: development
      fabric8.io/git-commit: 87c218f8c36cde36356e80c6575bd6f1df85d335
      fabric8.io/scm-con-url: scm:git:git@github.com:fabric8io/tenant-che.git/tenant-che-apps/che
      fabric8.io/scm-url: http://github.com/fabric8io/tenant-che/tenant-che-apps/che
      fabric8.io/iconUrl: https://cdn.rawgit.com/fabric8io/tenant-che/tenant-che-apps/che/master/apps/che/src/main/fabric8/icon.png
      fabric8.io/git-branch: release-v2.0.75
      fabric8.io/scm-devcon-url: scm:git:git@github.com:fabric8io/tenant-che.git/tenant-che-apps/che
      fabric8.io/scm-tag: fabric8io/tenant-che-1.0.0
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      expose: "false"
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: che-host
  spec:
    ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
    selector:
      app: che
      provider: fabric8
      group: io.fabric8.tenant.apps
- apiVersion: v1
  kind: RoleBinding
  metadata:
    labels:
      app: fabric8-tenant-che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.packages
    name: che
  roleRef:
    name: admin
  subjects:
  - kind: ServiceAccount
    name: che
- apiVersion: v1
  kind: RoleBinding
  metadata:
    labels:
      app: fabric8-tenant-che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.packages
    name: user-edit
  roleRef:
    name: edit
  subjects:
  - kind: User
    name: ${PROJECT_USER}
  userNames:
  - ${PROJECT_USER}
- apiVersion: v1
  kind: RoleBinding
  metadata:
    labels:
      app: fabric8-tenant-che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.packages
    name: user-view
  roleRef:
    name: view
  subjects:
  - kind: User
    name: ${PROJECT_USER}
  userNames:
  - ${PROJECT_USER}
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: che-data-volume
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: claim-che-workspace
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi
- apiVersion: v1
  kind: ConfigMap
  metadata:
    annotations:
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: che
  data:
    hostname-http: ${PROJECT_NAME}-che.${DOMAIN}
    workspace-storage: /home/user/che/workspaces
    workspace-storage-create-folders: "false"
    local-conf-dir: /etc/conf
    openshift-serviceaccountname: che
    che-server-evaluation-strategy: always-external-custom
    che.logs.dir: /data/logs
    che.docker.server_evaluation_strategy.custom.template: <serverName>-<if(isDevMachine)><workspaceIdWithoutPrefix><else><machineName><endif>-<externalAddress>
    che.docker.server_evaluation_strategy.custom.external.protocol: https
    che.predefined.stacks.reload_on_start: "true"
    log-level: INFO
    docker-connector: openshift
    port: "8080"
    remote-debugging-enabled: "false"
    che-oauth-github-forceactivation: "true"
    workspaces-memory-limit: 1900Mi
    workspaces-memory-request: 1100Mi
    enable-workspaces-autostart: "false"
    keycloak-oso-endpoint: ${KEYCLOAK_OSO_ENDPOINT}
    keycloak-github-endpoint: ${KEYCLOAK_GITHUB_ENDPOINT}
    keycloak-disabled: "false"
    che-server-java-opts: -XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
      -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+UnlockExperimentalVMOptions
      -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true -Xms20m
    che-workspaces-java-opts: -XX:+UseG1GC -XX:+UseStringDeduplication -XX:MinHeapFreeRatio=20
      -XX:MaxHeapFreeRatio=40 -XX:MaxRAM=1200m -Xms256m
    che-openshift-secure-routes: "true"
    che-secure-external-urls: "true"
    che-server-timeout-ms: "3600000"
    che-openshift-precreate-subpaths: "false"
    che-workspace-auto-snapshot: "false"
    che-keycloak-auth-server-url: ${CHE_KEYCLOAK_AUTH__SERVER__URL}
    che-keycloak-realm: ${CHE_KEYCLOAK_REALM}
    che-keycloak-client-id: ${CHE_KEYCLOAK_CLIENT__ID}
    che-wsagent-ping-success-threshold: "25"
- apiVersion: v1
  kind: ConfigMap
  metadata:
    labels:
      fabric8.io/kind: package
      provider: fabric8.io
      version: 2.0.75
      app: fabric8-tenant-che
      group: io.fabric8.tenant.packages
    name: fabric8-online-che
  data:
    metadata-url: http://central.maven.org/maven2/io/fabric8/tenant/packages/fabric8-tenant-che/maven-metadata.xml
    package-url-prefix: http://central.maven.org/maven2/io/fabric8/tenant/packages/fabric8-tenant-che/%[1]s/fabric8-tenant-che-%[1]s-
- apiVersion: apps.openshift.io/v1
  kind: DeploymentConfig
  metadata:
    annotations:
      fabric8.io/git-commit: 87c218f8c36cde36356e80c6575bd6f1df85d335
      fabric8.io/metrics-path: dashboard/file/kubernetes-pods.json/?var-project=che&var-version=2.0.75
      fabric8.io/scm-con-url: scm:git:git@github.com:fabric8io/tenant-che.git/tenant-che-apps/che
      fabric8.io/scm-url: http://github.com/fabric8io/tenant-che/tenant-che-apps/che
      fabric8.io/iconUrl: https://cdn.rawgit.com/fabric8io/tenant-che/tenant-che-apps/che/master/apps/che/src/main/fabric8/icon.png
      fabric8.io/git-branch: release-v2.0.75
      fabric8.io/scm-devcon-url: scm:git:git@github.com:fabric8io/tenant-che.git/tenant-che-apps/che
      fabric8.io/scm-tag: fabric8io/tenant-che-1.0.0
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: che
  spec:
    replicas: 1
    revisionHistoryLimit: 2
    selector:
      app: che
      provider: fabric8
      group: io.fabric8.tenant.apps
    strategy:
      recreateParams:
        timeoutSeconds: 10000
      type: Recreate
    template:
      metadata:
        annotations:
          fabric8.io/git-commit: 87c218f8c36cde36356e80c6575bd6f1df85d335
          fabric8.io/metrics-path: dashboard/file/kubernetes-pods.json/?var-project=che&var-version=2.0.75
          fabric8.io/scm-con-url: scm:git:git@github.com:fabric8io/tenant-che.git/tenant-che-apps/che
          fabric8.io/scm-url: http://github.com/fabric8io/tenant-che/tenant-che-apps/che
          fabric8.io/iconUrl: https://cdn.rawgit.com/fabric8io/tenant-che/tenant-che-apps/che/master/apps/che/src/main/fabric8/icon.png
          fabric8.io/git-branch: release-v2.0.75
          fabric8.io/scm-devcon-url: scm:git:git@github.com:fabric8io/tenant-che.git/tenant-che-apps/che
          fabric8.io/scm-tag: fabric8io/tenant-che-1.0.0
        labels:
          app: che
          provider: fabric8
          version: 2.0.75
          group: io.fabric8.tenant.apps
      spec:
        containers:
        - env:
          - name: CHE_DOCKER_IP_EXTERNAL
            valueFrom:
              configMapKeyRef:
                key: hostname-http
                name: che
          - name: CHE_WORKSPACE_STORAGE
            valueFrom:
              configMapKeyRef:
                key: workspace-storage
                name: che
          - name: CHE_LOGS_DIR
            valueFrom:
              configMapKeyRef:
                key: che.logs.dir
                name: che
          - name: CHE_WORKSPACE_STORAGE_CREATE_FOLDERS
            valueFrom:
              configMapKeyRef:
                key: workspace-storage-create-folders
                name: che
          - name: CHE_LOCAL_CONF_DIR
            valueFrom:
              configMapKeyRef:
                key: local-conf-dir
                name: che
          - name: CHE_OPENSHIFT_PROJECT
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: CHE_OPENSHIFT_SERVICEACCOUNTNAME
            valueFrom:
              configMapKeyRef:
                key: openshift-serviceaccountname
                name: che
          - name: CHE_DOCKER_SERVER__EVALUATION__STRATEGY
            valueFrom:
              configMapKeyRef:
                key: che-server-evaluation-strategy
                name: che
          - name: CHE_DOCKER_SERVER__EVALUATION__STRATEGY_CUSTOM_TEMPLATE
            valueFrom:
              configMapKeyRef:
                key: che.docker.server_evaluation_strategy.custom.template
                name: che
          - name: CHE_DOCKER_SERVER__EVALUATION__STRATEGY_CUSTOM_EXTERNAL_PROTOCOL
            valueFrom:
              configMapKeyRef:
                key: che.docker.server_evaluation_strategy.custom.external.protocol
                name: che
          - name: CHE_PREDEFINED_STACKS_RELOAD__ON__START
            valueFrom:
              configMapKeyRef:
                key: che.predefined.stacks.reload_on_start
                name: che
          - name: CHE_LOG_LEVEL
            valueFrom:
              configMapKeyRef:
                key: log-level
                name: che
          - name: CHE_PORT
            valueFrom:
              configMapKeyRef:
                key: port
                name: che
          - name: CHE_DOCKER_CONNECTOR
            valueFrom:
              configMapKeyRef:
                key: docker-connector
                name: che
          - name: CHE_DEBUG_SERVER
            valueFrom:
              configMapKeyRef:
                key: remote-debugging-enabled
                name: che
          - name: CHE_OAUTH_GITHUB_FORCEACTIVATION
            valueFrom:
              configMapKeyRef:
                key: che-oauth-github-forceactivation
                name: che
          - name: CHE_OPENSHIFT_WORKSPACE_MEMORY_OVERRIDE
            valueFrom:
              configMapKeyRef:
                key: workspaces-memory-limit
                name: che
          - name: CHE_OPENSHIFT_WORKSPACE_MEMORY_REQUEST
            valueFrom:
              configMapKeyRef:
                key: workspaces-memory-request
                name: che
          - name: CHE_WORKSPACE_AUTO__START
            valueFrom:
              configMapKeyRef:
                key: enable-workspaces-autostart
                name: che
          - name: JAVA_OPTS
            valueFrom:
              configMapKeyRef:
                key: che-server-java-opts
                name: che
          - name: CHE_WORKSPACE_JAVA_OPTIONS
            valueFrom:
              configMapKeyRef:
                key: che-workspaces-java-opts
                name: che
          - name: CHE_OPENSHIFT_SECURE_ROUTES
            valueFrom:
              configMapKeyRef:
                key: che-openshift-secure-routes
                name: che
          - name: CHE_DOCKER_SERVER__EVALUATION__STRATEGY_SECURE_EXTERNAL_URLS
            valueFrom:
              configMapKeyRef:
                key: che-secure-external-urls
                name: che
          - name: CHE_OPENSHIFT_SERVER_INACTIVE_STOP_TIMEOUT_MS
            valueFrom:
              configMapKeyRef:
                key: che-server-timeout-ms
                name: che
          - name: CHE_OPENSHIFT_PRECREATE_WORKSPACE_DIRS
            valueFrom:
              configMapKeyRef:
                key: che-openshift-precreate-subpaths
                name: che
          - name: CHE_KEYCLOAK_OSO_ENDPOINT
            valueFrom:
              configMapKeyRef:
                key: keycloak-oso-endpoint
                name: che
          - name: CHE_KEYCLOAK_GITHUB_ENDPOINT
            valueFrom:
              configMapKeyRef:
                key: keycloak-github-endpoint
                name: che
          - name: CHE_KEYCLOAK_DISABLED
            valueFrom:
              configMapKeyRef:
                key: keycloak-disabled
                name: che
          - name: CHE_WORKSPACE_AUTO__SNAPSHOT
            valueFrom:
              configMapKeyRef:
                key: che-workspace-auto-snapshot
                name: che
          - name: CHE_KEYCLOAK_AUTH__SERVER__URL
            valueFrom:
              configMapKeyRef:
                key: che-keycloak-auth-server-url
                name: che
          - name: CHE_KEYCLOAK_REALM
            valueFrom:
              configMapKeyRef:
                key: che-keycloak-realm
                name: che
          - name: CHE_KEYCLOAK_CLIENT__ID
            valueFrom:
              configMapKeyRef:
                key: che-keycloak-client-id
                name: che
          - name: CHE_WORKSPACE_AGENT_DEV_PING__SUCCESS__THRESHOLD
            valueFrom:
              configMapKeyRef:
                key: che-wsagent-ping-success-threshold
                name: che
          image: registry.devshift.net/che/che:940f9ac-fabric8-90b62fa
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /api/system/state
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 120
            timeoutSeconds: 10
          name: che
          ports:
          - containerPort: 8080
            name: http
          - containerPort: 8000
            name: http-debug
          readinessProbe:
            httpGet:
              path: /api/system/state
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 15
            timeoutSeconds: 60
          resources:
            limits:
              memory: 512Mi
            requests:
              memory: 256Mi
          volumeMounts:
          - mountPath: /data
            name: che-data-volume
        serviceAccountName: che
        volumes:
        - name: che-data-volume
          persistentVolumeClaim:
            claimName: che-data-volume
    triggers:
    - type: ConfigChange
- apiVersion: v1
  kind: Route
  metadata:
    annotations:
      maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/s_fabric8-tenant-che_master-727B42GPIRO65FFVIHYSZV2UVJGFQED4JY3DHBDAEY5GGQK5J2NQ/apps/che/target/che-2.0.75.jar!/META-INF/fabric8/openshift.yml
    labels:
      app: che
      provider: fabric8
      version: 2.0.75
      group: io.fabric8.tenant.apps
    name: che
  spec:
    tls:
      insecureEdgeTerminationPolicy: Redirect
      termination: edge
    to:
      kind: Service
      name: che-host
parameters:
- name: PROJECT_USER
  value: developer
- name: PROJECT_NAMESPACE
- name: RECOMMENDER_EXTERNAL_NAME
  value: recommender.api.prod-preview.openshift.io
- name: RECOMMENDER_API_TOKEN
- name: DOMAIN
  value: d800.free-int.openshiftapps.com
- name: KEYCLOAK_OSO_ENDPOINT
  value: https://sso.prod-preview.openshift.io/auth/realms/fabric8/broker/openshift-v3/token
- name: KEYCLOAK_GITHUB_ENDPOINT
  value: https://auth.prod-preview.openshift.io/api/token?for=https://github.com
- name: CHE_KEYCLOAK_AUTH__SERVER__URL
  value: https://sso.prod-preview.openshift.io/auth
- name: CHE_KEYCLOAK_REALM
  value: fabric8
- name: CHE_KEYCLOAK_CLIENT__ID
  value: openshiftio-public
