Last active
April 30, 2020 18:25
-
-
Save xandout/5ed2ce50d28c80cf5697f66fa64da960 to your computer and use it in GitHub Desktop.
Run Theia IDE in Kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: theia-svc | |
spec: | |
ports: | |
- port: 3000 | |
targetPort: 3000 | |
selector: | |
k8s-app: theia | |
--- | |
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: theia | |
spec: | |
serviceName: theia-svc | |
replicas: 1 | |
selector: | |
matchLabels: | |
k8s-app: theia | |
template: | |
metadata: | |
labels: | |
k8s-app: theia | |
spec: | |
initContainers: | |
- name: fix-permissions | |
image: busybox | |
command: ['sh', '-c', 'chown -R 1001:1001 /pvc'] | |
volumeMounts: | |
- mountPath: /pvc | |
name: theia-pvc | |
containers: | |
- name: theia | |
resources: | |
limits: | |
cpu: 1 | |
requests: | |
cpu: 1 | |
image: theiaide/theia | |
volumeMounts: | |
- mountPath: /home/project | |
name: theia-pvc | |
volumeClaimTemplates: | |
- metadata: | |
name: theia-pvc | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 10Gi | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: theia-ingress | |
annotations: | |
external-dns.alpha.kubernetes.io/hostname: "theia-ide.yourdomain.com" | |
kubernetes.io/ingress.class: internal-ingress | |
spec: | |
rules: | |
- host: "theia-ide.yourdomain.com" | |
http: &http_rule | |
paths: | |
- path: / | |
backend: | |
serviceName: theia-svc | |
servicePort: 3000 | |
tls: | |
- hosts: | |
- "theia-ide.yourdomain.com" | |
secretName: letsencrypt-prod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment