Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm:Proxied UI Authentication (via Additional Containers "sidecars" in the Server Pod/s) #675

Closed
kpurdon opened this issue Apr 24, 2020 · 6 comments

Comments

@kpurdon
Copy link

kpurdon commented Apr 24, 2020

I'd like to propose supporting additional containers as "sidecars" in the Pod serving the Consul UI in order to allow for sidecar-based authentication proxies. This is something I'd be happy to add and test, if it's acceptable.

I generally use Google Cloud IAP to protect services (like the Consul UI) exposed to the public internet. In order to validate the IAP requests (for services that I cannot add authentication too myself) I use kpurdon/iapap to validate the IAP request. This simple proxy service (with IAP validation) is intended to be run as a sidecar in whatever Pod is serving the service I want to protect exposed via a NodePort service. Then an ingress w/ all the IAP requirements is pointed at the NodePort resulting in an IAP protected internal service.

Ingress (w/ IAP) -> NodePort -> Pod [ IAPAP (Validate IAP) -> SomeService ]

While my use case is specific to Cloud IAP, this proposal should allow supporting any authentication method that works by injecting a sidecar proxy service.

Specifically I'd like to be able to:

  • Include additional containers in the server spec (e.g. adding sidecars)
  • Specify a targetPort on the ui.service configuration (to point to the sidecar proxy)

This could look something like the following values.yml:

server:
  additionalContainers:
    - name: iapap-consul-ui
      spec: |
        image: kpurdon/iapap
        ports:
          - name: http
            containerPort: 9999
            env:
              IAPAP_TARGET: "http://localhost:8500" # the consul ui
        ...

ui:
  enabled: true
  type: NodePort
  targetPort: 9999
  ...

Of course this would all be totally optional to use and would result in a zero net change to the current defaults.

@blake blake changed the title Proxied UI Authentication (via Additional Containers "sidcars" in the Server Pod/s) Proxied UI Authentication (via Additional Containers "sidecars" in the Server Pod/s) Apr 28, 2020
@adilyse
Copy link
Contributor

adilyse commented May 14, 2020

Hi @kpurdon,

Thank you for thoroughly explaining your use case, it helps us make better decisions about our features and implementations!

We have a couple of tasks on our upcoming roadmap that will potentially interact with adding extra containers to various components, so it's helpful to be aware of how folks want to use it. We will endeavor make any solution as generally applicable as possible.

Related: hashicorp/consul-helm#158 and hashicorp/consul-helm#255

@kpurdon
Copy link
Author

kpurdon commented May 19, 2020

@adilyse thanks for the response.

Given the most generally applicable solution is simple allowing an extra containers key on at least the server resource would a PR to add that be considered?

I'd love the functionality and am more than happy to do the work.

@kpurdon
Copy link
Author

kpurdon commented Dec 2, 2020

Hi @adilyse @lkysow just wanted to check in here and see if there was anything I can do to help land a feature like this. I see the other open issue and PR has been stuck for a while.

I'm more than happy to do the work. Thanks for all your work on this project!

@david-yu
Copy link
Contributor

Hi @kpurdon that does sound like a nice feature that could help with sidecar proxy service use case. We have not prioritized this on our end. I'm curious to know if that other PR perhaps addresses what you're looking for or if additional changes are needed.

@kpurdon
Copy link
Author

kpurdon commented Dec 23, 2020

The other PR looks like it should handle getting the extra container in, the only other thing needed would be the settings on the UI but that's a trivia change.

@t-eckert t-eckert changed the title Proxied UI Authentication (via Additional Containers "sidecars" in the Server Pod/s) helm:Proxied UI Authentication (via Additional Containers "sidecars" in the Server Pod/s) Aug 24, 2021
@t-eckert t-eckert transferred this issue from hashicorp/consul-helm Aug 24, 2021
lawliet89 pushed a commit to lawliet89/consul-k8s that referenced this issue Sep 13, 2021
When a user sets connectInject.envoyExtraArgs value, they can send
arguments to the injected envoy sidecar binary. For example, in a
development environment, we could consider enabling debug logs in all
sidecars.

Usage:
```
connectInject:
  enabled: true
  envoyExtraArgs: "--log-level debug --disable-hot-restart"
```
@blake
Copy link
Contributor

blake commented Oct 2, 2021

Hi @kpurdon, this functionality was added in #749 and will be available in the next release of consul-k8s.

@blake blake closed this as completed Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants