-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Bug] Report sidecar failed to run on k8s #225
Comments
I does seem like configurations for basic auth for Cryostat itself also failed (i.e. on Kubernetes): $ helm install cryostat ./charts/cryostat/ --set authentication.basicAuth.enabled=true,authentication.basicAuth.secretName=htpasswd,authentication.basicAuth.filename=htpasswd --set reports.replicas=1
# Cryostat pod
$ kubectl logs -f pods/cryostat-v4-6c8b8c5646-2vqr5
Defaulted container "cryostat-authproxy" out of: cryostat-authproxy, cryostat, cryostat-grafana, cryostat-jfr-datasource
[2024/12/02 23:37:23] [main.go:72] WARNING: You are using alpha configuration. The structure in this configuration file may change without notice. You MUST remove conflicting options from your existing configuration.
[2024/12/02 23:37:23] [oauthproxy.go:128] using htpasswd file: /etc/oauth2_proxy/basicauth/htpasswd
[2024/12/02 23:37:23] [main.go:59] ERROR: Failed to initialise OAuth2 Proxy: could not validate htpasswd: could not load htpasswd file: could not open htpasswd file: open /etc/oauth2_proxy/basicauth/htpasswd: permission denied
# Report pod
$ kubectl logs -f pods/cryostat-v4-reports-5b8894f4cc-xjjmk
Defaulted container "cryostat-reports-authproxy" out of: cryostat-reports-authproxy, cryostat-reports
[2024/12/02 23:38:38] [oauthproxy.go:128] using htpasswd file: /etc/oauth2_proxy/basicauth/htpasswd
[2024/12/02 23:38:38] [main.go:59] ERROR: Failed to initialise OAuth2 Proxy: could not validate htpasswd: could not load htpasswd file: could not open htpasswd file: open /etc/oauth2_proxy/basicauth/htpasswd: permission denied
|
ObservationsAfter a bit of investigations, I think the root cause is that the oauth2-proxy container is running as both non-root user & group, while the mounted volume is owned by root user & group. Additionally, the permission is
SuggestionsThere are couple ways I tried that worked:
On OpenShift, I believe the Security Context Constraint system does set DebuggingAfter installing the chart, I followed these steps to get a shell on the node (i.e. with single-node $ kubectl debug -it node/minikube --image=busybox:1.28
Creating debugging pod node-debugger-minikube-zxh24 with container debugger on node minikube.
If you don't see a command prompt, try pressing enter.
/ #
/ # chroot /host
bash-5.2# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
...output-omitted...
786df5ca9262 quay.io/cryostat/jfr-datasource "/opt/jboss/containe…" 4 hours ago Up 4 hours k8s_cryostat-jfr-datasource_release1-cryostat-v4-768b7bc5d8-jphqp_default_8933794f-a605-42c2-a495-bc9ce1e7a3cd_2
9f52b145cda9 quay.io/cryostat/cryostat-grafana-dashboard "/run.sh" 4 hours ago Up 4 hours k8s_cryostat-grafana_release1-cryostat-v4-768b7bc5d8-jphqp_default_8933794f-a605-42c2-a495-bc9ce1e7a3cd_2
a66a2d168aa8 quay.io/cryostat/cryostat "/deployments/app/en…" 4 hours ago Up 4 hours k8s_cryostat_release1-cryostat-v4-768b7bc5d8-jphqp_default_8933794f-a605-42c2-a495-bc9ce1e7a3cd_2
3620502a545c quay.io/cryostat/cryostat-reports "/opt/jboss/containe…" 4 hours ago Up 4 hours k8s_cryostat-reports_release1-cryostat-v4-reports-69dfd7cf94-qgb8n_default_84ce55c0-f42e-4590-b4e3-0add50a2e81e_2
f12684b2647a quay.io/oauth2-proxy/oauth2-proxy "/bin/oauth2-proxy -…" 4 hours ago Up 4 hours k8s_cryostat-authproxy_release1-cryostat-v4-768b7bc5d8-jphqp_default_8933794f-a605-42c2-a495-bc9ce1e7a3cd_2
...output-omitted...
bash-5.2# docker top f12684b2647a -eo user,group,pid,comm
USER GROUP PID COMMAND
65532 65532 5964 oauth2-proxy |
Current Behavior
When installing the chart with some report sidecar replicas, the sidecar pods failed to start with the container throwing permission denied error.
When getting pod status:
When extracting the oauth2-proxy container log:
Expected Behavior
The report sidecar pods start successfully.
Steps To Reproduce
Have an existing k8s cluster, for example,
minikube
(i.e.minikube start --cni calico --cpus=8 --driver=kvm2
)With latest
main
commit, install the chart:Observe other components are healthy except the report pod.
Environment
Anything else?
I haven't yet tested on OpenShift but it seems to fails on kubenetes with oauth2-proxy. I tried
kinD
andminikube
.The text was updated successfully, but these errors were encountered: