Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Add support for Scaleway in etcd-manager #336

Merged
merged 8 commits into from
Sep 5, 2022

Conversation

Mia-Cross
Copy link
Contributor

As we are currently working on adding support for Scaleway in kOps, we also need etcd-manager to have a Scaleway volume provider.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 26, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 26, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 26, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @Mia-Cross!

It looks like this is your first PR to kubernetes-sigs/etcdadm 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/etcdadm has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Aug 26, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @Mia-Cross. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 26, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 26, 2022
@@ -0,0 +1,19 @@
FROM golang:1.19-buster

Choose a reason for hiding this comment

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

Why is this file required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only for dev purposes, it won't go in the final PR. I need it to be able to build an image containing both etcd-manager executable and sh since the command launching the etcd-manager image is generated by kops (hard to modify) and is in the form of /bin/sh -c exec /etcd-manager [arguments]

Choose a reason for hiding this comment

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

Maybe it could be contributed in a different PR to etcdmanager? Maybe other people would benefit from it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to move away from Bazel builds in the near future. The effort required is a little bigger, as etcd-manager requires the etcd binaries for the supported versions.

Choose a reason for hiding this comment

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

Quite happy with the ko-based builds we have for kops. Putting in the etcd versions as static files should not be too hard.

${BAZEL} build ${BAZEL_FLAGS} --platforms=@io_bazel_rules_go//go/toolchain:linux_$* //cmd/etcd-manager:etcd-manager

.PHONY: push-etcd-manager
push-etcd-manager:
${BAZEL} run ${BAZEL_FLAGS} --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:push-etcd-manager
${BAZEL} run ${BAZEL_FLAGS} --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64 //images:push-etcd-manager
echo $(REGISTRY_NAME)

Choose a reason for hiding this comment

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

Why is this change required?

Copy link
Contributor Author

@Mia-Cross Mia-Cross Aug 26, 2022

Choose a reason for hiding this comment

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

The echo is not required indeed and was only used for debugging a script I was making which purpose was to build and push to the registry all the images needed by kOps across several repositories.
If you're talking about why I got rid of the Bazel commands it's because they required me to write BUILD.bazel files for the sdk and it seemed like a lot of work that I was not sure was going to pay at the time. But now that I know that it works, I will eventually need to write these Bazel files.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Mia-Cross The The BUILD.bazel files are auto-generated by running make vendor.

etcd-manager/cmd/etcd-manager/main.go Outdated Show resolved Hide resolved
etcd-manager/cmd/etcd-manager/main.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/discovery.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/discovery.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
@hakman
Copy link
Contributor

hakman commented Aug 26, 2022

/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 Aug 26, 2022
etcd-manager/Dockerfile Outdated Show resolved Hide resolved
etcd-manager/Makefile Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/discovery.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/discovery.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/discovery.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
etcd-manager/pkg/volumes/scaleway/volumes.go Outdated Show resolved Hide resolved
@justinsb
Copy link
Contributor

justinsb commented Sep 1, 2022

I did a pass over the go code and it looks good - a few style points, but more just FYI, nothing blocking.

/ok-to-test

@Mia-Cross Mia-Cross marked this pull request as ready for review September 5, 2022 11:38
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 5, 2022
Copy link

@olemarkus olemarkus left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Mia-Cross, olemarkus

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 5, 2022
@@ -46,7 +46,7 @@ build-etcd-manager-amd64 build-etcd-manager-arm64: build-etcd-manager-%:
.PHONY: push-etcd-manager
push-etcd-manager:
${BAZEL} run ${BAZEL_FLAGS} --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:push-etcd-manager
${BAZEL} run ${BAZEL_FLAGS} --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64 //images:push-etcd-manager
${BAZEL} run ${BAZEL_FLAGS} --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64 //images:push-etcd-manager

Choose a reason for hiding this comment

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

Why is this change needed?

}
serverPrivateIP := server.Server.PrivateIP

klog.V(2).Infof("Discovered volume %s(%d) of type %s attached to server %s(%d)", volume.Name, volume.ID, volume.VolumeType, server.Server.Name, serverID)

Choose a reason for hiding this comment

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

This line of logs does not use the serverPrivateIP defined on top of it. Maybe it should merged with the other log info line on top.

// We use the etcd node ID as the persistent identifier, because the data determines who we are
node := discovery.Node{
ID: "vol-" + volume.ID,
Endpoints: []discovery.NodeEndpoint{{IP: *serverPrivateIP}},

Choose a reason for hiding this comment

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

We don't use this variable anywhere else in the function. Maybe having server.Server.PrivateIP could be easier to follow.

@k8s-ci-robot k8s-ci-robot merged commit 0bbe43d into kubernetes-retired:master Sep 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants