Bạn có thể build VS Code trên server linux và access vào VS code thông qua website
https://github.com/gitpod-io/openvscode-server
Docker
docker run -it --init -p 3000:3000 gitpod/openvscode-server
sudo -i
apt update
>>/home/openvscode-server/.ssh/id_rsa
Deployment
apiVersion: apps/v1 kind: Deployment metadata: name: openvscode-server namespace: XXXXX-engines-prod labels: app.kubernetes.io/instance: openvscode-server app.kubernetes.io/name: openvscode-server spec: replicas: 4 selector: matchLabels: app.kubernetes.io/instance: openvscode-server app.kubernetes.io/name: openvscode-server template: metadata: creationTimestamp: null labels: app.kubernetes.io/instance: openvscode-server app.kubernetes.io/name: openvscode-server spec: volumes: - name: file-service persistentVolumeClaim: claimName: pvc-file-service-smb-1 containers: - name: openvscode-server image: gitpod/openvscode-server:latest ports: - name: http containerPort: 3000 protocol: TCP resources: {} volumeMounts: - name: file-service mountPath: /app/downloaded livenessProbe: httpGet: path: / port: http scheme: HTTP timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 readinessProbe: httpGet: path: / port: http scheme: HTTP timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: Always restartPolicy: Always terminationGracePeriodSeconds: 30 dnsPolicy: ClusterFirst nodeSelector: kubernetes.io/os: linux securityContext: {} schedulerName: default-scheduler strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 25% maxSurge: 25% revisionHistoryLimit: 10 progressDeadlineSeconds: 600
Helm chart
Ngoài ra bạn có thể sử dụng helm chart do Nim has writen.
helm repo add openvscode-server-helm https://mrnim94.github.io/openvscode-server-helm/ "openvscode-server-helm" has been added to your repositories helm search repo openvscode-server-helm NAME CHART VERSION APP VERSION DESCRIPTION openvscode-server-helm/openvscode-server 0.1.0 v1.74.2 A Helm chart for Kubernetes
Value mẫu
ingress: enabled: true className: "nginx" annotations: cert-manager.io/issuer: openvscode-server cert-manager.io/issuer-kind: Issuer nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth nginx.ingress.kubernetes.io/configuration-snippet: | proxy_set_header Origin ""; proxy_hide_header l5d-remote-ip; proxy_hide_header l5d-server-id; nginx.ingress.kubernetes.io/proxy-buffer-size: 8k nginx.ingress.kubernetes.io/proxy-buffering: "on" hosts: - host: vscode.nimtechnology.com paths: - path: / pathType: ImplementationSpecific tls: - hosts: - vscode.nimtechnology.com secretName: tls-oauth2-proxy-ingress persistence: enabled: true persistentVolumeClaim: workspace: storageClass: "longhorn" size: 5Gi podSecurityContext: fsGroup: 1000