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

Container "api" complaining about Missing AI_API_URL environment variable #298

Open
kyouch opened this issue Dec 17, 2024 · 2 comments
Open

Comments

@kyouch
Copy link

kyouch commented Dec 17, 2024

I'm using Helm Chart to deploy in a Kubernetes cluster and I've setup the Values.ai.enabled to be "false", consequently the portion of code below does not get created:

{{- if .Values.ai.enabled }}
            # AI related environment variables
            - name: AI_API_URL
              value: '{{ .Values.api.env.aiApiUrl }}'
            - name: AI_API_USERNAME
              valueFrom:
                secretKeyRef:
                  name: ai-secrets
                  key: aiApiUsername
            - name: AI_API_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: ai-secrets
                  key: aiApiPassword
            - name: PYTHON_ALLOWED_LIBRARIES
              value: '{{ .Values.api.env.pythonAllowedLibraries | default "pandas, plotly, matplotlib" }}'
{{- end }}

However, the container "api" is getting to CrashLoopBackOff" because the variable is missing, but well... I don't want to use the AI.

@kyouch
Copy link
Author

kyouch commented Dec 17, 2024

Well... I've modified the chart to create the variable AI_API_URL anyway and it is now complaining about AI_API_USERNAME. I infer that will happen again with AI_API_PASSWORD and PYTHON_ALLOWED_LIBRARIES

@kyouch
Copy link
Author

kyouch commented Dec 17, 2024

Also, if you comment the lines:

{{- if .Values.ai.enabled }}
{{- end }}

That are in the template of api-deployment, you will also need to comment in the template of ai-secrets because they will complain about not finding the secret...

This is all to say that the main issue is the container api needs to not complain if they don't find those environment variables.

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

1 participant