kubernetes部署code-server在线编辑器

  开发

主页
234.png

pvc code-server

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: code-server
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "640Gi"
  volumeName: 
  storageClassName: nfs



svc

apiVersion: v1
kind: Service
metadata:
 name: code-server
 namespace: sre
spec:
 type: NodePort
 ports:
 - port: 8080
   targetPort: 8080
   nodePort: 30028
 selector:
   app: code-server

Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: code-server
  name: code-server
  namespace: sre
spec:
  selector:
    matchLabels:
      app: code-server
  template:
    metadata:
      labels:
        app: code-server
    spec:
      containers:
      - image: registry.cn-hangzhou.aliyuncs.com/sre_pub/code-server
        #image: codercom/code-server
        imagePullPolicy: IfNotPresent
        name: code-server
        ports:
        - containerPort: 8080
        env:
        - name: PASSWORD
          value: "123456"
        volumeMounts:
        - name: coder-data
          mountPath: /home/coder/project
      volumes:
      - name: coder-data
        persistentVolumeClaim:
          claimName: code-server

LEAVE A COMMENT

Captcha Code