From 0d0454006446065c292d47717cd06c9a52305a99 Mon Sep 17 00:00:00 2001 From: Iain Walmsley Date: Fri, 24 Nov 2023 13:58:45 +0000 Subject: [PATCH] fix: correct liveness probe and init container dir setup --- .../resources/vscode.deployment.template.yml | 12 ++++++---- .../deploymentGenerator.spec.js.snap | 24 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/code/workspaces/infrastructure-api/resources/vscode.deployment.template.yml b/code/workspaces/infrastructure-api/resources/vscode.deployment.template.yml index a198e2cd4..050ff829e 100644 --- a/code/workspaces/infrastructure-api/resources/vscode.deployment.template.yml +++ b/code/workspaces/infrastructure-api/resources/vscode.deployment.template.yml @@ -26,7 +26,7 @@ spec: image: busybox imagePullPolicy: IfNotPresent command: ["sh"] - args: ["-c", "mkdir -p /mnt/persistentfs/vscode/{{ name }}/workspace && mkdir -p /mnt/persistentfs/vscode/{{ name }}/conda"] + args: ["-c", "mkdir -p /mnt/persistentfs/notebooks/{{ name }}/workspace /mnt/persistentfs/notebooks/{{ name }}/conda /assets"] volumeMounts: - mountPath: /mnt/persistentfs name: persistentfsvol @@ -36,7 +36,7 @@ spec: image: busybox imagePullPolicy: IfNotPresent command: ["sh"] - args: ["-c", "chmod 777 /mnt/persistentfs/notebooks && chmod 777 /mnt/persistentfs/vscode/{{ name }} && chmod 777 /mnt/persistentfs/vscode/{{ name }}/workspace && chmod 777 /mnt/persistentfs/vscode/{{ name }}/conda && ln -sfn /assets /mnt/persistentfs/vscode/{{ name }}/assets"] + args: ["-c", "chmod 777 /mnt/persistentfs/notebooks/{{ name }} /mnt/persistentfs/notebooks/{{ name }}/workspace /mnt/persistentfs/notebooks/{{ name }}/conda && ln -sfn /assets /mnt/persistentfs/notebooks/{{ name }}/assets"] volumeMounts: - mountPath: /mnt/persistentfs name: persistentfsvol @@ -69,11 +69,13 @@ spec: cpu: 2 memory: 8Gi livenessProbe: - httpGet: - path: {{{ basePath }}} - port: 3000 + failureThreshold: 5 initialDelaySeconds: 5 periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 5 volumeMounts: {{#volumeMount}} - name: persistentfsvol diff --git a/code/workspaces/infrastructure-api/src/kubernetes/__snapshots__/deploymentGenerator.spec.js.snap b/code/workspaces/infrastructure-api/src/kubernetes/__snapshots__/deploymentGenerator.spec.js.snap index 70f84c277..1d1444484 100644 --- a/code/workspaces/infrastructure-api/src/kubernetes/__snapshots__/deploymentGenerator.spec.js.snap +++ b/code/workspaces/infrastructure-api/src/kubernetes/__snapshots__/deploymentGenerator.spec.js.snap @@ -796,7 +796,7 @@ spec: image: busybox imagePullPolicy: IfNotPresent command: [\\"sh\\"] - args: [\\"-c\\", \\"mkdir -p /mnt/persistentfs/vscode/deployment-name/workspace && mkdir -p /mnt/persistentfs/vscode/deployment-name/conda\\"] + args: [\\"-c\\", \\"mkdir -p /mnt/persistentfs/notebooks/deployment-name/workspace /mnt/persistentfs/notebooks/deployment-name/conda /assets\\"] volumeMounts: - mountPath: /mnt/persistentfs name: persistentfsvol @@ -806,7 +806,7 @@ spec: image: busybox imagePullPolicy: IfNotPresent command: [\\"sh\\"] - args: [\\"-c\\", \\"chmod 777 /mnt/persistentfs/notebooks && chmod 777 /mnt/persistentfs/vscode/deployment-name && chmod 777 /mnt/persistentfs/vscode/deployment-name/workspace && chmod 777 /mnt/persistentfs/vscode/deployment-name/conda && ln -sfn /assets /mnt/persistentfs/vscode/deployment-name/assets\\"] + args: [\\"-c\\", \\"chmod 777 /mnt/persistentfs/notebooks/deployment-name /mnt/persistentfs/notebooks/deployment-name/workspace /mnt/persistentfs/notebooks/deployment-name/conda && ln -sfn /assets /mnt/persistentfs/notebooks/deployment-name/assets\\"] volumeMounts: - mountPath: /mnt/persistentfs name: persistentfsvol @@ -839,11 +839,13 @@ spec: cpu: 2 memory: 8Gi livenessProbe: - httpGet: - path: / - port: 3000 + failureThreshold: 5 initialDelaySeconds: 5 periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 5 volumeMounts: - name: persistentfsvol mountPath: /data @@ -883,7 +885,7 @@ spec: image: busybox imagePullPolicy: IfNotPresent command: [\\"sh\\"] - args: [\\"-c\\", \\"mkdir -p /mnt/persistentfs/vscode/deployment-name/workspace && mkdir -p /mnt/persistentfs/vscode/deployment-name/conda\\"] + args: [\\"-c\\", \\"mkdir -p /mnt/persistentfs/notebooks/deployment-name/workspace /mnt/persistentfs/notebooks/deployment-name/conda /assets\\"] volumeMounts: - mountPath: /mnt/persistentfs name: persistentfsvol @@ -893,7 +895,7 @@ spec: image: busybox imagePullPolicy: IfNotPresent command: [\\"sh\\"] - args: [\\"-c\\", \\"chmod 777 /mnt/persistentfs/notebooks && chmod 777 /mnt/persistentfs/vscode/deployment-name && chmod 777 /mnt/persistentfs/vscode/deployment-name/workspace && chmod 777 /mnt/persistentfs/vscode/deployment-name/conda && ln -sfn /assets /mnt/persistentfs/vscode/deployment-name/assets\\"] + args: [\\"-c\\", \\"chmod 777 /mnt/persistentfs/notebooks/deployment-name /mnt/persistentfs/notebooks/deployment-name/workspace /mnt/persistentfs/notebooks/deployment-name/conda && ln -sfn /assets /mnt/persistentfs/notebooks/deployment-name/assets\\"] volumeMounts: - mountPath: /mnt/persistentfs name: persistentfsvol @@ -926,11 +928,13 @@ spec: cpu: 2 memory: 8Gi livenessProbe: - httpGet: - path: / - port: 3000 + failureThreshold: 5 initialDelaySeconds: 5 periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 5 volumeMounts: - name: persistentfsvol mountPath: /data