The command:
kubectl apply view-last-applied -f object.yml
displays the latest applied configuration file of an object.
Does a command exist that gives the entire 'applied' history of a given object?
For example, given the created configuration (using kubectl create -f pod.spec --save-config
):
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
and the applied configurations (using kubectl apply -f pod.spec
):
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9
revision 2:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9.1
the command should give:
$ kubectl appy log -f pod.spec
applied <later date>:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9.1
applied <earlier date>:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9
No, only the latest applied configuration is persisted in the object