In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
1. POD services expose the understanding of Ingress Traefik
II. Ingress data flow
3. Ingress Traefik installation runs [root@test-operator traefik] # cd / data/k8s-yaml/k8s-yaml] # mkdir traefikk8s-yaml] # cd traefik/traefik] # docker pull traefik:v1.7.2-alpinetraefik] # docker images | grep traefiktraefik] # docker tag add5fac61ae5 traefik] # harbor.od.com/public/traefik:v1.7.2traefik] # docker push test-harbor.cedarhd.com/public/traefik:v1.7.2# to create four resource configuration lists traefik] # Vi rbac.yamlapiVersion: v1kind: ServiceAccountmetadata: name: traefik-ingress-controller namespace: kube-system---apiVersion: rbac.authorization.k8s.io/v1beta1kind: ClusterRolemetadata: name: traefik-ingress-controllerrules:-apiGroups:-"" resources:-services-endpoints-secrets verbs:-get-list-watch-apiGroups:-extensions resources:-ingresses verbs:- Get-list-watch---kind: ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1beta1metadata: name: traefik-ingress-controllerroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: traefik-ingress-controllersubjects:- kind: ServiceAccount name: traefik-ingress-controller namespace: kube-system- -traefik] # vi ds.yamlapiVersion: extensions/v1beta1kind: DaemonSetmetadata: name: traefik-ingress namespace: kube-system labels: k8s-app: traefik-ingressspec: template: metadata: labels: k8s-app: traefik-ingress name: traefik-ingressspec: serviceAccountName: Traefik-ingress-controller terminationGracePeriodSeconds: 60 containers:-image: test-harbor.cedarhd.com/public/traefik:v1.7.2 name: traefik-ingress ports:-name: controller containerPort: 80 hostPort: 81-name: admin-web containerPort: 8080 securityContext: capabilities: drop:-ALL Add:-NET_BIND_SERVICE args:-- api-kubernetes-logLevel=INFO-insecureskipverify=true-kubernetes.endpoint= https://10.3.153.240:7443-accesslog-accesslog.filepath=/var/log/traefik_access.log-traefiklog -traefiklog.filepath=/var/log/traefik.log-metrics.prometheus-traefik ] # vi svc.yamlkind: ServiceapiVersion: v1metadata: name: traefik-ingress-service namespace: kube-systemspec: selector: k8s-app: traefik-ingress ports:-protocol: TCP port: 80 name: controller-protocol: TCP port: 8080 name: admin-web -- traefik] # vi ingress.yamlapiVersion: extensions/v1beta1kind: Ingressmetadata: name: traefik-web-ui namespace: kube-system annotations: kubernetes.io/ingress.class: traefikspec: rules:-host: test-traefik.cedarhd.com http: paths:-path: / backend: ServiceName: traefik-ingress-service servicePort: 8080 run [root@test-nodes1 ~] # kubectl apply-f http://k8s-yaml.cedarhd.com/traefik/rbac.yamlserviceaccount/traefik-ingress-controller createdclusterrole.rbac.authorization.k8s.io/traefik-ingress-controller createdclusterrolebinding.rbac.authorization.k8s.io/traefik-ingress-controller created [root@test-nodes1 ~] # kubectl apply-f http://k8s-yaml.cedarhd on any compute node host .com/traefik/ds.yamldaemonset.extensions/traefik-ingress created [root@test-nodes1 ~] # kubectl apply-f http://k8s-yaml.cedarhd.com/traefik/svc.yamlservice/traefik-ingress-service created [root@test-nodes1 ~] # kubectl apply-f http://k8s-yaml.cedarhd.com/traefik/ingress.yamlingress.extensions/traefik-web-ui created [root@test-nodes1 ~] # systemctl restart docker.service # restart the docker of two computing nodes [ Root@test-nodes2 ~] # kubectl get pods-n kube-system # check the operation of NAME READY STATUS RESTARTS AGEcoredns-6c69fbcc6c-6vqgr 1 Running 0 18htraefik-ingress-44ptk 1 Running 0 22mtraefik-ingress-vrvr4 1 22mtraefik-ingress-vrvr4 1 Running 0 22m 4. Do domain name interpretation in master/standby proxy to redirect [root@test-master ~] # vi / etc/nginx/conf.d/cedarhd.com.confupstream default_backend_traefik {server 10.3.153.221 vi 81 max_fails=3 fail_timeout=10s Server 10.3.153.222 max_fails=3 fail_timeout=10s; 81} server {server_name * .cedarhd.com; location / {proxy_pass http://default_backend_traefik; proxy_set_header Host $http_host; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for } [root@test-master ~] # nginx-tnginx: the configuration file / etc/nginx/nginx.conf syntax is oknginx: configuration file / etc/nginx/nginx.conf test is successful [root@test-master ~] # nginx-s reload# remarks, interpret the domain name of test-traefik.cedarhd.com to the VIP address (10.3.153.240) on the DNS host.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.