Add code-server

This commit is contained in:
Mathis 2024-01-04 20:58:23 +00:00
parent 5e4231b265
commit 0dcb09265b
6 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: code-server
name: code-server
namespace: code-server
spec:
selector:
matchLabels:
app: code-server
replicas: 1
template:
metadata:
labels:
app: code-server
spec:
initContainers:
- name: init-chmod-data
image: busybox:latest
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
chown -R 1000:1000 /home/coder
securityContext:
runAsUser: 0
volumeMounts:
- name: data
mountPath: /home/coder
containers:
- image: codercom/code-server:latest
imagePullPolicy: IfNotPresent
name: code-server
args:
- --auth
- none
securityContext:
runAsUser: 1000
volumeMounts:
- name: data
mountPath: /home/coder
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
volumes:
- name: data
persistentVolumeClaim:
claimName: code-server

16
apps/code-server/ingress.yaml Executable file
View File

@ -0,0 +1,16 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: mlflow-ingress
namespace: mlflow
spec:
entryPoints:
- websecure
routes:
- match: Host(`code.namesny.com`)
kind: Rule
middlewares:
- name: "auth-authelia@kubernetescrd"
services:
- name: code-server
port: 8080

View File

@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: code-server
resources:
- namespace.yaml
- service.yaml
- pvc.yaml
- deployment.yaml
- ingress.yaml

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: code-server

13
apps/code-server/pvc.yaml Normal file
View File

@ -0,0 +1,13 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: code-server
namespace: code-server
labels:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: "retain-local-path"

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: code-server
namespace: code-server
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: code-server