How can I generate cert.pem and key.pem to deploy in an kubernetes cluster with helm?

2/20/2019

When I try to install the DB2 with the command:

helm install --name stocktrader-db2 ibm-charts/ibm-db2oltp-dev --tls \
--set db2inst.instname=db2inst1 --set db2inst.password=start1a \
--set options.databaseName=STRADER --set peristence.useDynamicProvisioning=true \
--set dataVolume.size=20Gi --set dataVolume.storageClassName=ibmc-block-gold

I get the following error message:

could not read x509 key pair (cert: "/Users/name/.helm/cert.pem", key: "/Users/name/.helm/key.pem"): can't load key pair from cert /Users/name/.helm/cert.pem and key /Users/name/.helm/key.pem: open /Users/name/.helm/cert.pem: no such file or directory

\=> What is the default directory for the files cert.pem and key.pem?

-- Torsten Andrecht
kubernetes
kubernetes-helm

3 Answers

2/20/2019

I think you are following their README.md, the installation instructions there assume you have Tiller setup in your cluster with TLS enabled.

If you remove the --tls flag from the command (helm install --name stocktrader-db2 ibm-charts/ibm-db2oltp-dev --set db2inst.instname=db2inst1 --set db2inst.password=start1a --set options.databaseName=STRADER --set peristence.useDynamicProvisioning=true --set dataVolume.size=20Gi --set dataVolume.storageClassName=ibmc-block-gold) it will not attempt to find the certificates.

-- Hidde
Source: StackOverflow

2/24/2019

I removed TLS from the following command:

helm install --name stocktrader-db2 ibm-charts/ibm-db2oltp-dev
--tls
--set db2inst.instname=db2inst1
--set db2inst.password=ThisIsMyPassword
--set options.databaseName=STRADER
--set peristence.useDynamicProvisioning=true
--set dataVolume.size=20Gi
--set dataVolume.storageClassName=glusterfs

If TLS is need the helm configuration can be done via the following installation procedure:

https://helm.sh/docs/using_helm/#securing-your-helm-installation

-- Torsten Andrecht
Source: StackOverflow

2/21/2019

If you need TLS between helm and tiller, follow this link. Also, per this link, copy the certificates into helm's home directory:

$ cp ca.cert.pem $(helm home)/ca.pem
$ cp helm.cert.pem $(helm home)/cert.pem
$ cp helm.key.pem $(helm home)/key.pem

Then, run the helm install --name stocktrader-db2 ... command.

-- Vikram Hosakote
Source: StackOverflow