
cert-managerとは
kubernetes上で動くlet's encryptの証明書を自動発行・管理してくれるツールです。
github.com
何に躓いたのか
大きく2点、インストールと証明書の反映でつまづきました。
使用したバージョンは cert-manager 0.6.2です。
おもに以下の記事を参考に導入していきました。
qiita.com
helmの導入まではそれほど問題ありませんでした。
helm install stable/cert-manager
したところでエラーが出ました。
Error: validation failed: [unable to recognize "": no matches for kind "Certif icate" in version "certmanager.k8s.io/v1alpha1", unable to recognize "": no ma tches for kind "Certificate" in version "certmanager.k8s.io/v1alpha1", unable to recognize "": no matches for kind "Issuer" in version "certmanager.k8s.io/v 1alpha1", unable to recognize "": no matches for kind "Issuer" in version "cer tmanager.k8s.io/v1alpha1"]
この時点でcert-managerのgithubページをよく見れば答えはすぐ見たかったんですが、なぜか検索して見つけようとしていました。
1次情報をよくみる大切さを学びました。
Installing the Chart
https://github.com/jetstack/cert-manager/tree/master/deploy/charts/cert-manager
このページの Installing the Chart に答えが書いてありました。
## IMPORTANT: you MUST install the cert-manager CRDs **before** installing the
## cert-manager Helm chart
$ kubectl apply \
-f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.7/deploy/manifests/00-crds.yaml
## IMPORTANT: if the cert-manager namespace **already exists**, you MUST ensure
## it has an additional label on it in order for the deployment to succeed
$ kubectl label namespace cert-manager certmanager.k8s.io/disable-validation="true"
## Add the Jetstack Helm repository
$ helm repo add jetstack https://charts.jetstack.io
## Install the cert-manager helm chart
$ helm install --name my-release --namespace cert-manager jetstack/cert-manager
要約すると
・ cert-managerをインストールする前にCRDsをインストールしましょう。
・ cert-managerをインストールするネームスペースに事前にラベルをつけましょう。
・ cert-managerをインストールしましょう。(jetstackリポジトリから直接インストールする場合はhelmにリポジトリを追加します。そうでない場合はstable/cert-managerをインストールします。)
以上の実施でインストールは成功しました。
証明書の反映について
Issuer,Certificateの作成では特につまるところはなく、ingress自体も作成出来ていましたが、ingressにcert-managerで発行した証明書がなかなか反映されずにヤキモキしていました。
結局ingressを削除してすぐ再作成することで対応しました。
これで反映されたものの、これでは証明書の更新タイミングのたびにingressを削除する必要があるかもしれず、そのたびにダウンタイムが発生するかもしれません。
体感的にはダウンしているようには感じなかったものの、根本的な解決に至っていないので、もし解決方法を知っている方がいればぜひお知らせください。