示例代码:
Kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
images:
- name: myapp-image
newName: my-registry/myapp
newTag: latest
digest: ""
Deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: myapp
name: myapp
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- image: my-registry/myapp:latest # Notice that it matches the `newName` field in Kustomization.yaml
name: myapp