LoginSignup
0
2

More than 3 years have passed since last update.

coder-serverをkubernetes上で動かすためのyaml

Posted at

yaml

coder.yaml
---
apiVersion: v1
kind: Service
metadata:
 name: coder
spec:
 type: NodePort
 ports:
   - name: coder
     port: 8080
     nodePort: 32767
 selector:
   app: coder
---
apiVersion: v1
kind: Pod
metadata:
 name: coder
 labels:
   app: coder
spec:
 volumes:
 - name: settings
   hostPath:
     path: /mnt/coder/setting
 - name: project
   hostPath:
     path: /mnt/coder/project
 containers:
 - name: coder
   image: codercom/code-server:v2
   ports:
     - name: coder
       containerPort: 8080
   volumeMounts:
   - name: settings
     mountPath: /home/coder/.local/share/code-server
   - name: project
     mountPath: /home/coder/project
   resources:
     requests:
       memory: "1024Mi"
       cpu: "2000m"
     limits:
       memory: "1536Mi"
       cpu: "2000m"

kubectl apply -f coder.yaml

# kubectl get pods
NAME      READY   STATUS    RESTARTS   AGE
coder     1/1     Running   0          7s

# kubectl logs coder
info  Server listening on http://0.0.0.0:8080
info    - Password is 5890ac8b8abb2eb213121420
info      - To use your own password, set the PASSWORD environment variable
info      - To disable use `--auth none`
info    - Not serving HTTPS

image.png
image.png

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2