Comments (4)
The SSH-ing does only one thing there, it replaces the consul.hcl.tmpl with one that contains a placeholder for the token:
{{ with secret "consul/creds/consul-agent-role" }}tokens = { default = "{{ .Data.token }}" }{{ end }}
this can already be done in the consul-cluster
. The consul-server.hcl.tmpl
there is not being used until the vault-agent auto-authenticates. At which point it already has access to consul/role/...
backend and can replace the token.
As soon as the token is there, the consul watcher should take care of restarting it.
This is the shady part:
"while [ \"$(curl -s 'http://127.0.0.1:8500/v1/status/peers' | jq '. | length')\" != \"3\" ]; do echo \"Consul: no enough peers\"; sleep 3; done",
What the purpose of it and can we move to the consul watcher @efbar ? There is already a 60s sleep before the restart and we can add this waiter too before or after the restart with a sane TTL.
from caravan-platform.
That "wait_and_restart" part was added due to the fact that we had to be sure that a complete (number of nodes) cluster is formed before restart vault-agent and nomad. The culprit was that if you have a not complete cluster formed, with tokens and ca applied, you cannot add the last lonely node without acting through api or stuff like that.
Without that "wait and restart", at the end of the platform automation, you could have a not complete and unstable consul cluster going up and down.
from caravan-platform.
Which probably happens because the vault's cluster backend is not available so the vault-agent can't get a token so only one node has time to reload with token. I get it. We should try to move this waiting to the restarter then and we should be all set.
from caravan-platform.
Probably it could involve also the gcp auth too (and in this case it could be also google fault). Anyway you got the point: that "wait" is a sort buffer time for the right alignment of the consul cluster.
from caravan-platform.
Related Issues (8)
- Check if the consul agent starts without token in --token-file= and if it monitors it for changes
- CI pipeline
- Support GCP Service Account credentials in the remote state
- Add description in input variables
- Manage loading certs to Vault
- Nomad should use a dedicated role for retrieving secrets from Vault
- how to remove app volumes from platform and application-support? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caravan-platform.