Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set up abax-vwfs in new cluster #357

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stacks/abax-vwfs/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
environment:
- abax-vwfs-prod
config:
portal-image: europe-north1-docker.pkg.dev/branches-org-main/branches-org-main/abax-vwfs/portal
tag: main-3e4a710
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest that you move this to abax-vwfs-prod environment :)

Copy link
Member Author

@braaar braaar Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Even the tag?

host: abax-vwfs.branches.no
135 changes: 135 additions & 0 deletions stacks/abax-vwfs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: abax-vwfs
runtime: yaml
description: Abax-VWFS integration
config:
host:
type: string
portal-image:
type: string
tag:
type: string
resources:
namespace:
type: kubernetes:core/v1:Namespace
properties:
metadata:
name: ${pulumi.project}-${pulumi.stack}
database:
type: gcp:sql/database:Database
properties:
name: abax_vwfs
instance: ${database:instanceName}
databasePassword:
type: random:RandomPassword
properties:
length: 16
special: true
overrideSpecial: "_%@"
databaseUser:
type: gcp:sql/user:User
properties:
name: abax_vwfs
instance: ${database:instanceName}
password: ${databasePassword.result}
databaseSecret:
type: kubernetes:core/v1:Secret
properties:
metadata:
name: ${pulumi.project}-${pulumi.stack}-database
namespace: ${namespace.metadata.name}
stringData:
DATABASE_NAME: ${database.name}
DATABASE_USERNAME: ${databaseUser.name}
DATABASE_PASSWORD: ${databasePassword.result}
serviceAccount:
type: kubernetes:core/v1:ServiceAccount
properties:
metadata:
name: ${pulumi.project}-${pulumi.stack}
namespace: ${namespace.metadata.name}
annotations:
"iam.gke.io/gcp-service-account": ${database:serviceAccountEmail}
serviceAccountIamBinding:
type: gcp:serviceaccount:IAMBinding
properties:
serviceAccountId: ${database:serviceAccountId}
role: roles/iam.workloadIdentityUser
members:
- serviceAccount:${gcp:project}.svc.id.goog[${namespace.metadata.name}/${serviceAccount.metadata.name}]
deployment:
type: kubernetes:apps/v1:Deployment
properties:
metadata:
name: ${pulumi.project}-${pulumi.stack}
namespace: ${namespace.metadata.name}
annotations:
pulumi.com/skipAwait: "true"
pulumi.com/patchForce: "true"
spec:
replicas: 1
selector:
matchLabels: ${appLabels}
template:
metadata:
labels: ${appLabels}
spec:
serviceAccountName: ${serviceAccount.metadata.name}
nodeSelector:
"iam.gke.io/gke-metadata-server-enabled": "true"
containers:
- name: app
image: ${portal-image}:${tag}
ports:
- containerPort: 8484
envFrom:
- secretRef:
name: ${databaseSecret.metadata.name}
env:
- name: DATABASE_SSL
value: "false"
- name: HTTP_PORT
value: "8484"
- name: cloud-sql-proxy
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.8.0
args:
- --structured-logs=true
- --port=5432
- ${database:connectionName}
securityContext:
runAsNonRoot: true

service:
type: kubernetes:core/v1:Service
properties:
metadata:
name: ${pulumi.project}-${pulumi.stack}
namespace: ${namespace.metadata.name}
spec:
selector: ${appLabels}
ports:
- port: 5173
targetPort: 5173
ingress:
type: kubernetes:networking.k8s.io/v1:Ingress
properties:
metadata:
name: ${pulumi.project}-${pulumi.stack}
namespace: ${namespace.metadata.name}
annotations:
pulumi.com/skipAwait: "true"
kubernetes.io/ingress.class: "caddy"
spec:
rules:
- host: ${host}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ${pulumi.project}-${pulumi.stack}
port:
number: 5173
variables:
appLabels:
app: ${pulumi.project}-${pulumi.stack}
Loading