I have my vault cluster setup within Kubernetes via the vault-helm chart.
vault v1.4.2
EKS v1.15
I followed the instructions listed here to configure TLS - https://www.vaultproject.io/docs/platform/k8s/helm/examples/standalone-tls
server configs:
ha:
enabled: true
replicas: 3
config: |
ui = true
listener "tcp" {
address = "[::]:8200"
cluster_address = "[::]:8201"
tls_cert_file = "/vault/userconfig/vault-server-tls/vault.crt"
tls_key_file = "/vault/userconfig/vault-server-tls/vault.key"
tls_client_ca_file = "/vault/userconfig/vault-server-tls/vault.ca"
}
storage "dynamodb" {
ha_enabled = "true"
read_capacity = "10"
write_capacity = "15"
max_parallel = "128"
table = "<table_name>"
}
seal "awskms" {
region = "us-east-1"
kms_key_id = <kms_arn>
}
service_registration "kubernetes" {}
I am receiving authentication from agent-init when I deploy my test service.
$ kubectl logs -f centos-deployment-77c6f9d7f4-6tpgm -c vault-agent-init
2020-06-05T19:39:17.779Z [ERROR] auth.handler: error authenticating: error="Put https://vault.vault.svc:8200/v1/auth/kubernetes/login: x509: certificate signed by unknown authority" backoff=1.354056995
2020-06-05T19:39:19.133Z [INFO] auth.handler: authenticating
2020-06-05T19:39:19.140Z [ERROR] auth.handler: error authenticating: error="Put https://vault.vault.svc:8200/v1/auth/kubernetes/login: x509: certificate signed by unknown authority" backoff=1.551085796
2020-06-05T19:39:20.691Z [INFO] auth.handler: authenticating
2020-06-05T19:39:20.698Z [ERROR] auth.handler: error authenticating: error="Put https://vault.vault.svc:8200/v1/auth/kubernetes/login: x509: certificate signed by unknown authority" backoff=1.879938257
2020-06-05T19:39:22.578Z [INFO] auth.handler: authenticating
2020-06-05T19:39:22.585Z [ERROR] auth.handler: error authenticating: error="Put https://vault.vault.svc:8200/v1/auth/kubernetes/login: x509: certificate signed by unknown authority" backoff=2.511108609
This is my injector configuration in my values file for helm, which I had left default. According to the docs, it says if left default, it would generate its own internal self-signed cert.
injector:
certs:
secretName: null
caBundle: ""
certName: tls.crt
keyName: tls.key
So I attempted to generate my own self-signed cert to pass to the agent-injector based on this article - https://medium.com/@cogarius/a-vault-for-all-your-secrets-full-tls-on-kubernetes-with-kv-v2-c0ecd42853e1
However, the vault-agent-injector pod fails to start up
$ kubectl logs -f vault-agent-injector-58744958bd-wz9lj -n vault
{"@level":"info","@message":"Starting handler..","@module":"handler","@timestamp":"2020-06-05T00:41:38.886922Z"}
Listening on ":8080"...
Updated certificate bundle received. Updating certs...
2020/06/05 00:42:18 http: TLS handshake error from 172.21.61.2:34578: remote error: tls: bad certificate
2020/06/05 00:42:35 http: TLS handshake error from 172.21.61.2:34712: remote error: tls: bad certificate
2020/06/05 00:42:53 http: TLS handshake error from 172.21.61.2:34886: remote error: tls: bad certificate
2020/06/05 00:43:55 http: TLS handshake error from 172.21.61.2:35462: remote error: tls: bad certificate
2020/06/05 00:43:57 http: TLS handshake error from 172.21.61.2:35468: remote error: tls: bad certificate
2020/06/05 00:43:59 http: TLS handshake error from 172.21.61.2:35482: remote error: tls: bad certificate
I’ve reverted this change, and back to the original injector helm defaults. with certificate signed by unknown authority
error
What am I doing incorrectly?
Thanks