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 fake K8s API server #1610

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mquhuy
Copy link
Member

@mquhuy mquhuy commented Apr 22, 2024

Fake API server is a tool running inside a kubernetes cluster, and "generates" in-memory api server endpoints. These endpoints can be used, for e.g., to represent the clusters created by CAPM3 using fake hardware so that CAPI confirms that the cluster was provisioned successfully.

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kashifest for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@metal3-io-bot metal3-io-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 22, 2024
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 2 times, most recently from e9a7158 to d4b4b60 Compare April 24, 2024 08:14
@metal3-io-bot metal3-io-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 24, 2024
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch from 6a24a8f to a1e125f Compare May 15, 2024 08:40
@mquhuy
Copy link
Member Author

mquhuy commented May 15, 2024

/cc @lentzi90 @kashifest @Rozzii @tuminoid @adilGhaffarDev
This was proven to work, it's ready for reviews

@tuminoid
Copy link
Member

There is unrelated broken link failure, need to address that in another PR preferably.

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Some nits for starters.

hack/fake-apiserver/Dockerfile Outdated Show resolved Hide resolved
hack/fake-apiserver/Dockerfile Outdated Show resolved Hide resolved
hack/fake-apiserver/Dockerfile Outdated Show resolved Hide resolved
hack/fake-apiserver/README.md Outdated Show resolved Hide resolved
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 2 times, most recently from 02cc265 to 2ee5877 Compare May 15, 2024 11:18
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

The Dockerfile is broken now.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
hack/fake-apiserver/README.md Outdated Show resolved Hide resolved
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 2 times, most recently from 4b229a6 to 2a3401d Compare May 15, 2024 11:33
hack/fake-apiserver/go.mod Outdated Show resolved Hide resolved
hack/fake-apiserver/main.go Outdated Show resolved Hide resolved
hack/fake-apiserver/README.md Outdated Show resolved Hide resolved
hack/fake-apiserver/README.md Outdated Show resolved Hide resolved
hack/fake-apiserver/main.go Show resolved Hide resolved
hack/fake-apiserver/main.go Show resolved Hide resolved
hack/fake-apiserver/README.md Show resolved Hide resolved
Makefile Show resolved Hide resolved
@Rozzii Rozzii added this to the 1.8.0 milestone Jun 28, 2024
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch from 2a3401d to 009fe7c Compare July 1, 2024 06:56
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 4 times, most recently from d3d61a0 to 267f75e Compare August 2, 2024 11:14
@metal3-io-bot metal3-io-bot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 3, 2024
@metal3-io-bot metal3-io-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 3, 2024
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 3 times, most recently from 107dd74 to 5bbe165 Compare September 3, 2024 13:28
@mquhuy
Copy link
Member Author

mquhuy commented Sep 4, 2024

/test metal3-centos-e2e-integration-test-main
/test metal3-ubuntu-e2e-integration-test-main

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Some minor nits, but I guess the main question here is that why this should be part of CAPM3 repo in the first place? We should not bloat the repo with non-core stuff.

/cc @kashifest

hack/fake-apiserver/Dockerfile Outdated Show resolved Hide resolved
hack/fake-apiserver/README.md Show resolved Hide resolved
hack/fake-apiserver/go.mod Show resolved Hide resolved
@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 2 times, most recently from 9d2f662 to f92212b Compare September 4, 2024 11:09
@mquhuy
Copy link
Member Author

mquhuy commented Sep 4, 2024

Some minor nits, but I guess the main question here is that why this should be part of CAPM3 repo in the first place? We should not bloat the repo with non-core stuff.

/cc @kashifest

Thanks @tuminoid, I'm ok with putting it elsewhere, as long as it makes sense, but I think having it here was a decision we came up together at some point.

@Rozzii
Copy link
Member

Rozzii commented Sep 5, 2024

On first glance stuff looks OK, thanks for working on this. Could you please add info about the limitations in the README I assume this wouldn't be able to work with Metal3Data and DataTemplates and maybe has other limitations but I might be wrong.
AFAIK this is not a plug in place fake replacement of the whole CAPM3 so just want users to have the right expectation.

@tuminoid
Copy link
Member

tuminoid commented Sep 5, 2024

/hold
Until proper place for this code is agreed.

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 5, 2024
@mquhuy
Copy link
Member Author

mquhuy commented Sep 9, 2024

On first glance stuff looks OK, thanks for working on this. Could you please add info about the limitations in the README I assume this wouldn't be able to work with Metal3Data and DataTemplates and maybe has other limitations but I might be wrong. AFAIK this is not a plug in place fake replacement of the whole CAPM3 so just want users to have the right expectation.

Thanks for the suggestion! This stuff's only intended to generate the kubernetes API server on demands, so it should not be considered a replacement for CAPM3, but it's something that will work alongside CAPM3, BMO and Ironic, in case ironic is hooked with something like Fake-IPA, whose "nodes" cannot provide the functionality of a kubernetes cluster. I guess the docs needs to clarify this better.

@mquhuy mquhuy force-pushed the mquhuy/add-fake-apiserver branch 4 times, most recently from 91386a1 to c84c0f4 Compare September 9, 2024 07:30
@kashifest
Copy link
Member

/hold cancel
We have decided that it can stay in CAPM3.
@adilGhaffarDev @Sunnatillo @mboukhalfa @tuminoid

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 23, 2024
Signed-off-by: Huy Mai <[email protected]>
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Besides outdated versions, we need to consider what else we need due adding another go.mod into CAPM3.

  • dependabot config ?
  • verify-release.sh (exclude it)
  • release docs (do not tag it)
  • makefile (make modules, make verify)
  • hack/gomod.sh

are all doing something for all go.mod files.

# limitations under the License.

# Support FROM override
ARG BUILD_IMAGE=docker.io/golang:1.22.6@sha256:d5e49f92b9566b0ddfc59a0d9d85cd8a848e88c8dc40d97e29f306f07c3f8338
Copy link
Member

Choose a reason for hiding this comment

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

We're at 1.22.7 now

go 1.22.3

require (
k8s.io/api v0.29.3
Copy link
Member

Choose a reason for hiding this comment

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

We're at v0.29.9

k8s.io/apimachinery v0.29.3
k8s.io/client-go v0.29.3
k8s.io/klog/v2 v2.120.1
sigs.k8s.io/cluster-api v1.7.1
Copy link
Member

Choose a reason for hiding this comment

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

We're at v1.8.3

@Rozzii Rozzii changed the title ✨ Add fake apiserver ✨ Add K8s fake apiserver Sep 23, 2024
@Rozzii
Copy link
Member

Rozzii commented Sep 23, 2024

@mquhuy I have made K8s explicit in the PR title, because at least for me it was confusing that what API we are faking.

@Rozzii Rozzii changed the title ✨ Add K8s fake apiserver ✨ Add fake K8s API server Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Status: CAPM3 WIP
Development

Successfully merging this pull request may close these issues.

7 participants