我是 Kustomize 的新手,我想知道:
- 如何在特定的 yaml 中“修补”metadata.name,例如:RedisInstance。
我尝试将 nameSuffix 设置为特定的 yaml(种类:RedisInstance),但没有成功。
自定义.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: community-organization-uat-product
bases:
- ../../../../common/base/custom/gcp
- ../../../../common/base/custom/gcp/organization
commonAnnotations:
cnrm.cloud.google.com/managed: "true"
cnrm.cloud.google.com/project-id: community-organization-uat-product
patchesStrategicMerge:
- 1-cXXXXX-patch.yaml
- 3-mXXXXX-patch.yaml
- 4-mXXXXX-patch.yaml
- 5-cXXXXX-patch.yaml
- 6-mXXXXX-patch.yaml
- 7-memorystore-patch.yaml
这是我的补丁:
7-memorystore-patch.yaml
apiVersion: redis.cnrm.cloud.google.com/v1beta1
kind: RedisInstance
metadata:
name: memorystore-redis
spec:
displayName: memorystore-redis-organization-community-uat
memorySizeGb: 2
redisVersion: REDIS_5_0
reservedIpRange: 10.1XXXXX/29
memorystore.yaml
apiVersion: redis.cnrm.cloud.google.com/v1beta1
kind: RedisInstance
metadata:
name: memorystore-redis
spec:
displayName: Value defined by Kustomize
region: XXXX
connectMode: PRIVATE_SERVICE_ACCESS
locationId: usXXXX
memorySizeGb: Value defined by Kustomize
redisVersion: REDIS_5_0
reservedIpRange: Value defined by Kustomize
tier: BASIC