feat: add module3-6
This commit is contained in:
parent
6d6273a33b
commit
a4b002dc61
95 changed files with 1848 additions and 1 deletions
8
module3/k8s/kustomize/postgres/kustomization.yaml
Normal file
8
module3/k8s/kustomize/postgres/kustomization.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- namespace-postgres.yaml
|
||||
- statefulset-postgres-scrumlr.yaml
|
||||
- service-postgres-scrumlr.yaml
|
||||
- persistentvolumeclaim-postgres-scrumlr.yaml
|
||||
- secret-postgres-scrumlr.yaml
|
||||
4
module3/k8s/kustomize/postgres/namespace-postgres.yaml
Normal file
4
module3/k8s/kustomize/postgres/namespace-postgres.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: postgres
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-scrumlr
|
||||
namespace: postgres
|
||||
labels:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 8Gi
|
||||
14
module3/k8s/kustomize/postgres/secret-postgres-scrumlr.yaml
Normal file
14
module3/k8s/kustomize/postgres/secret-postgres-scrumlr.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: postgres-scrumlr
|
||||
namespace: postgres
|
||||
labels:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
type: Opaque
|
||||
data:
|
||||
# echo -n 'super-secret-password' | base64
|
||||
POSTGRES_USER: c2NydW1scg== # base64 encoded value of 'scrumlr'
|
||||
POSTGRES_PASSWORD: c3VwZXItc2VjcmV0LXBhc3N3b3Jk # base64 encoded value of 'super-secret-password'
|
||||
18
module3/k8s/kustomize/postgres/service-postgres-scrumlr.yaml
Normal file
18
module3/k8s/kustomize/postgres/service-postgres-scrumlr.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres-scrumlr
|
||||
namespace: postgres
|
||||
labels:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
selector:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: postgres-scrumlr
|
||||
namespace: postgres
|
||||
labels:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
serviceName: "postgres-scrumlr"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: "postgres"
|
||||
app.kubernetes.io/component: "database"
|
||||
app.kubernetes.io/part-of: "scrumlr"
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:17.4
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "20m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-scrumlr
|
||||
key: POSTGRES_USER
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-scrumlr
|
||||
key: POSTGRES_PASSWORD
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: postgres
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: postgres
|
||||
volumes:
|
||||
- name: postgres
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-scrumlr
|
||||
Loading…
Add table
Add a link
Reference in a new issue