diff options
author | terminaldweller <thabogre@gmail.com> | 2022-05-01 20:50:47 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-05-01 20:50:47 +0000 |
commit | 8ba4e6c49607531de6ff7426a33bdf75e10a25a1 (patch) | |
tree | ce42dbd518cc97bd4dec0a6696ba42a7743fca85 | |
parent | update for irssi config (diff) | |
download | scripts-8ba4e6c49607531de6ff7426a33bdf75e10a25a1.tar.gz scripts-8ba4e6c49607531de6ff7426a33bdf75e10a25a1.zip |
added postgres to k3s, using ueberzug instead of w3m for previews
-rw-r--r-- | .config/ranger/rc.conf | 2 | ||||
-rwxr-xr-x | kubernetes/postgres/deploy.sh | 9 | ||||
-rw-r--r-- | kubernetes/postgres/postgres-data-volume.yaml | 12 | ||||
-rw-r--r-- | kubernetes/postgres/postgres-deployment.yaml | 74 | ||||
-rw-r--r-- | kubernetes/postgres/postgres-secret.yaml | 12 |
5 files changed, 108 insertions, 1 deletions
diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index f285c3a..4ad8b91 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -106,7 +106,7 @@ set preview_images true # while slower, this allows remote previews, # for example during an ssh session. # Tmux is unsupported. -set preview_images_method w3m +set preview_images_method ueberzug # Delay in seconds before displaying an image with the w3m method. # Increase it in case of experiencing display corruption. diff --git a/kubernetes/postgres/deploy.sh b/kubernetes/postgres/deploy.sh new file mode 100755 index 0000000..0397ea4 --- /dev/null +++ b/kubernetes/postgres/deploy.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +kubectl apply -f ./postgres-secret.yaml +kubectl apply -f ./postgres-data-volume.yaml +kubectl apply -f ./postgres-deployment.yaml + +# kubectl delete pod mongodb +# kubectl delete pvc +# kubectl delete pv diff --git a/kubernetes/postgres/postgres-data-volume.yaml b/kubernetes/postgres/postgres-data-volume.yaml new file mode 100644 index 0000000..a758366 --- /dev/null +++ b/kubernetes/postgres/postgres-data-volume.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + name: postgres-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 500Mi +status: {} diff --git a/kubernetes/postgres/postgres-deployment.yaml b/kubernetes/postgres/postgres-deployment.yaml new file mode 100644 index 0000000..2711117 --- /dev/null +++ b/kubernetes/postgres/postgres-deployment.yaml @@ -0,0 +1,74 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres + labels: + app: postgres +spec: + replicas: 1 + selector: + matchLabels: + app: postgres + template: + metadata: + labels: + app: postgres + spec: + containers: + - name: postgres + image: postgres:14.2-alpine3.15 + ports: + - containerPort: 5432 + env: + # - name: POSTGRES_USER + # valueFrom: + # secretKeyRef: + # name: postgres-secrets + # key: postgres-user + # optional: false + # - name: POSTGRES_DB + # valueFrom: + # secretKeyRef: + # name: postgres-secrets + # key: postgres-db + # optional: false + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secrets + key: postgres-password + optional: false + # - name: POSTGRES_INITDB_ARGS + # valueFrom: + # secretKeyRef: + # name: postgres-secrets + # key: postgres-initdb-args + # optional: false + - name: POSTGRES_HOST_AUTH_METHOD + valueFrom: + secretKeyRef: + name: postgres-secrets + key: postgres-host-auth-method + optional: false + volumeMounts: + - name: postgres-data + mountPath: /var/lib/postgres/data + volumes: + - name: postgres-data + persistentVolumeClaim: + claimName: postgres-data +--- +apiVersion: v1 +kind: Service +metadata: + name: postgres-service +spec: + selector: + app: postgres + type: LoadBalancer + ports: + - protocol: TCP + name: "5432" + port: 5432 + targetPort: 5432 + nodePort: 30432 diff --git a/kubernetes/postgres/postgres-secret.yaml b/kubernetes/postgres/postgres-secret.yaml new file mode 100644 index 0000000..b47853b --- /dev/null +++ b/kubernetes/postgres/postgres-secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +metadata: + name: postgres-secrets +type: Opaque +data: + postgres-password: ZGV2aQo= + postgres-user: ZGV2aQo= + postgres-db: ZGV2aQo= + # postgres-host-auth-method: c2NyYW0tc2hhLTI1Ngo= + postgres-host-auth-method: bWQ1Cg== + postgres-initdb-args: LWF1dGgtaG9zdD1zY3JhbS1zaGEtMjU2Cg== |