Skip to content

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Mar 23, 2021

This PR implements NE-546.

  • operator/v1/types_dns.go (DNSSpec): Add NodePlacement field with type DNSNodePlacement.
    (DNSNodePlacement): New type. Specify optional node selector and tolerations for DNS pods.
  • operator/v1/0000_70_dns-operator_00-custom-resource-definition.yaml:
  • operator/v1/zz_generated.deepcopy.go:
  • operator/v1/zz_generated.swagger_doc_generated.go: Regenerate.

@Miciah Miciah force-pushed the NE-546-operator-slash-dns-add-DNS-pod-placement-API branch from 81b52c4 to 1c71dba Compare March 25, 2021 14:28
type DNSNodePlacement struct {
// nodeSelector is the node selector applied to DNS pods.
//
// If unset, the default is the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indicate that this default may change over time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't foresee its changing, but I'll add a comment to leave us the option to do so.

// +optional
Servers []Server `json:"servers,omitempty"`

// nodePlacement provides explicit control over the scheduling of DNS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you provide examples of why this may be needed and the tradeoffs such a change will bring?

Off the top of my head, this has the potential to negatively impact availability by not having a local DNS authority on each node. I could see a reason for doing this as some kind of corporate standard that wishes to restrict where DNS pods may land in a datacenter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the top of your head is right. Not having a local pod has its drawbacks, but some users really don't want DNS on certain nodes, for security or compliance reasons. I'll add a comment to that effect.

// If set, the specified selector is used and replaces the default.
//
// +optional
NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure that pods are still restricted by NodeSelector map[string]string . I suggest having this match that schema even though it is an older style selector.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use metav1.LabelSelector for the IngressController API, so that puts us in a slightly icky place:

// nodeSelector is the node selector applied to ingress controller
// deployments.
//
// If unset, the default is:
//
// beta.kubernetes.io/os: linux
// node-role.kubernetes.io/worker: ''
//
// If set, the specified selector is used and replaces the default.
//
// +optional
NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"`

But I guess it's better to do the right thing here than to be consistent with a bad API, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I guess it's better to do the right thing here than to be consistent with a bad API, right?

I think so. I would like to avoid the ability to have incompatible data if possible. I should have caught it in that operator too.

@Miciah Miciah force-pushed the NE-546-operator-slash-dns-add-DNS-pod-placement-API branch from 1c71dba to c69b45a Compare March 25, 2021 15:57
This commit implements NE-546.

https://issues.redhat.com/browse/NE-546

* operator/v1/types_dns.go (DNSSpec): Add NodePlacement field with type
DNSNodePlacement.
(DNSNodePlacement): New type.  Specify optional node selector and
tolerations for DNS pods.
* operator/v1/0000_70_dns-operator_00-custom-resource-definition.yaml:
* operator/v1/zz_generated.deepcopy.go:
* operator/v1/zz_generated.swagger_doc_generated.go: Regenerate.
@Miciah Miciah force-pushed the NE-546-operator-slash-dns-add-DNS-pod-placement-API branch from c69b45a to 4a0c62d Compare March 25, 2021 16:26
@deads2k
Copy link
Contributor

deads2k commented Mar 25, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 25, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, Miciah

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants