halkyonio / primaza-poc

Quarkus Primaza Application - POC
1 stars 7 forks source link

Still having issue with vault.url, vault.user and vault.pwd on hetzner #287

Closed cmoulliard closed 1 year ago

cmoulliard commented 1 year ago

Issue

We still have an issue with the env vars vault.url, vault.user and vault.pwd on hetzner as the quarkus vault client reports as error that vaultBootSrapConfig is null for vault.url

The temporary workaround is to patch the primaza deployment and to set new properties:

        - name: QUARKUS_VAULT_URL
          value: https://vault.65.108.212.158.nip.io
        - name: QUARKUS_VAULT_AUTHENTICATION_USERPASS_USERNAME
          value: bob
        - name: QUARKUS_VAULT_AUTHENTICATION_USERPASS_PASSWORD
          value: sinclair

using the commands:

kubectl set env -n primaza deployment/primaza-app QUARKUS_VAULT_URL=https://vault.65.108.212.158.nip.io
kubectl set env -n primaza deployment/primaza-app QUARKUS_VAULT_AUTHENTICATION_USERPASS_USERNAME=bob
kubectl set env -n primaza deployment/primaza-app QUARKUS_VAULT_AUTHENTICATION_USERPASS_PASSWORD=sinclair        

Next you can execute the following commands to test

kubectl rollout restart -n primaza deployment/primaza-app
## wait till the pod is running
export PRIMAZA_URL=primaza.65.108.212.158.nip.io
export CONTEXT_TO_USE=kind-primaza
export NS_TO_BE_EXCLUDED="default,kube-system,ingress,primaza,pipelines-as-code,tekton-pipelines,tekton-pipelines-resolvers,vault,local-path-storage,kube-node-lease" 

./scripts/data/cluster.sh
./scripts/data/services.sh
curl -X POST http://$PRIMAZA_URL/credentials -s -k -d "name=fruits_database-vault-creds&serviceId=1&vaultKvPath=primaza/fruits&params=database:postgres"
curl -X POST http://$PRIMAZA_URL/claims -s -k -d "name=atomic-fruits&owner=snowdrop&description=quarkus_application_accessing_the_atomic-fruits_postgresql_db&serviceId=1"

From the UI you can select the application atomic-fruits and claim it against the claim atomic-fruits. After a few seconds you should be able to access: https://atomic-fruits.65.108.212.158.nip.io/fruits

cmoulliard commented 1 year ago

Retested successfully using image: https://quay.io/halkyonio/primaza-app: df83478 which corresponds to latest commit: df83478 Scenario played on Hetzner: https://gist.github.com/cmoulliard/9e420bb715425b3d3f46b6f0462302d3