get_service_ip is not honoring the kubectl config file

Bug #1867978 reported by Cory Johns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
Fix Released
Critical
Cory Johns

Bug Description

As of 1.18-beta.2, kubectl no longer falls back to connecting to localhost:8080 when no config file can be found and instead generates a fatal error. This leads to the following error:

unit-kubernetes-master-0: 14:09:15 INFO unit.kubernetes-master/0.juju-log kube-control:6: Invoking reactive handler: reactive/kubernetes_master.py:993:send_cluster_dns_detail
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed error: Missing or incomplete configuration info. Please point to an existing, complete config file:
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed 1. Via the command-line flag --kubeconfig
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed 2. Via the KUBECONFIG environment variable
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed 3. In your home directory as ~/.kube/config
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed
unit-kubernetes-master-0: 14:09:15 DEBUG unit.kubernetes-master/0.kube-control-relation-changed To view or setup config directly use the 'config' command.
unit-kubernetes-master-0: 14:09:15 INFO unit.kubernetes-master/0.juju-log kube-control:6: DNS addon service not ready yet

The get_service_ip in kubernetes-common needs to be fixed to explicitly point to the config file since HOME is not set in a Juju hook context.

Cory Johns (johnsca)
Changed in charm-kubernetes-master:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Cory Johns (johnsca)
milestone: none → 1.18
Revision history for this message
George Kraft (cynerva) wrote :
Changed in charm-kubernetes-master:
status: In Progress → Fix Committed
Changed in charm-kubernetes-master:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.