Se agrega la configuración de Code-Server en Kubernetes.

This commit is contained in:
Alejandro Lembke Barrientos 2020-09-17 23:35:19 -06:00
parent df4a7982f1
commit deeacbfd15
5 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: code-server-svc
namespace: default
spec:
selector:
app: code-server
type: ClusterIP
ports:
- protocol: TCP
name: code-server-main
port: 80
targetPort: 8080

View File

@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: code-server
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: code-server
template:
metadata:
labels:
app: code-server
spec:
containers:
- name: code-server
image: codercom/code-server:3.4.1
#Los invito a usar mi imagen personalizada de code-server.
#image: aleleba/code-server:2.0.2
imagePullPolicy: Always
#Pueden exponer cualquier puerto que necesiten que use su aplicación. El Puerto 8080 tienen que exponerlo siempre
ports:
- containerPort: 8080
resources:
requests:
memory: "1Gi"
cpu: "2"
limits:
memory: "1.2Gi"
cpu: "2.2"
env:
- name: PASSWORD
valueFrom:
secretKeyRef:
name: code-server-secret
key: PASSWORD
#Habilitar si desean conectarse a docker de host.
#volumeMounts:
#- mountPath: "/var/run/docker.sock"
#name: dockersock
#volumes:
#- name: dockersock
#hostPath:
#path: /var/run/docker.sock

19
Kubernetes/ingress.yaml Normal file
View File

@ -0,0 +1,19 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
namespace: default
annotations:
kubernetes.io/ingress.class: nginx
nginx.org/websocket-services: "code-server-svc, mongoclient-svc"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: code-server.p-lao.tk
http:
paths:
- path: /
backend:
serviceName: code-server-svc
servicePort: 80

8
Kubernetes/secret.yaml Normal file
View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: code-server-secret
namespace: default
type: Opaque
data:
PASSWORD: cGFzc3dvcmQ=

1
README.md Normal file
View File

@ -0,0 +1 @@
# ¿Cómo Montar Entorno de Desarrollo en Docker-Compose y Kubernetes con Code-Server?