91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

k8s ingress-nginx 0.25.1 最新版部署和例子

發布時間:2020-07-06 22:17:06 來源:網絡 閱讀:2001 作者:295631788 欄目:系統運維

k8s ingress-nginx 0.25.1 最新版部署和例子

說明

https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md

增加了7層的識別能力,可以根據 http header, path 等進行路由轉發

部署

wget  https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

sed -i 's#quay.io/kubernetes-ingress-controller/nginx-ingress-controller#registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller#g' mandatory.yaml

cat service-nodeport.yaml
apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      targetPort: 80
      protocol: TCP
      nodePort: 32080  #http
    - name: https
      port: 443
      targetPort: 443
      protocol: TCP
      nodePort: 32443  #https
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
kubectl create -f  mandatory.yaml
kubectl create -f  service-nodeport.yaml

檢查

kubectl get pod -n ingress-nginx -o wide

kubectl scale --replicas=2  deploy/nginx-ingress-controller -n ingress-nginx

例子

vim  deploy-demo.yaml
apiVersion: v1
kind: Service
metadata:
  name: myapp
  namespace: default
spec:
  selector:
    app: myapp
    release: stable
  ports:
  - name: myapp
    port: 80
    targetPort: 80
---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: default
spec:
  selector:
    matchLabels:
      app: myapp
      release: stable
   replicas: 3
   template:
     metadata:
       labels:
         app: myapp
         release: stable
      spec:
        containers:
        - name: myapp
          image: nginx
          imagePullPolicy: IfNotPresent
        ports:
        - name: myapp
      containerPort: 80

vim  ingress-myapp.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-myapp
namespace: default
annotations:
   kubernetes.io/ingress.class: "nginx"
spec:
  rules:
  - host: httpd.hequan.com
    http:
     paths:
     - path:
       backend:
        serviceName: myapp
        servicePort: 80

kubectl create -f  deploy-demo.yaml
kubectl create -f  ingress-myapp.yaml

 
#修改hosts   node節點ip
192.168.100.112   httpd.hequan.com  

訪問 httpd.hequan.com:32080
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

民丰县| 略阳县| 泸州市| 曲阳县| 安吉县| 朝阳市| 漾濞| 玉山县| 闽清县| 澳门| 通江县| 水城县| 望城县| 池州市| 葫芦岛市| 芮城县| 靖江市| 增城市| 闸北区| 宜宾市| 西昌市| 兰溪市| 富顺县| 石楼县| 长兴县| 承德市| 铁岭市| 潞城市| 康平县| 昌吉市| 珠海市| 肥东县| 滦南县| 古蔺县| 缙云县| 南和县| 岳阳县| 卢龙县| 湛江市| 芷江| 滕州市|