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

[Issue-7956] - [Digital Ocean] Minor fix to have proper indexing for digital ocean regions #8002

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

srikiz
Copy link
Contributor

@srikiz srikiz commented Nov 25, 2019

Found an issue where regions ending with characters other than "1" like sfo2 had problems with etcdmanager.
The index was set to 2 instead of 1 because of the way we are currently trimming in https://github.com/kubernetes/kops/blob/master/cmd/kops/create_cluster.go#L802
Since this is a common code, I added special check for DO to use the logic differently that suits DO.
You now see the instanceGroup as below and the name is properly set to "1" instead of "2".

` configBase: do://sri-kops-space/dev5.techthreads.co.in
etcdClusters:

  • cpuRequest: 200m
    etcdMembers:
    • instanceGroup: master-sfo2-1
      name: "1"
      memoryRequest: 100Mi
      name: main
  • cpuRequest: 100m
    etcdMembers:
    • instanceGroup: master-sfo2-1
      name: "1"
      memoryRequest: 100Mi
      name: events
      `

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 25, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @srikiz. Thanks for your PR.

I'm waiting for a kubernetes 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 25, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 25, 2019
@srikiz
Copy link
Contributor Author

srikiz commented Nov 25, 2019

FYI - @timoreimann @prksu - please have a look when you get a chance. Thanks !

@prksu
Copy link
Contributor

prksu commented Nov 25, 2019

@srikiz i have a similar approach with you.
but i curious why we only give number prefix when masterCount grather than masterZones 🤔

/ok-to-test

@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 Nov 25, 2019
@srikiz
Copy link
Contributor Author

srikiz commented Nov 25, 2019

@srikiz i have a similar approach with you.

but i curious why we use a trimmed name that leaves one character from the end of the actual name for etcd-member. i think using the name of the instance group without the master- prefix is quite short.

Yeah - But it looks like the trimCommonPrefix removes the common prefix in comparing with the specific array. Since we had only one element in the masterCount, it just removes everything except the last character.
Ex input and output from https://github.com/kubernetes/kops/blob/master/cmd/kops/createcluster_test.go below :

Input:  []string{"us-test-1a-1", "us-test-1b-1", "us-test-1a-2", "us-test-1b-2", "us-test-1a-3"},
Output: []string{"a-1", "b-1", "a-2", "b-2", "a-3"},

I think from DO perspective, what we have is Ok, since we are actually using the name as the etcd-index for the master.

@srikiz
Copy link
Contributor Author

srikiz commented Nov 25, 2019

@srikiz i have a similar approach with you.
but i curious why we only give number prefix when masterCount grather than masterZones 🤔

/ok-to-test

We are currently doing this if we have multiple masters in a given region.
This is one of the new additions to DO (I haven't added as part of the read me guide yet about the multiple master support - Though it works well, we need to manually add the load balancer currently. I'll be updating to include a DO load balancer via KOPS create command sooner).
Creation of a multi-master cluster in DO would look something like this. This would create 3 masters in the same zone - sfo2 as below

./kops create cluster --cloud=digitalocean --name=dev3.k8s.local --master-count=3 --networking=cilium --zones=sfo2 --ssh-public-key=~/.ssh/id_rsa.pub -v 10 --yes

  etcdClusters:
  - cpuRequest: 200m
    etcdMembers:
    - instanceGroup: master-sfo2-1
      name: "1"
    - instanceGroup: master-sfo2-2
      name: "2"
    - instanceGroup: master-sfo2-3
      name: "3"
    memoryRequest: 100Mi
    name: main
  - cpuRequest: 100m
    etcdMembers:
    - instanceGroup: master-sfo2-1
      name: "1"
    - instanceGroup: master-sfo2-2
      name: "2"
    - instanceGroup: master-sfo2-3
      name: "3"
    memoryRequest: 

@prksu
Copy link
Contributor

prksu commented Nov 26, 2019

fixes #7956
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 26, 2019
Copy link
Member

@zetaab zetaab left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: srikiz, zetaab

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 Dec 5, 2019
@k8s-ci-robot k8s-ci-robot merged commit e11f394 into kubernetes:master Dec 5, 2019
@srikiz srikiz deleted the DO-7956-FixEtcdNameLogic branch December 5, 2019 16:14
k8s-ci-robot added a commit that referenced this pull request May 23, 2020
…pstream-release-1.17

Automated cherry pick of #8002: Minor fix to have proper indexing for digital ocean
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. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants