From 7b7e94b25a070f63bc52e158028b6b00fea8ee5a Mon Sep 17 00:00:00 2001 From: "ry.yamafuji" Date: Wed, 17 Dec 2025 00:37:19 +0900 Subject: [PATCH] =?UTF-8?q?VSCODE=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6k8s?= =?UTF-8?q?=E3=81=A7=E6=A7=8B=E7=AF=89=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/k8s/README.md | 6 ++++++ infra/k8s/app.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 infra/k8s/README.md create mode 100644 infra/k8s/app.yaml diff --git a/infra/k8s/README.md b/infra/k8s/README.md new file mode 100644 index 0000000..0531d71 --- /dev/null +++ b/infra/k8s/README.md @@ -0,0 +1,6 @@ +# k8sでデプロイする方法 + +```sh +kubectl apply -f https://gitea.pglikers.com/vscode/vscode-server-dev/raw/branch/main/infra/k8s/app.yaml +kubectl port-forward svc/code-server 8080:80 +``` \ No newline at end of file diff --git a/infra/k8s/app.yaml b/infra/k8s/app.yaml new file mode 100644 index 0000000..65ea0bf --- /dev/null +++ b/infra/k8s/app.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: code-server +spec: + replicas: 1 + selector: + matchLabels: + app: code-server + template: + metadata: + labels: + app: code-server + spec: + containers: + - name: code-server + image: codercom/code-server:latest + ports: + - containerPort: 8080 + env: + - name: PASSWORD + value: "changeme" +--- +apiVersion: v1 +kind: Service +metadata: + name: code-server +spec: + selector: + app: code-server + ports: + - port: 80 + targetPort: 8080 \ No newline at end of file