-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial K8s deployment setup for local (used with Minikube)
- Loading branch information
Showing
11 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
deployment/k8s/tla-sample-backend/common/tla-sample-backend-config.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,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: tla-sample-backend-config | ||
data: | ||
application.properties: |- | ||
# https://spring.io/guides/topicals/spring-on-kubernetes | ||
server.shutdown=graceful | ||
management.endpoints.web.exposure.include=* |
49 changes: 49 additions & 0 deletions
49
deployment/k8s/tla-sample-backend/common/tla-sample-backend-deployment.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,49 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tla-sample-backend | ||
labels: | ||
app: tla-sample-backend | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: tla-sample-backend | ||
template: | ||
metadata: | ||
labels: | ||
app: tla-sample-backend | ||
spec: | ||
containers: | ||
- name: tla-sample-backend | ||
image: contextmapper/ddd-cm-tla-sample-application:latest | ||
imagePullPolicy: "Always" | ||
envFrom: | ||
- configMapRef: | ||
name: tla-sample-backend-env-config | ||
- secretRef: | ||
name: tla-sample-backend-secrets | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
- containerPort: 8443 | ||
name: https | ||
resources: | ||
limits: | ||
memory: 1024Mi | ||
requests: | ||
memory: 512Mi | ||
volumeMounts: | ||
- mountPath: /srv/web/conf/application.properties | ||
name: tla-sample-backend-config | ||
subPath: application.properties | ||
readinessProbe: | ||
httpGet: | ||
port: 8080 | ||
path: /actuator/health/readiness | ||
initialDelaySeconds: 30 | ||
periodSeconds: 5 | ||
volumes: | ||
- name: tla-sample-backend-config | ||
configMap: | ||
name: tla-sample-backend-config |
17 changes: 17 additions & 0 deletions
17
deployment/k8s/tla-sample-backend/common/tla-sample-backend-service.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,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: tla-sample-backend | ||
labels: | ||
app: tla-sample-backend | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 8080 | ||
name: http | ||
targetPort: 8080 | ||
- port: 1044 | ||
name: debug | ||
targetPort: 1044 | ||
selector: | ||
app: tla-sample-backend |
7 changes: 7 additions & 0 deletions
7
deployment/k8s/tla-sample-backend/local/tla-sample-backend-env-config.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,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: tla-sample-backend-env-config | ||
data: | ||
DEBUG_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" | ||
JAVA_OPTS: "-Xmx1g -Xms1g -Dspring.profiles.active=local -DSpring.config.additional-location=file:/srv/web/conf/ -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.io.tmpdir=/srv/web/tmp" |
16 changes: 16 additions & 0 deletions
16
deployment/k8s/tla-sample-backend/local/tla-sample-backend-ingress.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,16 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: tla-sample-backend-ingress | ||
spec: | ||
rules: | ||
- host: tla-sample-app.contextmapper.org | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: tla-sample-backend | ||
port: | ||
number: 8080 |
9 changes: 9 additions & 0 deletions
9
deployment/k8s/tla-sample-backend/local/tla-sample-backend-secrets.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,9 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: tla-sample-backend-secrets | ||
type: Opaque | ||
data: | ||
SPRING_DATASOURCE_PASSWORD: aGVsbG8tdGxh | ||
|
||
# local PW: hello-tla |
10 changes: 10 additions & 0 deletions
10
deployment/k8s/tla-sample-db/common/tla-sample-db-config.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,10 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: tla-sample-db-config | ||
labels: | ||
app: tla-sample-db | ||
data: | ||
POSTGRES_DB: "tla-sample" | ||
POSTGRES_USER: "tla-sample" | ||
POSTGRES_SCHEMA: "public" |
10 changes: 10 additions & 0 deletions
10
deployment/k8s/tla-sample-db/common/tla-sample-db-data-pvc.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,10 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: tla-sample-db-data | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |
12 changes: 12 additions & 0 deletions
12
deployment/k8s/tla-sample-db/common/tla-sample-db-service.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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: tla-sample-db | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: tla-sample-db | ||
ports: | ||
- name: "5435" | ||
port: 5432 | ||
targetPort: 5432 |
34 changes: 34 additions & 0 deletions
34
deployment/k8s/tla-sample-db/common/tla-sample-db-statefulset.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,34 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: tla-sample-db | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: tla-sample-db | ||
serviceName: "tla-sample-db" | ||
template: | ||
metadata: | ||
labels: | ||
app: tla-sample-db | ||
spec: | ||
containers: | ||
- name: tla-sample-db | ||
image: postgres:16.2-alpine | ||
imagePullPolicy: "IfNotPresent" | ||
ports: | ||
- containerPort: 5432 | ||
envFrom: | ||
- configMapRef: | ||
name: tla-sample-db-config | ||
- secretRef: | ||
name: tla-sample-db-password-secret | ||
volumeMounts: | ||
- mountPath: /var/lib/postgresql/data | ||
name: tla-sample-db-data | ||
subPath: postgres | ||
volumes: | ||
- name: tla-sample-db-data | ||
persistentVolumeClaim: | ||
claimName: tla-sample-db-data |
9 changes: 9 additions & 0 deletions
9
deployment/k8s/tla-sample-db/local/tla-sample-db-secrets.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,9 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: tla-sample-db-password-secret | ||
type: Opaque | ||
data: | ||
POSTGRES_PASSWORD: aGVsbG8tdGxh | ||
|
||
# local PW: hello-tla |