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 optional parameter extra_groups for k8s_nodes in openstack terraform #9211

Conversation

rptaylor
Copy link
Contributor

@rptaylor rptaylor commented Aug 24, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:
Expand the ad-hoc k8s_nodes definitions with an optional parameter that allows specifying additional Ansible group memberships for specific nodes.
This can be used to e.g. create special nodes for calico route reflector in the calico_rr group.

Special notes for your reviewer:

Does this PR introduce a user-facing change?:
No. Default behaviour remains unchanged. However users may wish to know:

Add an optional extra_groups parameter for k8s_nodes (e.g. to configure calico route reflector nodes on Openstack using the calico_rr group)

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 24, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @rptaylor. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 24, 2022
@rptaylor
Copy link
Contributor Author

rptaylor commented Aug 24, 2022

My tests show that it works. By default there is no change. Here is the output from terraform plan when I defined extra_groups:

 # module.compute.openstack_compute_instance_v2.k8s_nodes["a-3"] will be updated in-place
  ~ resource "openstack_compute_instance_v2" "k8s_nodes" {
        id                  = "219c702c-30d8-4ba0-919c-bf28025ef68b"
      ~ metadata            = {
          ~ "kubespray_groups" = "kube_node,k8s_cluster,no_floating," -> "kube_node,k8s_cluster,no_floating,TEST1,TEST2"
            # (3 unchanged elements hidden)
        }
        name                = "cluster-dev-k8s-node-a-3"
        tags                = []
        # (14 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

@rptaylor
Copy link
Contributor Author

@holmsten @liupeng0518 could you please take a look?
Thanks.

@cristicalin
Copy link
Contributor

Hi @rptaylor , please rebase this PR on latest state of the master branch to be able to pass the CI tests.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 30, 2022
@rptaylor rptaylor force-pushed the 20220823-extra-groups-for-k8s_nodes branch from 59b7e32 to 04d8c33 Compare August 30, 2022 18:23
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 30, 2022
@rptaylor rptaylor force-pushed the 20220823-extra-groups-for-k8s_nodes branch from 04d8c33 to afcfd23 Compare August 30, 2022 18:25
@rptaylor
Copy link
Contributor Author

@cristicalin I rebased and the tests are passing.

@oomichi
Copy link
Contributor

oomichi commented Sep 6, 2022

/ok-to-test
/lgtm

@k8s-ci-robot k8s-ci-robot 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 Sep 6, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 6, 2022
@rptaylor
Copy link
Contributor Author

rptaylor commented Sep 12, 2022

/assign @holmsten
can this be merged now?
@cristicalin

Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

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

@rptaylor All good, sorry for the lag 👍

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, rptaylor

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5bce39a into kubernetes-sigs:master Sep 13, 2022
@rptaylor rptaylor deleted the 20220823-extra-groups-for-k8s_nodes branch September 13, 2022 15:20
@floryut floryut mentioned this pull request Sep 19, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants