Add code-server package manifests

This commit is contained in:
2026-06-03 01:08:06 +00:00
parent cb6cf58229
commit d85dcb5c11
9 changed files with 301 additions and 59 deletions

View File

@ -0,0 +1,29 @@
# code-server Helm postRender
This package is consumed by OCDP as a Kustomize postRender for a Helm rendered
code-server chart.
The platform chain is:
```text
Helm chart + resolved values
-> helm template
-> packages/code-server/post-renders/k3s-hami
-> final Kubernetes resources
```
`post-renders/k3s-hami/kustomization.yaml` patches the Helm output with
environment-managed choices:
- image: `harbor.bwgdi.com/library/earth2studio-demo:v6`
- pull secret: `regcred`
- scheduler: `hami-scheduler`
- HAMi resource limit keys: `nvidia.com/gpu` and `nvidia.com/gpumem`
- NodePort Service on port `80`
- `weight` StorageClass PVC mounted at `/models`
`post-renders/k3s-hami/userInputs.yaml` is the user-facing value contract. Users
only choose CPU, memory, GPU count, and GPU memory. The console renders these
fields as the WorkloadClaim form; the operator receives the resolved values on
the Workload CR and applies the postRender patches. Storage, exposure, image,
scheduler, pull secret, and code-server auth mode stay in the admin postRender.

View File

@ -0,0 +1,119 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: "{{ namespace }}"
resources:
- rendered.yaml
- weights-pvc.yaml
patches:
- target:
group: apps
version: v1
kind: Deployment
name: "{{ name }}"
patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ name }}"
labels:
app.kubernetes.io/component: ide
app.kubernetes.io/part-of: ocdp-workload
spec:
template:
metadata:
labels:
app.kubernetes.io/component: ide
app.kubernetes.io/part-of: ocdp-workload
spec:
imagePullSecrets:
- name: regcred
schedulerName: hami-scheduler
securityContext:
fsGroup: 1000
volumes:
- name: data
persistentVolumeClaim:
claimName: "{{ name }}"
- name: model-weights
persistentVolumeClaim:
claimName: "{{ name }}-weights"
containers:
- name: code-server
image: harbor.bwgdi.com/library/earth2studio-demo:v6
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 1000
command:
- code-server
args:
- --bind-addr
- 0.0.0.0:8080
- --auth
- none
- /workspace
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: HOME
value: /workspace
- name: XDG_CONFIG_HOME
value: /workspace/.config
readinessProbe:
httpGet:
path: /
port: http
livenessProbe:
httpGet:
path: /
port: http
resources:
requests:
cpu: "{{ cpuRequestMillicores }}m"
memory: "{{ memoryRequestMiB }}Mi"
limits:
cpu: "{{ cpuLimitMillicores }}m"
memory: "{{ memoryLimitMiB }}Mi"
nvidia.com/gpu: "{{ gpuCount }}"
nvidia.com/gpumem: "{{ gpuMemoryMiB }}"
volumeMounts:
- name: data
mountPath: /workspace
- name: model-weights
mountPath: /models
- target:
version: v1
kind: Secret
name: "{{ name }}"
patch: |
apiVersion: v1
kind: Secret
metadata:
name: "{{ name }}"
labels:
app.kubernetes.io/component: auth
app.kubernetes.io/part-of: ocdp-workload
annotations: {}
type: Opaque
data:
password: dW51c2Vk
- target:
version: v1
kind: Service
name: "{{ name }}"
patch: |
apiVersion: v1
kind: Service
metadata:
name: "{{ name }}"
labels:
app.kubernetes.io/component: ide
app.kubernetes.io/part-of: ocdp-workload
spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: http
protocol: TCP

View File

@ -0,0 +1,35 @@
cpuRequestMillicores:
label: CPU request
type: number
default: 500
minimum: 0
cpuLimitMillicores:
label: CPU limit
type: number
default: 2000
minimum: 0
memoryRequestMiB:
label: Memory request
type: number
default: 1024
minimum: 0
memoryLimitMiB:
label: Memory limit
type: number
default: 4096
minimum: 0
gpuCount:
label: GPU count
type: number
default: 1
minimum: 0
gpuMemoryMiB:
label: GPU memory
type: number
default: 8192
minimum: 0

View File

@ -0,0 +1,18 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "{{ name }}-weights"
namespace: "{{ namespace }}"
labels:
app.kubernetes.io/name: "{{ name }}"
app.kubernetes.io/component: model-weights
app.kubernetes.io/part-of: ocdp-workload
annotations:
platform.ocdp.io/storage-role: model-weights
spec:
accessModes:
- ReadWriteMany
storageClassName: weight
resources:
requests:
storage: 100Gi