apiVersion: v1
kind: xxx
spec:
name: "AAA"
```
upgrade to:
``` /xxx/api
apiVersion: v2
kind: xxx
spec:
name2: "BBB" # name change to name2
```
2) But if etcd has old data, how to upgrade old data in etcd? For example:
If I have already run v1 api in long time, etcd has these data:
```
/xxx/api
{"apiVersion": "v1", "kind": "xxx", "spec": {"name": "A1"}}
{"apiVersion": "v1", "kind": "xxx", "spec": {"name": "A2"}}
{"apiVersion": "v1", "kind": "xxx", "spec": {"name": "A3"}}
```
after upgrade, api v2 use name2 as key, so new api will write etcd like this:
```
/xxx/api
{"apiVersion": "v1", "kind": "xxx", "spec": {"name2": "B1"}}
```
But how about old data, I still need to use these old data, so I want data in etcd like this:
```
/xxx/api
{"apiVersion": "v1", "kind": "xxx", "spec": {"name2": "A1"}}
{"apiVersion": "v1", "kind": "xxx", "spec": {"name2": "A2"}}
{"apiVersion": "v1", "kind": "xxx", "spec": {"name2": "A3"}}
{"apiVersion": "v1", "kind": "xxx", "spec": {"name2": "B1"}} # this is new v2 api added
```
3) So does kube-apiserver support this function?
If it is, 1) where is the code? 2) how to do when upgrade, for example, need to write upgrade script?
If it is NOT, 1) why? 2) If I really need to upgrade api version to do these things like above, how to do? For example, how to write new yaml file?
Thank you ~