Enable metrics does not trigger hook

Bug #1836076 reported by Nenad Strainovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
Fix Released
Medium
Joseph Borg

Bug Description

Hi all,

I've tried to enable metrics server on my CDK but pod keeps crashing with following log:

I0710 13:53:55.429053 1 serving.go:273] Generated self-signed cert (apiserver.local.config/certificates/apiserver.crt, apiserver.local.config/certificates/apiserver.key)
W0710 13:54:10.329040 1 authentication.go:166] cluster doesn't provide client-ca-file in configmap/extension-apiserver-authentication in kube-system, so client certificate authentication to extension api-server won't work.
Error: cluster doesn't provide requestheader-client-ca-file

I think it is related to requestheader-* kube-apiserver args
https://github.com/charmed-kubernetes/charm-kubernetes-master/commit/29a44d19ebb418b8e676d16946c40fbc58dae3ce as they are not created.

hookenv.config('enable-metrics') should trigger api_opts but I don't see those args on kube-apiserver and also, configmap extension-apiserver-authentication in kube-system has no data.

On Slack, cynerva found this:

I'm looking at the charm code and I don't see a handler for the `config.changed.enable-metrics` event. That's probably why it's not restarting the apiserver with the correct opts.

After I ran these two commands, metrics server started to work and HPA also works.

juju run --application kubernetes-master -- charms.reactive clear_flag kubernetes-master.components.started
juju run --application kubernetes-master -- hooks/update-status

Kubernetes 1.14
Kubernetes-master charm 695

Thanks

Tags: 1.14
George Kraft (cynerva)
Changed in charm-kubernetes-master:
status: New → Confirmed
Joseph Borg (joeborg)
Changed in charm-kubernetes-master:
assignee: nobody → Joseph Borg (joeborg)
status: Confirmed → In Progress
Revision history for this message
Joseph Borg (joeborg) wrote :
Changed in charm-kubernetes-master:
status: In Progress → Fix Committed
Joseph Borg (joeborg)
Changed in charm-kubernetes-master:
status: Fix Committed → In Progress
Joseph Borg (joeborg)
Changed in charm-kubernetes-master:
importance: Undecided → Medium
Changed in charm-kubernetes-master:
status: In Progress → Fix Committed
milestone: none → 1.16
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.