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

helm infrastructure #9

Open
obriensystems opened this issue Sep 21, 2021 · 0 comments
Open

helm infrastructure #9

obriensystems opened this issue Sep 21, 2021 · 0 comments
Assignees

Comments

@obriensystems
Copy link
Member

obriensystems commented Sep 21, 2021

kubernetes secrets

biometric:reference-helm michaelobrien$ kubectl create secret generic spring-security --from-literal=spring.user.name=demo --from-literal=spring.user.password=password
secret/spring-security created
biometric:reference-helm michaelobrien$ kubectl get secret spring-security -o yaml
apiVersion: v1
data:
  spring.user.name: ZGVtbw==
  spring.user.password: cGFzc3dvcmQ=
kind: Secret
metadata:
  creationTimestamp: "2021-09-21T16:41:47Z"
  name: spring-security
  namespace: default
  resourceVersion: "1554507"
  selfLink: /api/v1/namespaces/default/secrets/spring-security
  uid: 49733d89-4cdf-4d32-b871-7efa63b60c07
type: Opaque


in deployment yaml
        - name: {{ .Chart.Name }}
          envFrom:
            - secretRef:
                name: spring-security
                #key: spring.user.password

in spring boot
    	String secret = System.getenv("spring.user.password");


redeploy
helm3 delete reference-nbi
sudo helm3 package reference-nbi
helm3 install --set name=reference-nbi reference-nbi ./reference-nbi


run and endpoint
http://localhost:30040/nbi/api

logs
kubectl logs -f reference-nbi-7c45ff855d-nh4dd
2021-09-21 19:27:43.607  INFO 8 --- [nio-8080-exec-9] c.c.reference.nbi.ApiController          : secret: password
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