kubernetes-secrets

Use Kubernetes secrets as environment variables in Angular 6

心不动则不痛 提交于 2021-02-08 06:54:44
问题 I configured an automatic build of my Angular 6 app and deployment in Kubernetes each time is push to my code repository (Google Cloud Repository). Dev environment variables are classically store in a environment.ts file like this: export const environment = { production: false, api_key: "my_dev_api_key" }; But I don't want to put my Prod secrets in my repository so I figured I could use Kubernetes secrets. So, I create a secret in Kubernetes: kubectl create secret generic literal-token -

Kubernetes: How to set boolean type variable in configMap

限于喜欢 提交于 2021-02-05 07:09:49
问题 I want to set a boolean variable in configMap (or secret): apiVersion: v1 kind: ConfigMap metadata: name: env-config namespace: mlo-stage data: webpack_dev_server: false But when I apply it, I get the following error: The request is invalid: patch: Invalid value: "map[data:map[webpack_dev_server:false] metadata:map[annotations:map[kubectl.kubernetes.io/last-applied-configuration:{ blah blah blah}]]]": unrecognized type: string I have tried to change the value to Off/No/False, all having the

Kubernetes: How to set boolean type variable in configMap

时光毁灭记忆、已成空白 提交于 2021-02-05 07:08:07
问题 I want to set a boolean variable in configMap (or secret): apiVersion: v1 kind: ConfigMap metadata: name: env-config namespace: mlo-stage data: webpack_dev_server: false But when I apply it, I get the following error: The request is invalid: patch: Invalid value: "map[data:map[webpack_dev_server:false] metadata:map[annotations:map[kubectl.kubernetes.io/last-applied-configuration:{ blah blah blah}]]]": unrecognized type: string I have tried to change the value to Off/No/False, all having the

Kubernetes: How to set boolean type variable in configMap

牧云@^-^@ 提交于 2021-02-05 07:07:19
问题 I want to set a boolean variable in configMap (or secret): apiVersion: v1 kind: ConfigMap metadata: name: env-config namespace: mlo-stage data: webpack_dev_server: false But when I apply it, I get the following error: The request is invalid: patch: Invalid value: "map[data:map[webpack_dev_server:false] metadata:map[annotations:map[kubectl.kubernetes.io/last-applied-configuration:{ blah blah blah}]]]": unrecognized type: string I have tried to change the value to Off/No/False, all having the

Environmental variables returning undefined for Kubernetes deployment

試著忘記壹切 提交于 2020-06-29 03:51:36
问题 I posted a question similar to this and tried to implement what the answer for this question said: How to access Kubernetes container environment variables from Next.js application? However, when I still call my environment variables doing process.env.USERNAME , I'm still getting undefined back... Am I doing something wrong in my deployment file? Here is a copy of my deployment.yaml : metadata: namespace: <namespace> releaseName: <release name> releaseVersion: 1.0.0 target: <target> auth: