Skip to content
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

add: specific selector for operator #390

Merged
merged 7 commits into from
Jan 27, 2023

Conversation

codekow
Copy link
Contributor

@codekow codekow commented Jan 14, 2023

Issue #, if available: #1632

Description of changes:

Improve label selection for service and deployment association with pods. When multiple operators are deployed you may get inconsistent results on the service.

Related s3-controller/pull/94

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-bot ack-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 14, 2023
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 14, 2023

Hi @codekow. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@codekow
Copy link
Contributor Author

codekow commented Jan 14, 2023

Addresses aws-controllers-k8s/community#1632

@codekow
Copy link
Contributor Author

codekow commented Jan 15, 2023

See https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels

Considering above, I have updated the minimal labels to get basic selection functionality without removing any existing labels.

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

One tiny request otherwise I dig it. :)

templates/config/controller/deployment.yaml.tpl Outdated Show resolved Hide resolved
Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Also, one other thing, @codekow: we have corresponding Helm templates in templates/helm too.

@acornett21
Copy link
Contributor

I'd like to see the deployment.label section of the CSV that's output for the S3 (or any other controller).

The below will generate a file at ..olm/bundle/manifests/ack-s3-controller.clusterserviceversion.yaml in the S3 controller.

export SERVICE=s3
ACK_GENERATE_OLM=true make build-controller SERVICE=$SERVICE

I don't think we have any post hocks to change this, but I'd like to be certain.

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

👍

@codekow
Copy link
Contributor Author

codekow commented Jan 18, 2023

export SERVICE=s3
ACK_GENERATE_OLM=true make build-controller SERVICE=$SERVICE

Checking ..olm/bundle/manifests/ack-s3-controller.clusterserviceversion.yaml...

spec:
  install:
    spec:
      deployments:
      - label:
          app.kubernetes.io/name: ack-s3-controller
          app.kubernetes.io/part-of: ack-system
          control-plane: controller
        name: ack-s3-controller
        spec:
          replicas: 1
          selector:
            matchLabels:
              app.kubernetes.io/name: ack-s3-controller
              control-plane: controller
          strategy: {}
          template:
            metadata:
              labels:
                app.kubernetes.io/name: ack-s3-controller
                control-plane: controller

@codekow
Copy link
Contributor Author

codekow commented Jan 18, 2023

FYI @acornett21 ^^

@codekow
Copy link
Contributor Author

codekow commented Jan 18, 2023

Do we want to leave the label: control-plane: controller?

@jaypipes @acornett21

@jaypipes
Copy link
Collaborator

Do we want to leave the label: control-plane: controller?

@jaypipes @acornett21

We don't need to, no. I put that on there originally when I copied some stuff from the node-termination-handler project. I think that label is no longer used by anything.

@acornett21
Copy link
Contributor

Do we want to leave the label: control-plane: controller?

@jaypipes @acornett21

I pretty sure no project that's dependent on ACK in OpenShift uses this label, so I'm fine removing it as well.

@codekow
Copy link
Contributor Author

codekow commented Jan 18, 2023

@jaypipes @acornett21

Old label removed. I believe the merge is ready. Let me know if there is anything else to resolve with this PR.

Thanks for your help! 😄

@RedbackThomson
Copy link
Contributor

@codekow I just reopened a comment regarding the namespace annotation. I know there was some disagreement, but I feel relatively strongly that it's not the right move for now. I'd also rather leave it off, and add it later, than have an annotation that we need to support for backward compatibility sake.

@codekow
Copy link
Contributor Author

codekow commented Jan 25, 2023

@jaypipes @a-hilaly @RedbackThomson

I believe all discussed items have been addressed. The PR should be ready to test.

@a-hilaly
Copy link
Member

/ok-to-test

@ack-bot ack-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 25, 2023
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

++ Thank you @codekow !

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Nice stuff here, let's get this merged! :)

@RedbackThomson
Copy link
Contributor

Great. Thank you!
/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2023
@ack-bot
Copy link
Collaborator

ack-bot commented Jan 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, acornett21, codekow, jaypipes, RedbackThomson

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:
  • OWNERS [A-Hilaly,RedbackThomson]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit 6713768 into aws-controllers-k8s:main Jan 27, 2023
@codekow codekow deleted the update-selector branch January 27, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants