CommunitySolidServer/css-helm-chart

Deploying the CSS to Kubernetes / Env variables are not getting applied to server configuration.

MarienL1995 opened this issue · 6 comments

Hi, we are having some issues getting env variables applied to the CSS server configuration.

We are using ArgoCD pointed to a directory containing k8s manifests to automate deployment of our resources so every deployment should work directly from the manifest files without executing additional commands inside deployed k8s pods.

Our CSS deployment

Screenshot 2022-08-04 at 11 39 58

CSS service

Screenshot 2022-08-04 at 11 41 06

Ingress resource ( Currently just trying to hook it up to the ingress external url so don't pay attention to the host )
Screenshot 2022-08-04 at 11 42 28

Log output of the CSS pod

Screenshot 2022-08-04 at 11 47 17

Output of kubectl exec -- printenv

Screenshot 2022-08-04 at 11 48 18

When trying to acces the ingress address

Screenshot 2022-08-04 at 12 03 59

Oh you are not actually using the Helm chart for the CSS, just your own manifest files? My bad for pointing you towards this repository :D but I think I can help out nonetheless.

You are passing the baseUrl as env variable CSS_BASE_URL.
As you can see how we include these config variables in the helm chart is as follows:

containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- $appVersion := .Chart.AppVersion -}}
{{- with .Values.image }}
image: "{{.registry}}/{{ .repository }}:{{ .tag | default $appVersion }}"
{{- end}}
args:
- "-l"
- "{{ .Values.logLevel}}"
- "-b"
- "{{ include "community-solid-server.baseUrl" . }}"
{{- if .Values.showStacktrace }}
- "-t"
{{- end }}
{{- with .Values.config}}
- "-c"
{{- if not .configMapName }}
- "config/{{.bundled}}.json"
{{- else }}
- "/config/{{ .configMapKey }}"
{{- end }}
{{- end }}
{{- if .Values.persistence.enabled }}
- "-f"
- "/data/"
{{- end }}
{{- range $val := .Values.customParameters }}
- {{ $val.flag | quote }}
- {{ $val.value | quote }}
{{- end }}

The environment variable functionality was added while I was on leave so I will have to look into how this works and if it functions properly.

Though I know there are issues (on which im working) with using ingress and custom baseUrls, see CommunitySolidServer/CommunitySolidServer#1110

Can you perhaps supply logs from CSS of when you make the request? Maybe try settings CSS_LOGGING_LEVEL to debug

The log line Listening to server at http://localhost:3000/ is normal even when base URL is overridden btw.
Maybe paste in the full logs of the CSS from startup as well.

Full logs when starting up the pod
When making a request to the ingress url no logs of the request get shown.

2022-08-04T10:20:53.465Z [Components.js] �[32minfo�[39m: Initiating component discovery from /community-server/
2022-08-04T10:20:57.144Z [Components.js] �[32minfo�[39m: Discovered 136 component packages within 1307 packages
2022-08-04T10:20:57.224Z [Components.js] �[32minfo�[39m: Initiating component loading
2022-08-04T10:21:27.927Z [Components.js] �[32minfo�[39m: Registered 520 components
2022-08-04T10:21:27.931Z [Components.js] �[32minfo�[39m: Loaded configs
2022-08-04T10:21:43.124Z [UnsecureWebSocketsProtocol] �[33mwarn�[39m: The chosen configuration includes Solid WebSockets API 0.1, which is unauthenticated.
2022-08-04T10:21:43.124Z [UnsecureWebSocketsProtocol] �[33mwarn�[39m: This component will be removed from default configurations in future versions.
2022-08-04T10:21:43.330Z [BaseHttpServerFactory] �[32minfo�[39m: Starting server at http://localhost:3000/
2022-08-04T10:21:57.019Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:21:57.037Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:21:57.042Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:21:57.536Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:21:58.932Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:21:59.240Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:04.227Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:04.641Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:22:12.014Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:12.428Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:12.432Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:12.434Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:12.936Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:22:13.426Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:27.027Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:27.064Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:27.065Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:27.236Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:22:27.541Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:27.831Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:22:42.043Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:42.125Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:42.126Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:42.248Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:42.647Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:22:42.838Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:57.057Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:57.100Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:57.102Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:22:57.270Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:22:57.526Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:22:57.742Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:23:12.072Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:23:12.126Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:23:12.127Z [BaseHttpServerFactory] �[32minfo�[39m: Received GET request for /
2022-08-04T10:23:12.324Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/:0.
2022-08-04T10:23:12.635Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/
:0.
2022-08-04T10:23:12.747Z [ChainedConverter] �[33mwarn�[39m: No conversion path could be made from internal/error to text/plain:1,internal/*:0.

I have checked and it appears that none of the env variables are getting picked up

docker run --rm -p 3000:3000  --env CSS_LOGGING_LEVEL=debug --env CSS_BASE_URL=http://example.com -it solidproject/community-server -c config/default.json
2022-08-04T10:28:41.388Z [Components.js] info: Initiating component discovery from /community-server/
2022-08-04T10:28:42.532Z [Components.js] info: Discovered 136 component packages within 1307 packages
2022-08-04T10:28:42.534Z [Components.js] info: Initiating component loading
2022-08-04T10:28:45.904Z [Components.js] info: Registered 520 components
2022-08-04T10:28:45.905Z [Components.js] info: Loaded configs
2022-08-04T10:28:48.863Z [UnsecureWebSocketsProtocol] warn: The chosen configuration includes Solid WebSockets API 0.1, which is unauthenticated.
2022-08-04T10:28:48.863Z [UnsecureWebSocketsProtocol] warn: This component will be removed from default configurations in future versions.
2022-08-04T10:28:48.903Z [ContainerInitializer] info: Initializing container http://localhost:3000/
2022-08-04T10:28:48.936Z [ContainerInitializer] info: Initialized container http://localhost:3000/ with 3 resources.
2022-08-04T10:28:48.939Z [BaseHttpServerFactory] info: Starting server at http://localhost:3000/

Debug logging not working and base URL not passed. I will open an issue on CSS and investigate this myself, will link this issue so you can track it.

In the meantime as a workaround you can override the command as we have done for this helm chart (or use the helm chart itself!)

@MarienL1995 I've found the issue! The addition of env vars for configuration was added 28 days ago and has not been officially released yet! Very confusing since an entry is added to the readme on main, we know. This is due to our WIP release workflow.

If you want to use the env vars right now you can however use the edge tag for the docker image, do note that this tag gets rebuilt whenever changes are made to main (though these all get tested before merging, use with caution).

We are however close to a patch update, probably before the weekend, which will include this change! So keep an eye on CommunitySolidServer/CommunitySolidServer