Denis
Denis

Reputation: 578

Google GKE Configuration Issue

I manage multiple projects that use the GKE. I migrated into using secrets however, I cannot get the pods to run now because of a secret/token issue.

It seems when I run kubectl get secret I get:

default-token-vhn8t      kubernetes.io/service-account-token   3      17m
pod-reader-token-q7nh7   kubernetes.io/service-account-token   3      7m1s

However, these are both secrets that belong to another project called np. When I run

gcloud config get-value core/project

I get gmbt which is the correct project.

Do I need to run a compariable kubectl ??? to set the correct project?

When I run:

kubectl create secret generic gmbt-server-key --from-file ./keys/server-env/production/.env.json

It adds the keys to the np project and not the gmbt project. Maybe a signout/signin might do the trick?

Upvotes: 0

Views: 73

Answers (1)

Denis
Denis

Reputation: 578

I did a deep dive into

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#config

Here is where I unset the config and then ran

gcloud container clusters get-credentials "project-cluster" --region="us-central1-c"

This solved my problem and I think the gcloud config set project [PROJECT_ID] isn't setting the proper values.

Upvotes: 1

Related Questions