Looks like a bug in the kubernetes-master charm. It happens when an upgrade-charm hook runs before a kube-api-endpoint relation is established.
The upgrade-charm handler calls update_certificates()[1], which calls send_data()[2], which assumes kube-api-endpoint is available[3]. Either this code path needs to be eliminated, or there needs to be a check somewhere along the line that kube-api-endpoint is actually available.
It is weird that Juju runs an upgrade-charm hook on initial deployment. But the charm should be able to handle it.
Looks like a bug in the kubernetes-master charm. It happens when an upgrade-charm hook runs before a kube-api-endpoint relation is established.
The upgrade-charm handler calls update_ certificates( )[1], which calls send_data()[2], which assumes kube-api-endpoint is available[3]. Either this code path needs to be eliminated, or there needs to be a check somewhere along the line that kube-api-endpoint is actually available.
It is weird that Juju runs an upgrade-charm hook on initial deployment. But the charm should be able to handle it.
[1]: https:/ /github. com/charmed- kubernetes/ charm-kubernete s-master/ blob/aa70656513 43626bac2ca16bc f849f6e9e051ab5 /reactive/ kubernetes_ master. py#L169 /github. com/charmed- kubernetes/ charm-kubernete s-master/ blob/aa70656513 43626bac2ca16bc f849f6e9e051ab5 /reactive/ kubernetes_ master. py#L915 /github. com/charmed- kubernetes/ charm-kubernete s-master/ blob/aa70656513 43626bac2ca16bc f849f6e9e051ab5 /reactive/ kubernetes_ master. py#L846
[2]: https:/
[3]: https:/