Skip to content

Commit

Permalink
replace patchesStrategicMerge with patches (GoogleCloudPlatform#1689)
Browse files Browse the repository at this point in the history
* replace patchesStrategicMerge with patches
* chore: fix inline patching syntax

---------

Co-authored-by: minherz <[email protected]>
  • Loading branch information
smeet07 and minherz authored Apr 19, 2023
1 parent 5462a7f commit bf30937
Show file tree
Hide file tree
Showing 11 changed files with 459 additions and 460 deletions.
86 changes: 43 additions & 43 deletions kustomize/components/alloydb/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,52 @@

apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patchesStrategicMerge:
patches:
# cartservice - replace REDIS_ADDR by ALLOYDB_PRIMARY_IP for the cartservice Deployment
# Potentially later we'll factor in splitting traffic to primary/read pool, but for now
# we'll just manage the primary instance
- |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: cartservice
spec:
template:
spec:
containers:
- name: server
env:
- name: REDIS_ADDR
$patch: delete
- name: ALLOYDB_PRIMARY_IP
value: ALLOYDB_PRIMARY_IP_VAL
- name: ALLOYDB_DATABASE_NAME
value: ALLOYDB_DATABASE_NAME_VAL
- name: ALLOYDB_TABLE_NAME
value: ALLOYDB_TABLE_NAME_VAL
- name: ALLOYDB_SECRET_NAME
value: ALLOYDB_SECRET_NAME_VAL
- name: PROJECT_ID
value: PROJECT_ID_VAL
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: cartservice
spec:
template:
spec:
containers:
- name: server
env:
- name: REDIS_ADDR
$patch: delete
- name: ALLOYDB_PRIMARY_IP
value: ALLOYDB_PRIMARY_IP_VAL
- name: ALLOYDB_DATABASE_NAME
value: ALLOYDB_DATABASE_NAME_VAL
- name: ALLOYDB_TABLE_NAME
value: ALLOYDB_TABLE_NAME_VAL
- name: ALLOYDB_SECRET_NAME
value: ALLOYDB_SECRET_NAME_VAL
- name: PROJECT_ID
value: PROJECT_ID_VAL
# cartservice - add the GSA annotation for the cartservice KSA
- |-
apiVersion: v1
kind: ServiceAccount
metadata:
name: cartservice
annotations:
iam.gke.io/gcp-service-account: ALLOYDB_USER_GSA_ID
- patch: |-
apiVersion: v1
kind: ServiceAccount
metadata:
name: cartservice
annotations:
iam.gke.io/gcp-service-account: ALLOYDB_USER_GSA_ID
# redis - remove the redis-cart Deployment
- |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-cart
$patch: delete
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-cart
$patch: delete
# redis - remove the redis-cart Service
- |-
apiVersion: v1
kind: Service
metadata:
name: redis-cart
$patch: delete
- patch: |-
apiVersion: v1
kind: Service
metadata:
name: redis-cart
$patch: delete
21 changes: 10 additions & 11 deletions kustomize/components/cymbal-branding/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@

apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patchesStrategicMerge:
# frontend - enable CYMBAL_BRANDING
- |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
template:
spec:
containers:
patches:
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
template:
spec:
containers:
- name: server
env:
- name: CYMBAL_BRANDING
Expand Down
Loading

0 comments on commit bf30937

Please sign in to comment.