Se agrega la configuración de Code-Server en Kubernetes.
This commit is contained in:
parent
df4a7982f1
commit
deeacbfd15
14
Kubernetes/code-server-scv.yaml
Normal file
14
Kubernetes/code-server-scv.yaml
Normal 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
|
45
Kubernetes/code-server.yaml
Normal file
45
Kubernetes/code-server.yaml
Normal 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
19
Kubernetes/ingress.yaml
Normal 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
8
Kubernetes/secret.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: code-server-secret
|
||||
namespace: default
|
||||
type: Opaque
|
||||
data:
|
||||
PASSWORD: cGFzc3dvcmQ=
|
Loading…
Reference in New Issue
Block a user