commit
f7b3b67b87
|
@ -366,12 +366,26 @@ There are two solutions:
|
||||||
|
|
||||||
First, the user defines a new configuration containing only the `replicas` field:
|
First, the user defines a new configuration containing only the `replicas` field:
|
||||||
|
|
||||||
{{< codenew file="application/ssa/nginx-deployment-replicas-only.yaml" >}}
|
```yaml
|
||||||
|
# Save this file as 'nginx-deployment-replicas-only.yaml'.
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< note >}}
|
||||||
|
The YAML file for SSA in this case only contains the fields you want to change.
|
||||||
|
You are not supposed to provide a fully compliant Deployment manifest if you only
|
||||||
|
want to modify the `spec.replicas` field using SSA.
|
||||||
|
{{< /note >}}
|
||||||
|
|
||||||
The user applies that configuration using the field manager name `handover-to-hpa`:
|
The user applies that configuration using the field manager name `handover-to-hpa`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl apply -f https://k8s.io/examples/application/ssa/nginx-deployment-replicas-only.yaml \
|
kubectl apply -f nginx-deployment-replicas-only.yaml \
|
||||||
--server-side --field-manager=handover-to-hpa \
|
--server-side --field-manager=handover-to-hpa \
|
||||||
--validate=false
|
--validate=false
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: nginx-deployment
|
|
||||||
labels:
|
|
||||||
app: nginx
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: nginx
|
|
||||||
replicas: 3
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: nginx
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: nginx
|
|
||||||
image: nginx:1.14.2
|
|
|
@ -517,9 +517,8 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||||
"nginx-svc": {&api.Service{}},
|
"nginx-svc": {&api.Service{}},
|
||||||
},
|
},
|
||||||
"application/ssa": {
|
"application/ssa": {
|
||||||
"nginx-deployment": {&apps.Deployment{}},
|
"nginx-deployment": {&apps.Deployment{}},
|
||||||
"nginx-deployment-no-replicas": {&apps.Deployment{}},
|
"nginx-deployment-no-replicas": {&apps.Deployment{}},
|
||||||
"nginx-deployment-replicas-only": {&apps.Deployment{}},
|
|
||||||
},
|
},
|
||||||
"application/web": {
|
"application/web": {
|
||||||
"web": {&api.Service{}, &apps.StatefulSet{}},
|
"web": {&api.Service{}, &apps.StatefulSet{}},
|
||||||
|
|
Loading…
Reference in New Issue