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

Example Using Environment Variables #654

Open
munsayac13 opened this issue May 26, 2022 · 0 comments
Open

Example Using Environment Variables #654

munsayac13 opened this issue May 26, 2022 · 0 comments

Comments

@munsayac13
Copy link

Hello,

Is there an example on how to utilize kamus decryption mechanism using environment variable in deployment.yaml file?

For example:
apiVersion: v1
kind: ConfigMap
metadata:
name: notifier
namespace: default
data:
#Kamus encrypted value
ACCOUNT_SID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AUTH_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I would like to get it decrypt in my deployment file. Does the deployment file requires kamus decryptor in my app pod? When I do this, I get the npm install error. I dont know how to approach. Please advise thanks.

apiVersion: apps/v1
kind: Deployment
metadata:
...
...
...
spec:
serviceAccountName: kamus-example-sa
automountServiceAccountToken: true
initContainers:
- name: "kamus-init"
image: "ghcr.io/soluto/kamus-init-container:latest"
imagePullPolicy: IfNotPresent
env:
- name: KAMUS_URL
value: http://kamus-decryptor.default.svc.cluster.local/
volumeMounts:
- name: encrypted-secrets
mountPath: /encrypted-secrets
- name: decrypted-secrets
mountPath: /decrypted-secrets
args: ["-e","/encrypted-secrets","-d","/decrypted-secrets", "-n", "config.json"]
containers:
- name: app
image: soluto/kamus-example-app
imagePullPolicy: IfNotPresent
volumeMounts:
- name: decrypted-secrets
mountPath: /secrets
- name: MYAPP
image: MYAPP_IMAGE:latest
resources:
limits:
cpu: 500m
requests:
cpu: 100m
volumes:
- name: encrypted-secrets
configMap:
name: encrypted-secrets-cm
- name: decrypted-secrets
emptyDir:
medium: Memory

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