0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Tanzu Application Platformでcert-managerを除外してデプロイする際の注意点

Posted at

Harbor構築後など既にcert-managerが入っている環境にTanzu Application Platform(以下TAP)をデプロイしようとすると、cert-managerがバッティングしてデプロイに失敗する。
そこでcert-managerを除外リストに追加してデプロイする訳だが、以下のようにcert-managerを除外リストに入れてデプロイしても失敗する。

excluded_packages:
- cert-manager.tanzu.vmware.com

TAPはデフォルトで、shared.ingress_issuertap-ingress-selfsignedを指定してデプロイされる。
このtap-ingress-selfsignedはcert-managerのリソースであるkind: ClusterIssuerで定義され、オレオレ証明書の認証局となってくれるのだが、これがexcluded_packagesでcert-managerを指定するとデフォルトで作成されなくなる。
そのため、このIssuerに証明書を発行してもらおうとするコンポーネントのデプロイが全滅する。
例えばapi-auto-registration-controllerなんかが以下のエラーで起動できなくなる(ContainerCreatingで止まる)。

Events:
  Type     Reason       Age                   From               Message
  ----     ------       ----                  ----               -------
  Normal   Scheduled    4m35s                 default-scheduler  Successfully assigned api-auto-registration/api-auto-registration-controller-6bcfff7665-hntp5 to tis-sharedcluster-0919-md-1-v8hf6-7bddbfb84f-5wx4b
  Warning  FailedMount  2m32s                 kubelet            Unable to attach or mount volumes: unmounted volumes=[ca-cert-info], unattached volumes=[kube-api-access-gsxs2 ca-cert-info]: timed out waiting for the condition
  Warning  FailedMount  25s (x10 over 4m35s)  kubelet            MountVolume.SetUp failed for volume "ca-cert-info" : secret "ca-extractor" not found
  Warning  FailedMount  18s                   kubelet            Unable to attach or mount volumes: unmounted volumes=[ca-cert-info], unattached volumes=[ca-cert-info kube-api-access-gsxs2]: timed out waiting for the condition

Secretは以下のようになり、期待する証明書が発行されていない。

$ kubectl get secret -n api-auto-registration
NAME                 TYPE                                DATA   AGE
ca-cert              servicebinding.io/ca-certificates   2      6m40s
ca-extractor-jm2rk   Opaque                              1      6m38s
image-pull-secret    kubernetes.io/dockerconfigjson      1      6m40s

そのため、cert-managerを除外する際は、予めtap-ingress-selfsignedを自作して配布しておくとよさそう。

cat << EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: tap-ingress-selfsigned
spec:
  selfSigned: {}
EOF

上記実施後、cert-managerを除外してTAPをデプロイした結果は以下。

$ kubectl get app -n tap-install tap
NAME   DESCRIPTION           SINCE-DEPLOY   AGE
tap    Reconcile succeeded   5m5s           5m6s

無事回避できた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?