[root@k8s-master-01 traefik]# git clone https://github.com/containous/traefik.git
(一般只需要两个文件:deployment和rbac。)
(由于在Kubernets1.6之后启用了RBAC鉴权机制,所以需配置ClusterRole以及ClusterRoleBinding来对api-server的进行相应权限的鉴权。)
(rbac这个文件呢就是创建ClusterRole和ClusterRoleBinding的。)
[root@k8s-master-01 TrIngress]# kubectl apply -f traefik-rbac.yaml clusterrole.rbac.authorization.k8s.io/traefik-ingress-controller created clusterrolebinding.rbac.authorization.k8s.io/traefik-ingress-controller created [root@k8s-master-01 TrIngress]# kubectl get clusterrolebinding NAME AGE traefik-ingress-controller 29s [root@k8s-master-01 TrIngress]# kubectl get clusterrole NAME AGE traefik-ingress-controller 67s
[root@k8s-master-01 TrIngress]# kubectl apply -f traefik-deployment.yaml
serviceaccount/traefik-ingress-controller created
deployment.extensions/traefik-ingress-controller created
service/traefik-ingress-service created
[root@k8s-master-01 ~]# kubectl get pod --all-namespaces -owide
NAMESPACE     NAME                                    READY   STATUS    RESTARTS   AGE   IP            NODE            NOMINATED NODE
kube-system   traefik-ingress-controller-5ddql        1/1     Running   6          39h   10.10.0.135   k8s-node-02     <none>
kube-system   traefik-ingress-controller-x6xrx        1/1     Running   0          39h   10.10.0.190   k8s-node-01     <none>

(参考链接:http://blog.51cto.com/goome/2151353。)

到这就算完成了,下一步我们看看该怎样使用它。

 

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-06-24
  • 2021-12-08
  • 2021-11-29
  • 2021-10-26
  • 2021-07-11
猜你喜欢
  • 2021-10-20
  • 2022-02-14
  • 2021-06-28
  • 2021-04-21
  • 2021-09-11
  • 2022-03-06
相关资源
相似解决方案