Skip to content

Commit

Permalink
Add kustomize production patches
Browse files Browse the repository at this point in the history
  • Loading branch information
yingtingxu committed Jun 20, 2024
1 parent 845a1b8 commit 66f7aac
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Output the Kustomize result

```bash
cd ./staging
```

```bash
kubectl kustomize -o result.yml
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mall:
greeting: Welcome to the cloud native mall from a production Kubernetes environment!
spring:
config:
import: configtree:/workspace/secrets/*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- github.com/arch/cloud-native-mall/mall-catalog/k8s?ref=main

patches:
- path: patch-env.yml
- path: patch-volumes.yml
- path: patch-resources.yml

configMapGenerator:
- name: catalog-config
behavior: merge
files:
- application-prod.yml

images:
- name: mall-catalog
newName: ghcr.io/arch/mall-catalog
newTag: latest

replicas:
- name: catalog-service
count: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog-service
spec:
template:
spec:
containers:
- name: catalog-service
env:
- name: SPRING_PROFILES_ACTIVE
value: prod
- name: BPL_JVM_THREAD_COUNT
value: "100"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog-service
spec:
template:
spec:
containers:
- name: catalog-service
resources:
requests:
memory: 756Mi
cpu: "0.1"
limits:
memory: 756Mi
cpu: "2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog-service
spec:
template:
spec:
containers:
- name: catalog-service
volumeMounts:
- mountPath: /workspace/secrets/postgres
name: postgres-credentials-volume
- mountPath: /workspace/secrets/keycloak
name: keycloak-credentials-volume
volumes:
- name: postgres-credentials-volume
secret:
secretName: mall-postgres-catalog-credentials
- name: keycloak-credentials-volume
secret:
secretName: mall-keycloak-issuer-resourceserver-secret

0 comments on commit 66f7aac

Please sign in to comment.