I am using Firebase in my GoLang project hosted on Google Kubernetes Engine.
Steps I followed:
Enable firebase admin SDK on the firebase account. It generated a service account
JSONfor me. This also created a service account under my Google console service credentials.Followed this answer and add a new secret key using
kubectl create secret generic google-application-credentials --from-file=./sample-project.jsonMade changes to my
deployment.YAMLfile (added volume mounts, and environment variable in)spec: containers: - image: gcr.io/sample-ee458/city:0.27 name: city-app volumeMounts: - name: google-application-credentials-volume mountPath: /etc/gcp readOnly: true env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcp/application-credentials.jsonsetup volume in the same file
volumes: - name: google-application-credentials-volume secret: secretName: google-application-credentials items: - key: application-credentials.json # default name created by the create secret from-file command path: application-credentials.jsonRun
kubectl apply -f deployment.yamland deploy usingdocker pushcommand.
It's throwing me error getting credentials using google_application_credentials environment variable gke. What am I missing here? Anny hint would be appreciable.