In the previous post, we know how to set up a code-review/debugging environment (some preparations are actually included in this post though). Now, let’s try to bring up the Kubeedge cloudcore (“edgecontroller” as for v1.0.0) on our k3s master. Again, this post assumes you already have a minimal k3s/k8s master up and running at the server, if you don’t know how to do so, feel free to visit my previous posts on guiding you through the k3s setup.
Step 1. Preparation – k3s revisit
In my last post, I forgot to mention about my k3s environment (打脸). Since we are using Docker other than Containerd for k3s, I recommend to change the k3s configuration as following (and disable several services that we are not currently using):
1 | # vi /etc/systemd/system/k3s.service |
Save the file and reload daemon then restart k3s service:
1 | systemctl daemon-reload |
Traefik is always restarting automatically with k3s. Thus to truly disable it, one should follow the commands mentioned in here.
Step 2. Build & Deploy cloudimage
Feel free to refresh your memory on how to build the Kubeedge cloudimage in my previous post. However if you only wish to test deploy, you may use mine here r5by/kubeedge_edgecontroller:v1.0.0
. After the cloudimage is prepared, the next step is to generate certification files:
1 | cd build/cloud |
This scripts will generate a bunch of ca/crt files under path /etc/kubeedge/
and write the secrets to 06-secret.yaml
. Then next, we should copy and paste the kubeconfig to that location for later usage:
1 | mkdir /etc/kubeedge/cloud |
Step 3. Modify the other yaml files
In the build/cloud
path, several yaml files are listed:
1 | cd build/cloud/; ls |
Change 03-clusterrole.yaml
as following:
1 | apiVersion: rbac.authorization.k8s.io/v1 |
Change 05-configmap.yaml
as following:
1 | apiVersion: v1 |
Then verify if your 06-secret.yaml
is consistent with the ca/cert files in path /etc/kubeedge/
, also copy and paste the 07-deployment.yaml
and 08-service.yaml
files from our last post.
The configurations are now set. Use the shell script we write in last post to initialize start Kubeedge edgecontroller on the cloud.
If everything works as expect, you should be able to verify the edgecontroller service is up:
1 | # `kce` alias `k3s kubectl -n kubeedge` |
Step 4. Trouble Shooting
Okay, I understand life is complicated. Unfortunately if you were caught by some weird error messages, don’t panic (even though the compiler does). Check the issues I mentioned in the previous post, and verify carefully each of these yaml files to make sure you understand what should be there. I also listed here several forum posts that may help with your issues:
- 1) DNS issue, not the fix for mine
- 2) DNS issue, again not the fix for mine
- 3) DNS issue, no luck either
- 4) DNS issue, finally works, fix mentioned in here
- 5) DNS issue, not works for mine
- 6) DNS issue, from k3s forum, not a solution for my case
Finally, if you have other questions/problems and solutions, please leave your comments below to share with others. In the next post, I’ll complete the Kubeedge cluster setup with the edgecore setup on both lovely Raspberry Pi’s.