open-policy-agent / kube-mgmt

Sidecar for managing OPA instances in Kubernetes.
Apache License 2.0
235 stars 105 forks source link

Not possible to add extra container ports #256

Closed Skoucail closed 2 months ago

Skoucail commented 2 months ago

I'm trying to use this helm chart to deploy OPA-envoy with kube-mgmt. With the properties extraArgs and extraPorts i was able to pass in the envoy plugin settings and expose the GRPC port in the created serice.

But the problem is that there is no option to expose the pods port. My values: image

The created deployment contains: image

I didn't find any way to also add a containerPort in the ports section to expose the GRPC port 9191

anderseknert commented 2 months ago

@ievgenii-shepeliuk , any idea?

eshepelyuk commented 2 months ago

@Skoucail extraPorts are adding ports to the K8s Service, https://github.com/open-policy-agent/kube-mgmt/blob/6ce4ced195ec78119bc6e8d8d0c236ba77240646/charts/opa-kube-mgmt/templates/service.yaml#L19-L21

and AFAIR - if ports are physically exposed in container, then it should work, if you are not using named ports, but just numbers of a port.

Basically, declaring ports on container is only needed to be able to use named ports in K8s Service.

Am I missing smth ?

Skoucail commented 2 months ago

@eshepelyuk Thanks for the clarification. I started over from 0 and now it works. I must have made an error somewhere.