Merge pull request 'Refactored pgadmin k3s template' (#23) from dev into main
Reviewed-on: #23
This commit was merged in pull request #23.
This commit is contained in:
@@ -1,95 +1,46 @@
|
|||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: pgadmin
|
name: pgadmin
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: pgadmin-data-pvc
|
||||||
|
namespace: pgadmin
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
storageClassName: nfs-storage
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: pgadmin-auth
|
||||||
|
namespace: pgadmin
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
pgadmin-password: QmxhY2tzdGFyMkBob21l
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: pgadmin-config
|
name: pgadmin-config
|
||||||
namespace: pgadmin
|
namespace: pgadmin
|
||||||
data:
|
data:
|
||||||
server.email: "khwezi@mngoma.lab"
|
PGADMIN_DEFAULT_EMAIL: "khwezi@litecharms.co.za"
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-secret
|
|
||||||
namespace: pgadmin
|
|
||||||
type: Opaque
|
|
||||||
data:
|
|
||||||
server.password: M3pDQTQz
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-sa
|
|
||||||
namespace: pgadmin
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-role
|
|
||||||
namespace: pgadmin
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["pods", "services", "persistentvolumeclaims", "configmaps", "secrets"]
|
|
||||||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-rolebinding
|
|
||||||
namespace: pgadmin
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: pgadmin-sa
|
|
||||||
namespace: pgadmin
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: Role
|
|
||||||
name: pgadmin-role
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolume
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-pv
|
|
||||||
spec:
|
|
||||||
capacity:
|
|
||||||
storage: 2Gi
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
storageClassName: local-pvs
|
|
||||||
local:
|
|
||||||
path: /home/ansible/k3s/makhiwane/pgadmin
|
|
||||||
nodeAffinity:
|
|
||||||
required:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
- matchExpressions:
|
|
||||||
- key: kubernetes.io/hostname
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- lead
|
|
||||||
persistentVolumeReclaimPolicy: Retain
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-pvc
|
|
||||||
namespace: pgadmin
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
storageClassName: local-pvs
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 2Gi
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: pgadmin
|
name: pgadmin
|
||||||
namespace: pgadmin
|
namespace: pgadmin
|
||||||
|
labels:
|
||||||
|
app: pgadmin
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
@@ -100,60 +51,64 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: pgadmin
|
app: pgadmin
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: pgadmin-sa
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: node-role.kubernetes.io/control-plane
|
||||||
|
operator: DoesNotExist
|
||||||
|
- key: node-role.kubernetes.io/master
|
||||||
|
operator: DoesNotExist
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 5050
|
runAsUser: 5050
|
||||||
runAsGroup: 5050
|
|
||||||
fsGroup: 5050
|
fsGroup: 5050
|
||||||
containers:
|
containers:
|
||||||
- name: pgadmin
|
- name: pgadmin
|
||||||
image: dpage/pgadmin4:latest
|
image: dpage/pgadmin4:latest
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
volumeMounts:
|
name: http
|
||||||
- name: pgadmin-data
|
|
||||||
mountPath: /var/lib/pgadmin
|
|
||||||
env:
|
env:
|
||||||
- name: PGADMIN_DEFAULT_EMAIL
|
- name: PGADMIN_DEFAULT_EMAIL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: pgadmin-config
|
name: pgadmin-config
|
||||||
key: server.email
|
key: PGADMIN_DEFAULT_EMAIL
|
||||||
- name: PGADMIN_DEFAULT_PASSWORD
|
- name: PGADMIN_DEFAULT_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: pgadmin-secret
|
name: pgadmin-auth
|
||||||
key: server.password
|
key: pgadmin-password
|
||||||
|
- name: PGADMIN_CONFIG_UPGRADE_CHECK_ENABLED
|
||||||
|
value: "False"
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "256Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "512Mi"
|
||||||
|
volumeMounts:
|
||||||
|
- name: pgadmin-storage
|
||||||
|
mountPath: /var/lib/pgadmin
|
||||||
volumes:
|
volumes:
|
||||||
- name: pgadmin-data
|
- name: pgadmin-storage
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: pgadmin-pvc
|
claimName: pgadmin-data-pvc
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: pgadmin
|
name: pgadmin-service
|
||||||
namespace: pgadmin
|
namespace: pgadmin
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: NodePort
|
||||||
selector:
|
selector:
|
||||||
app: pgadmin
|
app: pgadmin
|
||||||
ports:
|
ports:
|
||||||
- port: 80
|
- name: http
|
||||||
targetPort: 80
|
protocol: TCP
|
||||||
---
|
|
||||||
apiVersion: traefik.io/v1alpha1
|
|
||||||
kind: IngressRoute
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-ingress
|
|
||||||
namespace: pgadmin
|
|
||||||
spec:
|
|
||||||
entryPoints:
|
|
||||||
- websecure
|
|
||||||
routes:
|
|
||||||
- match: Host(`pgadmin.apps.mngoma.lab`)
|
|
||||||
kind: Rule
|
|
||||||
services:
|
|
||||||
- name: pgadmin
|
|
||||||
port: 80
|
port: 80
|
||||||
tls: {}
|
targetPort: 80
|
||||||
|
nodePort: 32080
|
||||||
Reference in New Issue
Block a user