i have a base yaml and an overlay yaml and using "kustomize" i want to merge these two yaml. what happens with me is that on running kustomize build there comes an output but it is not expected why? because the kustomize instead of filling the custom information from the overlay yaml replaces the whole heading tag of the base with the overlay "containers" in my case. The intended behaviour that i need is the it should somehow fill in the missing information using the overlay yaml instead of replacement.
base yaml:
apiVersion: v1
kind: Pod
metadata:
name: temp
labels:
tier: temp
spec:
containers:
- name: temp
image: temp
imagePullPolicy: Always
command: temp
args:
temp
envFrom:
- configMapRef:
name: temp
volumeMounts:
volumes:
overlay yaml:
apiVersion: v1
kind: Pod
metadata:
name: temp
labels:
tier: temp
spec:
containers:
volumeMounts:
- name: temppathname
mountPath: /temppath
volumes:
- name: temppathname
hostPath:
type: temp
path: temppath
Expected result after kustomize build:
apiVersion: v1
kind: Pod
metadata:
name: temp
labels:
tier: temp
spec:
containers:
- name: temp
image: temp
imagePullPolicy: Always
command: temp
args:
["sleep 9000"]
envFrom:
- configMapRef:
name: temp
volumeMounts:
- name: temppathname
mountPath: /temppath
volumes:
- name: temppathname
hostPath:
type: temp
path: temppath
what i'm getting:
apiVersion: v1
kind: Pod
metadata:
labels:
tier: temp
name: temp
spec:
containers:
volumeMounts:
- name: temppathname
mountPath: /temppath
volumes:
- name: temppathname
hostPath:
type: temp
path: temppath