-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to set TopologySpreadConstraints via spec.deployments.topologySpreadConstraints
#1305
Conversation
Welcome @kahirokunn! It looks like this is your first PR to knative/operator 🎉 |
Hi @kahirokunn. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kahirokunn: 0 warnings.
In response to this:
Part of #1304
This patch adds
spec.deployments.topologySpreadConstraints
to set topologySpreadConstraints on each deployment.For example, when the following CR is created,
apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller
The webhook deployment has
spec.template.spec.topologySpreadConstraints
.$ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}]
Signed-off-by: kahirokunn okinakahiro@gmail.com
Fixes #
Proposed Changes
Release Note
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Which command updates |
/ok-to-test |
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@kahirokunn Try to fix the unit test issues. Make sure your code logic works. |
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@houshengbo I have accomplished everything you said. |
Codecov ReportBase: 79.61% // Head: 79.57% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1305 +/- ##
==========================================
- Coverage 79.61% 79.57% -0.04%
==========================================
Files 36 38 +2
Lines 1653 1738 +85
==========================================
+ Hits 1316 1383 +67
- Misses 244 257 +13
- Partials 93 98 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…SpreadConstraints` (knative#1305) Part of knative#1304 This patch adds `spec.deployments.topologySpreadConstraints` to set topologySpreadConstraints on each deployment. For example, when the following CR is created, ``` apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: ks namespace: knative-serving spec: high-availability: replicas: 1 deployments: - name: webhook topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: controller ``` The webhook deployment has `spec.template.spec.topologySpreadConstraints`. ``` $ kubectl get deploy webhook -o jsonpath={.spec.template.spec.topologySpreadConstraints} [{"labelSelector":{"matchLabels":{"app":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"DoNotSchedule"}] ``` Signed-off-by: kahirokunn <okinakahiro@gmail.com>
@houshengbo Thx for your review. |
/test serving-upgrade-tests |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: houshengbo, kahirokunn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Part of #1304
This patch adds
spec.deployments.topologySpreadConstraints
to set topologySpreadConstraints on each deployment.For example, when the following CR is created,
The webhook deployment has
spec.template.spec.topologySpreadConstraints
.