forked from teamhanko/hanko
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic kubernetes manifests and quickstart overlay including pos…
…tgres pod
- Loading branch information
1 parent
14aee54
commit 681596e
Showing
14 changed files
with
240 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: hanko | ||
namespace: hanko | ||
labels: | ||
app: hanko | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: hanko | ||
template: | ||
metadata: | ||
labels: | ||
app: hanko | ||
spec: | ||
containers: | ||
- name: hanko | ||
image: ghcr.io/teamhanko/hanko:main | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- serve | ||
ports: | ||
- containerPort: 8000 | ||
name: public | ||
- containerPort: 8001 | ||
name: private | ||
volumeMounts: | ||
- mountPath: /etc/config | ||
name: hanko-config | ||
initContainers: | ||
- name: hanko-migrate | ||
image: ghcr.io/teamhanko/hanko:main | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- migrate | ||
- up | ||
volumeMounts: | ||
- mountPath: /etc/config | ||
name: hanko-config | ||
volumes: | ||
- name: hanko-config | ||
configMap: | ||
name: hanko-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
resources: | ||
- deployment.yaml | ||
- services.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: hanko | ||
namespace: hanko | ||
spec: | ||
selector: | ||
app: hanko | ||
ports: | ||
- port: 80 | ||
targetPort: public | ||
protocol: TCP | ||
name: http | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: hanko-private | ||
namespace: hanko | ||
spec: | ||
selector: | ||
app: hanko | ||
ports: | ||
- port: 80 | ||
targetPort: private | ||
protocol: TCP | ||
name: http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
database: | ||
user: hanko | ||
password: hanko | ||
host: postgres.hanko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
namespace: hanko | ||
name: hanko | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true" | ||
spec: | ||
tls: | ||
- hosts: | ||
- hanko.test | ||
secretName: hanko-tls | ||
rules: | ||
- host: hanko.test | ||
http: | ||
paths: | ||
- path: /api | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: hanko | ||
port: | ||
name: http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace: hanko | ||
resources: | ||
- namespace.yaml | ||
- ingress.yaml | ||
- ../../base | ||
- ../../postgres | ||
configMapGenerator: | ||
- files: | ||
- hanko-config.yaml | ||
name: hanko-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: hanko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: postgres | ||
namespace: hanko | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: postgres | ||
spec: | ||
containers: | ||
- name: postgres | ||
image: postgres:12-alpine | ||
ports: | ||
- containerPort: 5432 | ||
name: postgres-hanko | ||
env: | ||
- name: POSTGRES_DB | ||
value: hanko | ||
- name: POSTGRES_USER | ||
value: hanko | ||
- name: POSTGRES_PASSWORD | ||
value: hanko | ||
volumeMounts: | ||
- mountPath: /docker-entrypoint-initdb.d | ||
name: initdb | ||
- mountPath: /var/lib/postgresql/data | ||
name: postgres-pv-claim | ||
volumes: | ||
- name: initdb | ||
configMap: | ||
name: initdb | ||
- name: postgres-pv-claim | ||
persistentVolumeClaim: | ||
claimName: postgres-pv-claim | ||
selector: | ||
matchLabels: | ||
app: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL | ||
CREATE DATABASE hanko; | ||
GRANT ALL PRIVILEGES ON DATABASE hanko TO $POSTGRES_USER; | ||
EOSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
resources: | ||
- deployment.yaml | ||
- service.yaml | ||
- persistent-volume.yaml | ||
configMapGenerator: | ||
- name: initdb | ||
files: | ||
- initdbscript.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
kind: PersistentVolume | ||
apiVersion: v1 | ||
metadata: | ||
name: postgres-pv | ||
namespace: hanko | ||
labels: | ||
type: local | ||
spec: | ||
storageClassName: standard | ||
capacity: | ||
storage: 100M | ||
accessModes: | ||
- ReadWriteOnce | ||
hostPath: | ||
path: "/mnt/data" | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app: postgres | ||
name: postgres-pv-claim | ||
namespace: hanko | ||
spec: | ||
storageClassName: standard | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 100M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgres | ||
namespace: hanko | ||
spec: | ||
ports: | ||
- port: 5432 | ||
selector: | ||
app: postgres |