-
Notifications
You must be signed in to change notification settings - Fork 55
feat: Create Makefile target for a fresh kind cluster #413
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
base: notebooks-v2
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
94fdbf5
to
adbe8e1
Compare
/lgtm testing invoking this under a variety of scenarios as observed expected behavior:
|
adbe8e1
to
ec1b1e6
Compare
Signed-off-by: atheo89 <[email protected]>
ec1b1e6
to
130a9d8
Compare
Hey, I made a few additional updates in this PR:
Let me know if you have any feedback or suggestions! |
/lgtm Re-verified functionality based on the rework done - all operating as expected. Following invocations were tested:
On a personal note - recently a MacOS update or something hosed my |
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.
I can appreciate some folks may not "like" the presence of the workspaces/controller/utils
directory and/or feel it should be contained within a different folder location - but the proposed layout in this PR seems reasonable to me. I personally prefer keeping as much scripting as possible outside the Makefile
- so I like how this has been broken down.
Solves: #409
This Makefile target automates the creation and configuration of a local Kubernetes cluster using Kind. It's designed to set up a development environment with essential components pre-installed.
Key Features
Cluster Creation: It creates a Kind Kubernetes cluster. By default, the cluster is named kind-notebooks, but you can customize this by setting the CLUSTER_NAME variable (e.g., make kind-notebooks CLUSTER_NAME=my-dev-cluster).
Cert-Manager Installation: Automatically installs cert-manager, a crucial component for issuing and managing TLS certificates within the Kubernetes cluster. The Makefile waits for cert-manager to be fully available before proceeding.
Note: The deployment of cert-manager should be patched by appending the
--kubelet-insecure-tls
arg, because the Metrics Server in Kind clusters, especially when the Kubelets' certificates don't contain the node's IP addresses as Subject Alternative Names (SANs) cause the following error:E0610 11:58:11.888437 1 scraper.go:149] "Failed to scrape node" err="Get \"https://10.89.0.22:10250/metrics/resource\": tls: failed to verify certificate: x509: cannot validate certificate for 10.89.0.22 because it doesn't contain any IP SANs" node="kind-notebooks-control-plane" I0610 11:58:18.413843 1 server.go:191] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
Metrics Server Installation (Optional): By default, it installs the Metrics Server, which enables Kubernetes to collect resource usage data from nodes and pods. This installation can be skipped by setting the INSTALL_METRICS_SERVER variable to false (e.g., make kind-notebooks INSTALL_METRICS_SERVER=false).
Kubectl Context: After setting up the cluster and its components, the Makefile automatically sets your kubectl context to the newly created Kind cluster, making it easy to interact with it immediately.
Idempotency: The kind delete cluster command at the beginning ensures that if a cluster with the same name already exists, it's removed before a new one is created. This makes the target idempotent, meaning you can run it multiple times without issues.
How to Use
To use this Makefile, you'll need Kind and kubectl installed on your system.
To create the cluster with default settings:
make setup-kind-cluster
To create a cluster with a custom name:
make setup-kind-cluster CLUSTER_NAME=my-custom-cluster
To create a cluster without installing the Metrics Server:
make setup-kind-cluster INSTALL_METRICS_SERVER=false
Output logs of the target: