Juju config kubernetes-worker doesn't work?

Hello, (please forgive my ignorance - this is the first time I am working with juju) we are facing a problem of X-Forwarded-For not being forwarded by juju. We have used the following command:

juju config kubernetes-worker ingress-use-forwarded-headers=true

but it looks like it didn’t change anything. The network traffic goes as follows:

Web browser -> AWS ALB ->  juju (ingress) -> our app (pod/k8s)

X-Forwarded-For is by default enabled in AWS ALB but it got lost somewhere in juju. Can anyone help with what else need to be changed ?

1 Like

I found that the above command changes just an annotation and I had to change manually the data in the configmap. Is it intentional that the above command changes just annotations ?

Someone from the @k8s-team might be able to help out here.

@when_any('config.changed.default-backend-image',
      'config.changed.ingress-ssl-chain-completion',
      'config.changed.nginx-image',
      'config.changed.ingress-ssl-passthrough',
      'config.changed.ingress-default-ssl-certificate',
      'config.changed.ingress-default-ssl-key')
def reconfigure_ingress():
    remove_state('kubernetes-worker.ingress.available')

Looking at the charm, it appears that the ingress-use-forwarded-headers is not checked for a reconfiguration of the ingress. You could disable and re-enable the ingress to trigger it to rewrite, although it sounds like you’ve already manually modified it which should provide the same result.

I don’t believe this has been reported before, do you mind opening a bug Bugs : Kubernetes Worker Charm for us to track this?

1 Like

I can confirm that this is still a valid issue (kubernetes-worker, 1.26/stable, charm version 92).

EDIT: Bug report created: Bug #2038097 “juju config kubernetes-worker ingress-use-forwarde...” : Bugs : Kubernetes Worker Charm

1 Like