使用root用户
traefik 与 nginx 一样,是反向代理工具,或者叫 Edge Router。
把traefik镜像上传到各个节点
docker load -i traefik_1_7_9.tar.gz
k8s.gcr.io/traefik:1.7.9
在master1上操作
mkdir -p /root/ikube/tls/
echo """
[req]
distinguished_name=req_distinguished_name
prompt=yes
[req_distinguished_name]
countryName=CountryName(2lettercode)
countryName_value=CN
stateOrProvinceName=StateorProvinceName(fullname)
stateOrProvinceName_value=Beijing
localityName=LocalityName(eg,city)
localityName_value=Haidian
organizationName=OrganizationName(eg,company)
organizationName_value=Channelsoft
organizationalUnitName=OrganizationalUnitName(eg,section)
organizationalUnitName_value=R&DDepartment
commonName=CommonName(eg,yournameoryourserver\'shostname)
commonName_value=*.multi.io
emailAddress=EmailAddress
emailAddress_value=920786312@qq.com
""" >/root/ikube/tls/openssl.cnf
openssl req -newkey rsa:4096 -nodes -config /root/ikube/tls/openssl.cnf -days 3650 -x509 -out /root/ikube/tls/tls.crt -keyout /root/ikube/tls/tls.key
kubectl create -n kube-system secret tls ssl --cert /root/ikube/tls/tls.crt --key /root/ikube/tls/tls.key
kubectl apply -f /root/k8s/traefik.yaml
kubectl get pods -n kube-system -o wide
kubectl get pods -n kube-system -o wide