-
Notifications
You must be signed in to change notification settings - Fork 405
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 script for starting kind for local development. #1053
Conversation
@NissesSenap since you're using kind, would you mind giving this a try? |
@smuda Thanks for the PR! I'd think it's better to maintain all the manifests in a separate folder (whether it's a reference to existing deploy examples or new ones). With that, we'd get syntax highlighting, code autocompletion and other things. WDYT? |
Sure! These manifests was retrieved in the same manner that the DEVELOPMENT.md instructed, but I agree. I'll extract the manifests to a separate folder. |
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.
So after fixing missing defnition of KUBECONFIG when you create your kind cluster I get the following issue:
###############################
# 1. Start kind cluster #
###############################
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.25.3) 🖼
✓ Preparing nodes 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
✓ Waiting ≤ 2m0s for control-plane = Ready ⏳
• Ready after 19s 💚
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind --kubeconfig /home/edvin/.kube/kind-grafana-operator
Not sure what to do next? 😅 Check out https://kind.sigs.k8s.io/docs/user/quick-start/
The connection to the server localhost:8080 was refused - did you specify the right host or port?
make: *** [Makefile:272: start-kind] Error 1
This is due to you don't specify the custom kubeconfig file wihtin your command
kubectl get pods --context kind-kind --kubeconfig /home/edvin/.kube/kind-grafana-operator
Please take a second look at at the script and I will be happy to merge.
Thanks allot @smuda
hack/kind/start-kind.sh
Outdated
@@ -0,0 +1,260 @@ | |||
#!/usr/bin/env bash | |||
KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME:-kind} |
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 would be good to have a none standard name like grafana-kind or something like that.
This way we don't remove someone's cluster that they do other things on.
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've set the default name to "kind-grafana".
Agree, my basic thinking was that people wanted something to copy and paste quickly + I haden't solved the file import feature in the UI that I found later when I did this document. I think a separate folder with a kustomize file in it would be nice. |
110f76a
to
f23b390
Compare
I've moved resources to separate folders and added very simple kustomization.yaml. With that, I think it's time for another round of reviews. :-) Edit: I've also rebased on master. |
f9c8bbb
to
85678fe
Compare
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.
You need a final fix in the makefile.
It would also be nice if you can mention the usage of this script in CONTRIBUTING.md
.
Other than that, it looks good.
hack/kind/start-kind.sh
Outdated
echo "# 3. Install CRDs #" | ||
echo "###############################" | ||
pushd "${SCRIPT_DIR}/../.." | ||
make install |
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.
You are not overwriting the default kubeconfig since you are doing make install
438575e
to
0a7efba
Compare
Since I changed the default KUBECONFIG in the make file, I also had to explicitly specify the KUBECONFIG in the github e2e action. |
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.
Sorry for the delay in looking at the PR.
Minor comment.
We should probably add something kind export kubeconfig -n kind-grafana
or something like that to explain how to reach the instance after it's up and running.
# Will install the CRD:s | ||
make install | ||
# Will run the operator from your console | ||
make run |
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.
Should probably still have something around, make run
. Right now when you start the cluster nothing will happen.
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 added a small instruction on how to configure KUBECONFIG to be able to access the cluster.
Yes, once the cluster is up and running, nothing will happen. The idea was to create a cluster which is usable for development, much like the previous instructions in the CONTRIBUTING.md
file. I've added an instruction pointing to make run
to run the operator locally and changed the client.preferIngress=true so it works.
cc7f1f5
to
1583c1b
Compare
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, thanks @smuda for this. I think it will help a lot of other developers to kick-start their workflow.
Closes #1052
A script for starting kind from Makefile, to be used during development.