-
Notifications
You must be signed in to change notification settings - Fork 133
Add support for Scaleway in etcd-manager #336
Conversation
Welcome @Mia-Cross! |
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 Once the patch is verified, the new status will be reflected by the 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. |
etcd-manager/Dockerfile
Outdated
@@ -0,0 +1,19 @@ | |||
FROM golang:1.19-buster |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
etcd-manager/Makefile
Outdated
${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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
/ok-to-test |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[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 |
etcd-manager/Makefile
Outdated
@@ -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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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}}, |
There was a problem hiding this comment.
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.
As we are currently working on adding support for Scaleway in kOps, we also need etcd-manager to have a Scaleway volume provider.