Merge pull request 'Added VS code template' (#56) from dev into main
Reviewed-on: #56
This commit was merged in pull request #56.
This commit is contained in:
@@ -1,120 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: piston
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: piston-sa
|
|
||||||
namespace: piston
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: piston-config
|
|
||||||
namespace: piston
|
|
||||||
data:
|
|
||||||
piston.domain: "piston.khongisa.co.za"
|
|
||||||
piston.rooturl: "https://piston.khongisa.co.za"
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: piston-ui-secret
|
|
||||||
namespace: piston
|
|
||||||
type: Opaque
|
|
||||||
data:
|
|
||||||
password: QmxhY2tzdGFyMkBob21l
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: piston-pvc
|
|
||||||
namespace: piston
|
|
||||||
spec:
|
|
||||||
accessModes: ["ReadWriteOnce"]
|
|
||||||
storageClassName: nfs-storage
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 50Gi
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: piston
|
|
||||||
namespace: piston
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: piston
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: piston
|
|
||||||
spec:
|
|
||||||
serviceAccountName: piston-sa
|
|
||||||
hostNetwork: false
|
|
||||||
hostPID: false
|
|
||||||
hostIPC: false
|
|
||||||
containers:
|
|
||||||
- name: piston
|
|
||||||
image: ghcr.io/engineer-man/piston:latest
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
allowPrivilegeEscalation: true
|
|
||||||
runAsNonRoot: false
|
|
||||||
ports:
|
|
||||||
- containerPort: 2000
|
|
||||||
volumeMounts:
|
|
||||||
- name: packages
|
|
||||||
mountPath: /piston/packages
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: "500m"
|
|
||||||
memory: "1Gi"
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: "2Gi"
|
|
||||||
- name: ui
|
|
||||||
image: codercom/code-server:latest
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: "500m"
|
|
||||||
memory: "1Gi"
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: "2Gi"
|
|
||||||
env:
|
|
||||||
- name: PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: piston-ui-secret
|
|
||||||
key: password
|
|
||||||
volumeMounts:
|
|
||||||
- name: packages
|
|
||||||
mountPath: /home/coder/project
|
|
||||||
volumes:
|
|
||||||
- name: packages
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: piston-pvc
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: piston-service
|
|
||||||
namespace: piston
|
|
||||||
spec:
|
|
||||||
type: NodePort
|
|
||||||
selector:
|
|
||||||
app: piston
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
protocol: TCP
|
|
||||||
port: 80
|
|
||||||
targetPort: 8080
|
|
||||||
nodePort: 31003
|
|
||||||
110
kubernetes-templates/vscode.yml
Normal file
110
kubernetes-templates/vscode.yml
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: vscode
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: vscode-data-pvc
|
||||||
|
namespace: vscode
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
storageClassName: nfs-storage
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: vscode-auth
|
||||||
|
namespace: vscode
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
vscode-password: YWRtaW4=
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: vscode-config
|
||||||
|
namespace: vscode
|
||||||
|
data:
|
||||||
|
CODE_SERVER_ARGS: "--auth password"
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: vscode
|
||||||
|
namespace: vscode
|
||||||
|
labels:
|
||||||
|
app: vscode
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: vscode
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: vscode
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: node-role.kubernetes.io/control-plane
|
||||||
|
operator: DoesNotExist
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
fsGroup: 1000
|
||||||
|
containers:
|
||||||
|
- name: vscode
|
||||||
|
image: codercom/code-server:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: http
|
||||||
|
env:
|
||||||
|
- name: PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: vscode-auth
|
||||||
|
key: vscode-password
|
||||||
|
- name: ARGS
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: vscode-config
|
||||||
|
key: CODE_SERVER_ARGS
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "250m"
|
||||||
|
memory: "512Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "1000m"
|
||||||
|
memory: "1Gi"
|
||||||
|
volumeMounts:
|
||||||
|
- name: vscode-storage
|
||||||
|
mountPath: /home/coder/project
|
||||||
|
volumes:
|
||||||
|
- name: vscode-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: vscode-data-pvc
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: vscode-service
|
||||||
|
namespace: vscode
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: vscode
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
protocol: TCP
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
nodePort: 32082
|
||||||
Reference in New Issue
Block a user