-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
to make it much more easy to start with local development in an kubernetes cluster environment which is a large shift left and improves developer expirience Signed-off-by: Manuel Ruck <[email protected]>
- Loading branch information
Showing
93 changed files
with
1,851 additions
and
234 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ docker_volumes | |
.turbo | ||
.github | ||
build | ||
dist | ||
dist | ||
manifests | ||
.garden |
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 @@ | ||
*.log | ||
/data/ | ||
.vs | ||
node_modules | ||
.github/workflows/*.env | ||
infra/*.yaml | ||
configuration/* | ||
!configuration/*.example | ||
docker_volumes/*/* | ||
!/**/.gitkeep | ||
/services/cron-jobs/push-send-queued/.env | ||
.turbo | ||
out | ||
build | ||
/.env | ||
manifests |
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ docker_volumes/*/* | |
.turbo | ||
out | ||
build | ||
/.env | ||
/.env | ||
.garden |
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 |
---|---|---|
|
@@ -4,4 +4,6 @@ logs | |
.env* | ||
.next | ||
*.log | ||
.turbo | ||
.turbo | ||
manifests | ||
.garden |
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,41 @@ | ||
kind: Build | ||
name: admin | ||
description: Admin | ||
type: container | ||
source: | ||
path: ../../ | ||
include: | ||
- ./**/* | ||
- ./infra/Dockerfile.service | ||
spec: | ||
dockerfile: ./infra/Dockerfile.service | ||
buildArgs: | ||
NODE_VERSION: 18.18.2 | ||
SERVICE: bundestag.io-admin | ||
SERVICE_PATH: bundestag.io/admin | ||
|
||
--- | ||
kind: Deploy | ||
name: admin | ||
type: kubernetes | ||
description: Deploy the Admin | ||
dependencies: [build.admin, deploy.bundestag-io-api] | ||
|
||
spec: | ||
files: [./manifests/*] # <--- Tell Garden what manifests to use | ||
|
||
defaultTarget: # <--- This tells Garden what "target" to use for logs, code syncing and more | ||
kind: Deployment | ||
name: admin | ||
|
||
# Patch the K8s manifests for the api service so that we can set the correct image | ||
patchResources: | ||
- name: admin | ||
kind: Deployment | ||
patch: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: admin | ||
image: ${actions.build.admin.outputs.deploymentImageId} # <--- Reference the output from the Build action |
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: Deployment | ||
metadata: | ||
name: admin | ||
labels: | ||
app: admin | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: admin | ||
template: | ||
metadata: | ||
labels: | ||
app: admin | ||
spec: | ||
containers: | ||
- name: admin | ||
image: democracy/bundestag.io-admin:3.2.0 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: PORT | ||
value: '4003' | ||
ports: | ||
- containerPort: 4003 | ||
name: http | ||
protocol: TCP | ||
resources: | ||
limits: | ||
cpu: '1' | ||
memory: 1Gi | ||
requests: | ||
cpu: 10m | ||
memory: 90Mi |
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,19 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: admin | ||
labels: | ||
app: admin | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: 'admin.${var.hostname}' | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: admin | ||
port: | ||
number: 80 | ||
path: / | ||
pathType: Prefix |
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,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: admin | ||
name: admin | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 4003 | ||
selector: | ||
app: admin |
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 |
---|---|---|
|
@@ -5,3 +5,6 @@ logs | |
build | ||
*.log | ||
docker-compose* | ||
manifests | ||
.garden | ||
.turbo |
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,51 @@ | ||
kind: Build | ||
name: bundestag-io-api | ||
description: Bundestag.io API | ||
type: container | ||
source: | ||
path: ../../ | ||
include: | ||
- ./**/* | ||
- ./infra/Dockerfile.service | ||
spec: | ||
dockerfile: ./infra/Dockerfile.service | ||
targetStage: | ||
$if: ${this.mode == "sync"} | ||
$then: dev | ||
$else: runner | ||
buildArgs: | ||
NODE_VERSION: 18.18.2 | ||
SERVICE: bundestag.io | ||
SERVICE_PATH: bundestag.io/api | ||
|
||
--- | ||
kind: Deploy | ||
name: bundestag-io-api | ||
type: kubernetes | ||
description: Deploy the bundestag.io API | ||
dependencies: [build.bundestag-io-api, deploy.mongo] | ||
|
||
spec: | ||
files: [./manifests/*] # <--- Tell Garden what manifests to use | ||
|
||
defaultTarget: # <--- This tells Garden what "target" to use for logs, code syncing and more | ||
kind: Deployment | ||
name: bundestag-io-api | ||
|
||
sync: | ||
paths: | ||
- containerPath: /app/bundestag.io/api/src | ||
sourcePath: src | ||
mode: one-way | ||
|
||
# Patch the K8s manifests for the api service so that we can set the correct image | ||
patchResources: | ||
- name: bundestag-io-api | ||
kind: Deployment | ||
patch: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: bundestag-io-api | ||
image: ${actions.build.bundestag-io-api.outputs.deploymentImageId} # <--- Reference the output from the Build action |
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,36 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: bundestag-io-api | ||
labels: | ||
app: bundestag-io-api | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: bundestag-io-api | ||
template: | ||
metadata: | ||
labels: | ||
app: bundestag-io-api | ||
spec: | ||
containers: | ||
- name: bundestag-io-api | ||
image: democracy/bundestag.io:0.1.58 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: PORT | ||
value: '4000' | ||
- name: DB_URL | ||
value: mongodb://democracy-mongo:27017/bundestagio | ||
ports: | ||
- containerPort: 4000 | ||
name: http | ||
protocol: TCP | ||
resources: | ||
limits: | ||
cpu: '1' | ||
memory: 1Gi | ||
requests: | ||
cpu: 10m | ||
memory: 90Mi |
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,19 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: bundestag-io-api | ||
labels: | ||
app: bundestag-io-api | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: 'bundestag-io-api.${var.hostname}' | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: bundestag-io-api | ||
port: | ||
number: 80 | ||
path: / | ||
pathType: Prefix |
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,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: bundestag-io-api | ||
name: bundestag-io-api | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 4000 | ||
selector: | ||
app: bundestag-io-api |
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,6 @@ | ||
kind: Deploy | ||
name: democracy-api | ||
type: kubernetes | ||
spec: | ||
files: | ||
- ./manifests/* |
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,14 @@ | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: democracy-api-config | ||
data: | ||
BUNDESTAGIO_SERVER_URL: http://bundestagio-srv:3100/ | ||
DB_URL: mongodb://democracy-mongo:27017/democracy | ||
DEBUG: "true" | ||
GRAPHIQL: "true" | ||
NODE_ENV: development | ||
SMS_SIMULATE: "true" | ||
SMS_VERIFICATION: "false" | ||
STAGE: internal |
Oops, something went wrong.