canonical / microk8s-core-addons

Core MicroK8s addons
Apache License 2.0
42 stars 33 forks source link

"host-access" doesn't override instructions. #276

Open mevgdev opened 5 months ago

mevgdev commented 5 months ago

Summary

When setting up a virtual machine on Azure to perform a "Join" from a node is necesary using the VM's public IP, for this razon is neceesary enable the "access-host" addon. If this is enabled using the following sequence, the assigned IP is the default one and not the last one entered.

What Should Happen Instead?

disables the DEFAULT_IP_ADDRESS ("10.0.1.1") not 20.232.Y.Z

Reproduction Steps

Step 1: I input mistake command, because I don't add IP mk8s-controlplane@mk8s-controlplane:~$ microk8s enable host-access Infer repository core for addon host-access Addon core/host-access is already enabled

Step 2: In this one add IP mk8s-controlplane@mk8s-controlplane:~$ microk8s enable host-access:ip=20.232.Y.Z Infer repository core for addon host-access Addon core/host-access is already enabled

Step 3: how to didn't work, I disabled host-access mk8s-controlplane@mk8s-controlplane:~$ microk8s disable host-access:ip=20.232.Y.Z Infer repository core for addon host-access Disabling host-access [10.0.1.1] Host-access is disabled

Step 4: then disabled all previus configuration and started agains mk8s-controlplane@mk8s-controlplane:~$ microk8s enable host-access:ip=20.232.Y.Z Infer repository core for addon host-access Setting 20.232.Y.Z as host-access Host-access is enabled

Finally work in node: user@mtb-402:~$ microk8s join 20.232.Y.Z:25000/165f852c08-- --worker WARNING: Hostpath storage is enabled and is not suitable for multi node clusters.

[sudo] password for user: Contacting cluster at 20.232.Y.Z

The node has joined the cluster and will appear in the nodes list in a few seconds.

This worker node gets automatically configured with the API server endpoints. If the API servers are behind a loadbalancer please set the '--refresh-interval' to '0s' in: /var/snap/microk8s/current/args/apiserver-proxy and replace the API server endpoints with the one provided by the loadbalancer in: /var/snap/microk8s/current/args/traefik/provider.yaml

Successfully joined the cluster.

Introspection Report

`mk8s-controlplane@mk8s-controlplane:~$ microk8s inspect Inspecting system Inspecting Certificates Inspecting services Service snap.microk8s.daemon-cluster-agent is running Service snap.microk8s.daemon-containerd is running Service snap.microk8s.daemon-kubelite is running Service snap.microk8s.daemon-k8s-dqlite is running Service snap.microk8s.daemon-apiserver-kicker is running Copy service arguments to the final report tarball Inspecting AppArmor configuration Gathering system information Copy processes list to the final report tarball Copy disk usage information to the final report tarball Copy memory usage information to the final report tarball Copy server uptime to the final report tarball Copy openSSL information to the final report tarball Copy snap list to the final report tarball Copy VM name (or none) to the final report tarball Copy current linux distribution to the final report tarball Copy asnycio usage and limits to the final report tarball Copy inotify max_user_instances and max_user_watches to the final report tarball Copy network configuration to the final report tarball Inspecting kubernetes cluster Inspect kubernetes cluster Inspecting dqlite Inspect dqlite cp: cannot stat '/var/snap/microk8s/6641/var/kubernetes/backend/localnode.yaml': No such file or directory

Building the report tarball Report tarball is at /var/snap/microk8s/6641/inspection-report-20240423_211603.tar.gz `

Can you suggest a fix?

In my opinion, this is an error because it should indicate that the last IP added was the one disabled, or it should inform that there is already an IP configured and it must be disabled first before configuring a new one.

Are you interested in contributing with a fix?

yes

louiseschmidtgen commented 5 months ago

Thank you for reporting your issue, @mevgdev. It seems like there might be a conflict with the host-access addon due to enabling it twice with different IP addresses. Based on your description, it appears that you may not need the host-access addon for your current task. Please provide us with specific details on what needs fixing. If further assistance is needed, feel free to reach out. We are here to help you.