1. #### 安装cert-manager-crd
    2. [root@k8s01 cert-manager]# kubectl apply -f cert-manager-crd.yaml
    3. customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
    4. customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
    5. customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
    6. customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
    7. customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created
    8. customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created
    9. ##### 为 cert-manager 创建命名空间
    10. kubectl create namespace cert-manager
    11. [root@k8s01 cert-manager]# kubectl get ns
    12. NAME STATUS AGE
    13. cert-manager Active 6s
    14. default Active 12m
    15. kube-node-lease Active 12m
    16. kube-public Active 12m
    17. kube-system Active 12m
    18. ###### 安装cert-manager
    19. [root@k8s01 cert-manager]# kubectl apply -R -f templates/
    20. deployment.apps/cert-manager-cainjector created
    21. clusterrole.rbac.authorization.k8s.io/cert-manager-cainjector created
    22. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-cainjector created
    23. role.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created
    24. rolebinding.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created
    25. serviceaccount/cert-manager-cainjector created
    26. deployment.apps/cert-manager created
    27. clusterrole.rbac.authorization.k8s.io/cert-manager-controller-issuers created
    28. clusterrole.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created
    29. clusterrole.rbac.authorization.k8s.io/cert-manager-controller-certificates created
    30. clusterrole.rbac.authorization.k8s.io/cert-manager-controller-orders created
    31. clusterrole.rbac.authorization.k8s.io/cert-manager-controller-challenges created
    32. clusterrole.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created
    33. clusterrole.rbac.authorization.k8s.io/cert-manager-view created
    34. clusterrole.rbac.authorization.k8s.io/cert-manager-edit created
    35. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-issuers created
    36. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created
    37. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-certificates created
    38. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-orders created
    39. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-challenges created
    40. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created
    41. role.rbac.authorization.k8s.io/cert-manager:leaderelection created
    42. rolebinding.rbac.authorization.k8s.io/cert-manager:leaderelection created
    43. service/cert-manager created
    44. serviceaccount/cert-manager created
    45. deployment.apps/cert-manager-webhook created
    46. mutatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created
    47. clusterrole.rbac.authorization.k8s.io/cert-manager-webhook:webhook-requester created
    48. clusterrolebinding.rbac.authorization.k8s.io/cert-manager-webhook:auth-delegator created
    49. rolebinding.rbac.authorization.k8s.io/cert-manager-webhook:webhook-authentication-reader created
    50. service/cert-manager-webhook created
    51. serviceaccount/cert-manager-webhook created
    52. validatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created
    53. # 安装完 cert-manager 后,您可以通过检查 cert-manager 命名空间中正在运行的 Pod 来验证它是否已正确部署:
    54. kubectl get pods --namespace cert-manager
    55. [root@k8s01 calico]# kubectl apply -f tigera-operator.yaml
    56. namespace/tigera-operator created
    57. serviceaccount/tigera-operator created
    58. customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
    59. customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
    60. customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
    61. customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
    62. customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
    63. customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
    64. customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
    65. customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
    66. customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
    67. customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
    68. customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
    69. customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
    70. customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created
    71. customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
    72. customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
    73. customresourcedefinition.apiextensions.k8s.io/installations.operator.tigera.io created
    74. customresourcedefinition.apiextensions.k8s.io/tigerastatuses.operator.tigera.io created
    75. clusterrole.rbac.authorization.k8s.io/tigera-operator created
    76. clusterrolebinding.rbac.authorization.k8s.io/tigera-operator created
    77. deployment.apps/tigera-operator created
    78. # 创建cattle-system命名空间
    79. [root@k8s01 rancher]# kubectl create namespace cattle-system
    80. namespace/cattle-system created
    81. [root@k8s01 rancher]# kubectl apply -R -f templates/ -n cattle-system
    82. clusterrolebinding.rbac.authorization.k8s.io/rancher created
    83. deployment.apps/rancher created
    84. ingress.extensions/rancher created
    85. issuer.cert-manager.io/rancher created
    86. service/rancher created
    87. serviceaccount/rancher created
    88. # 查看rancher的部署情况
    89. kubectl -n cattle-system rollout status deploy/rancher
    90. kubectl -n cattle-system get deploy rancher