Hi there!
I think it seems to be related to: Vault agent template doesn't seem to respect env vars (but even if it’s merged, we still have the issue with v.1.4.2 release).
We have the issue with our staging/production setup, that Vault can’t establish the connection to itself without configured environment variable VAULT_ADDR='https://vault-production.domain.com'
.
We run both consul and vault in a cluster on same nodes, so basically Vault uses Consul as backend on localhost.
This is our Vault config from one host:
{
"listener": {
"tcp": {
"tls_disable": 0,
"address": "0.0.0.0:8200",
"cluster_address": "10.1.21.91:8201",
"tls_cert_file": "/etc/ssl/certs/domain_com.crt",
"tls_key_file": "/etc/ssl/private/domain_com.key"
}
},
"storage": {
"consul": {
"address": "127.0.0.1:8500",
"path": "vault/"
}
},
"disable_mlock": 0,
"ui": true,
"api_addr": "https://10.1.21.91:8200",
"cluster_name": "vault-staging"
}
But vault status
responds with Error checking seal status: Get https://127.0.0.1:8200/v1/sys/seal-status: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs
.
After setting env var VAULT_ADDR='https://vault-staging.domain.com'
it works flawlessly. I have no idea why it takes https://127.0.0.1 by default… Do we miss something in the config to avoid exporting env vars on each host?
Thx and have a nice day!