Consul Helm TLS erro: unknown PEM block type for signing key: CERTIFICATE

Viewed 312

I'm trying to understand this error. I am deploying Consul with TLS and Consul Server and Clients. On the tls init containers I get this error.

kubectl logs consul-consul-tls-init-b2rfv
==> WARNING: Server Certificates grants authority to become a
    server and access all state in the cluster including root keys
    and all ACL tokens. Do not distribute them to production hosts
    that are not server nodes. Store them as securely as CA keys.
==> Using /consul/tls/ca/cert/tls.crt and /consul/tls/ca/key/tls.key
unknown PEM block type for signing key: CERTIFICATE

I have tried to create CA certificate and the key in a number of ways. First I tried with openssl, then I tried with cfssl and finally I tried with the consul client. All the same error.

From best I can tell, the volumes are mounting from the secrets. Here is an example of my values.yaml I am deploying consul with through helm 3.

global:
  gossipEncryption:
    secretName: "gossip"
    secretKey: "key"
  tls:
    enabled: true
    verify: false # only for troubleshooting hoping it would help, also tried with true
    caCert:
      secretName: "consul-tls-ca"
      secretKey: "tls.crt"
    caKey:
      secretName: "consul-server-tls"
      secretKey: "tls.crt"

Examples of how I create my gossip and tls secrets

export GOSSIP_ENCRYPTION_KEY=$(consul keygen)
kubectl create secret generic gossip --from-literal="key=${GOSSIP_ENCRYPTION_KEY}"
kubectl create secret generic consul-tls-ca --from-file="tls.crt=./ca.pem"
kubectl create secret generic consul-server-tls --from-file="tls.crt=./server.pem" --from-file="tls.key=./server-key.pem"

I have not found any similar reported errors from others by googling or searching SO. Hashicorps documentation says nothing about it, or I have not found it.

1 Answers
Related