Signed-off-by: Anatolii Bazko <abazko@redhat.com>
pull/1843/head
Anatolii Bazko 2024-05-27 11:12:17 +02:00
parent b95852a5e0
commit 62b648437a
1 changed files with 101 additions and 0 deletions

View File

@ -202,6 +202,102 @@ metadata:
kubernetes.io/metadata.name: ${USER_NAMESPACE} kubernetes.io/metadata.name: ${USER_NAMESPACE}
EOF EOF
kubectl apply -f - <<EOF
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
name: che-code
namespace: ${USER_NAMESPACE}
spec:
commands:
- apply:
component: che-code-injector
id: init-container-command
- exec:
commandLine: nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt
2>&1 &
component: che-code-runtime-description
id: init-che-code-command
components:
- container:
command:
- /entrypoint-init-container.sh
cpuLimit: 500m
cpuRequest: 30m
env:
- name: CHE_DASHBOARD_URL
value: https://$(minikube ip).nip.io
- name: OPENVSX_REGISTRY_URL
value: https://open-vsx.org
image: quay.io/che-incubator/che-code:latest
memoryLimit: 256Mi
memoryRequest: 32Mi
sourceMapping: /projects
volumeMounts:
- name: checode
path: /checode
name: che-code-injector
- attributes:
app.kubernetes.io/component: che-code-runtime
app.kubernetes.io/part-of: che-code.eclipse.org
controller.devfile.io/container-contribution: true
container:
cpuLimit: 500m
cpuRequest: 30m
endpoints:
- attributes:
cookiesAuthEnabled: true
discoverable: false
type: main
urlRewriteSupported: true
exposure: public
name: che-code
protocol: https
secure: true
targetPort: 3100
- attributes:
discoverable: false
urlRewriteSupported: false
exposure: public
name: code-redirect-1
protocol: https
targetPort: 13131
- attributes:
discoverable: false
urlRewriteSupported: false
exposure: public
name: code-redirect-2
protocol: https
targetPort: 13132
- attributes:
discoverable: false
urlRewriteSupported: false
exposure: public
name: code-redirect-3
protocol: https
targetPort: 13133
env:
- name: CHE_DASHBOARD_URL
value: https://$(minikube ip).nip.io
- name: OPENVSX_REGISTRY_URL
value: https://open-vsx.org
image: quay.io/devfile/universal-developer-image:ubi8-latest
memoryLimit: 1024Mi
memoryRequest: 256Mi
sourceMapping: /projects
volumeMounts:
- name: checode
path: /checode
name: che-code-runtime-description
- name: checode
volume: {}
events:
postStart:
- init-che-code-command
preStart:
- init-container-command
EOF
kubectl apply -f - <<EOF kubectl apply -f - <<EOF
kind: DevWorkspace kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2 apiVersion: workspace.devfile.io/v1alpha2
@ -209,6 +305,10 @@ metadata:
name: ${DEV_WORKSPACE_NAME} name: ${DEV_WORKSPACE_NAME}
namespace: ${USER_NAMESPACE} namespace: ${USER_NAMESPACE}
spec: spec:
contributions:
- kubernetes:
name: che-code
name: editor
routingClass: che routingClass: che
started: false started: false
contributions: contributions:
@ -229,6 +329,7 @@ EOF
startAndWaitDevWorkspace() { startAndWaitDevWorkspace() {
# pre-pull image for faster workspace startup # pre-pull image for faster workspace startup
minikube image pull quay.io/devfile/universal-developer-image:ubi8-latest minikube image pull quay.io/devfile/universal-developer-image:ubi8-latest
minikube image pull quay.io/che-incubator/che-code:latest
kubectl patch devworkspace ${DEV_WORKSPACE_NAME} -p '{"spec":{"started":true}}' --type=merge -n ${USER_NAMESPACE} kubectl patch devworkspace ${DEV_WORKSPACE_NAME} -p '{"spec":{"started":true}}' --type=merge -n ${USER_NAMESPACE}
kubectl wait devworkspace ${DEV_WORKSPACE_NAME} -n ${USER_NAMESPACE} --for=jsonpath='{.status.phase}'=Running --timeout=300s kubectl wait devworkspace ${DEV_WORKSPACE_NAME} -n ${USER_NAMESPACE} --for=jsonpath='{.status.phase}'=Running --timeout=300s