Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
183 views

Why cant nextjs see k8s hostname applied to pod / container

I'm currently having fun with k8s AKS on azure with DevOps etc. and I'm creating a NextJs app or rather two that are connected via their zone system where you in next.config.js can add rewrite and it ...
Melonendk's user avatar
  • 117
0 votes
1 answer
109 views

In the nextjs project environment variable in k8s is undefined

The project has api endpoints that have values ​​if they are in a dev environment or docker containers (work normally / have value). However, in a prod/qa environment in k8s it has no value, even ...
Sam's user avatar
  • 31
1 vote
3 answers
784 views

From a NextJS pod, how do I call an API that's located in a different pod but in the same Kubernetes dev cluster and namespace?

I have a NextJS app that I added to our namespace's dev cluster such that when I call Kubectl get all --namespace [my-namespace] I get back: NAME READY STATUS ...
Daniel Shaby's user avatar
0 votes
1 answer
763 views

Loading contents of files into a NextJs app at runtime as env vars

I'm trying to load the contents of files in a specific folder as env vars accessible at process.env.SomethingHere at runtime not build time as those files don't exist at build time yet (if process.env ...
Rimon's user avatar
  • 188
1 vote
0 answers
860 views

Access secret environment variables from kubernetes in nextjs app

I'm trying to deploy a nextjs app to GCP with kubernetes. I'm trying to setup auth with nextAuth and keycloak provider. The issue I'm running into is that KEYCLOAK_CLIENT_SECRET and ...
SpaceOso's user avatar
  • 408
6 votes
1 answer
3k views

Cant access NEXTjs env in kubernetes/terraform

This question has been asked before, ive been trying plenty of examples over the past two days to try and configure with no luck so I am posting my environment for any help. Problem Nextjs ...
Jason McFarlane's user avatar
1 vote
0 answers
2k views

How to correctly deploy Next Js applications in kubernetes cluster with environments variables

I need my Next js application to read the .env file when deployed to kubernetes. What I do for this: As we know, in order for the next js application to read the .env file, this file must already be ...
Nurlan Dadasov's user avatar
3 votes
1 answer
3k views

ENV_VARS "undefined" when deploying Next JS app through Gitlab CI/CD to a Kubernetes cluster:

I stick to this problem quite long now: I have a standard NextJS app, which uses environment variables (for client side NEXT_PUBLIC_MY_VAR as well for server side ones MY_OTHER_VAR). I use the Gitlab ...
Jan's user avatar
  • 16.3k
1 vote
1 answer
4k views

Next js production build is not finding environment variables when deployed via kubernetes

I have a next js app that I am trying to deploy to a kubernetes cluster as a deployment. Parts of the application contain axios http requests that reference an environment variable containing the ...
Andy's user avatar
  • 738
12 votes
5 answers
20k views

Get Environment Variable Kubernetes on Next.js App

I've been reading other questions about getting K8s environment variables to work in a Next.js app, but no accepted answer till now. My app works fine using .env.local but it's getting an error (...
levia's user avatar
  • 363
3 votes
1 answer
7k views

How to access Kubernetes container environment variables from Next.js application?

In my next.config.js, I have a part that looks like this: module.exports = { serverRuntimeConfig: { // Will only be available on the server side mySecret: 'secret' }, publicRuntimeConfig: { ...
BURGERFLIPPER101's user avatar
3 votes
1 answer
5k views

Next.js Environment variables work locally but not when hosted on Kubernetes

Have a Next.js project. This is my next.config.js file, which I followed through with on this guide: https://dev.to/tesh254/environment-variables-from-env-file-in-nextjs-570b module.exports = ...
BURGERFLIPPER101's user avatar