fails when deployed in controller model

Bug #1931823 reported by Paul Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-k8s-ingress
Confirmed
Low
Unassigned

Bug Description

I got the following traceback when I did a deployment in the controller model of my microk8s-hosted controller.

Usually when you bootstrap on IAAS you get a `default` model as well as `controller` and are switched to the former, but apparently not on CAAS.

The `controller` model appears to be unique in that, unlike other models, the k8s namespace is not simply the name of the model but e.g. `controller-microk8s-localhost`.

unit-mattermost-ingress-0: 11:44:52 ERROR unit.mattermost-ingress/0.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 430, in <module>
    main(NginxIngressCharm)
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/ops/main.py", line 406, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/ops/main.py", line 140, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/ops/framework.py", line 278, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/ops/framework.py", line 722, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/ops/framework.py", line 767, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 405, in _on_config_changed
    self._define_service()
  File "./src/charm.py", line 330, in _define_service
    api.create_namespaced_service(
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/api/core_v1_api.py", line 8304, in create_namespaced_service
    return self.create_namespaced_service_with_http_info(namespace, body, **kwargs) # noqa: E501
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/api/core_v1_api.py", line 8399, in create_namespaced_service_with_http_info
    return self.api_client.call_api(
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/api_client.py", line 348, in call_api
    return self.__call_api(resource_path, method,
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/api_client.py", line 180, in __call_api
    response_data = self.request(
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/api_client.py", line 391, in request
    return self.rest_client.POST(url,
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/rest.py", line 274, in POST
    return self.request("POST", url,
  File "/var/lib/juju/agents/unit-mattermost-ingress-0/charm/venv/kubernetes/client/rest.py", line 233, in request
    raise ApiException(http_resp=r)
kubernetes.client.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '57360413-dd7d-4ac6-8521-1eb077bd5896', 'X-Kubernetes-Pf-Prioritylevel-Uid': '584d7d24-3cbd-4ef6-8917-d9ce2bb79b62', 'Date': 'Sun, 13 Jun 2021 23:44:52 GMT', 'Content-Length': '200'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces \"controller\" not found","reason":"NotFound","details":{"name":"controller","kind":"namespaces"},"code":404}

unit-mattermost-ingress-0: 11:44:53 ERROR juju.worker.uniter.operation hook "config-changed" (via hook dispatching script: dispatch) failed: exit status 1

Tom Haddon (mthaddon)
Changed in charm-k8s-ingress:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Tom Haddon (mthaddon) wrote :

Reducing importance because I'm not sure we should be encouraging folks to deploy in the controller model.

Changed in charm-k8s-ingress:
importance: Medium → Low
Revision history for this message
Tom Haddon (mthaddon) wrote :
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.