亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

go-admin如何部署到istio平臺

發布時間:2021-02-23 13:42:32 來源:億速云 閱讀:158 作者:小新 欄目:編程語言

小編給大家分享一下go-admin如何部署到istio平臺,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

部署istio環境參考istio官網

創建獨立命名空間go-admin,自動注入 sidecar

kubectl create namespace go-admin
kubectl label namespace go-admin istio-injection=enabled

創建配置configmap

kubectl create configmap settings-admin --from-file=config/settings.yml -n go-admin

pv及pvc根據自己到需求調整

kubectl apply -f storage.yml -n go-admin#storage.yml---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: go-admin
  namespace: go-admin
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: "1Mi"
  volumeName:
  storageClassName: nfs-csi

部署后端服務v1版本dev分支

配置
kubectl apply -f deploy.yml -n go-admin# deploy.yml---
apiVersion: v1
kind: Service
metadata:
  name: go-admin
  namespace: go-admin
  labels:
    app: go-admin
    service: go-admin
spec:
  ports:
  - port: 8000
    name: http
    protocol: TCP
  selector:
    app: go-admin
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: go-admin-v1
  namespace: go-admin
  labels:
    app: go-admin
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: go-admin
      version: v1
  template:
    metadata:
      labels:
        app: go-admin
        version: v1
    spec:
      containers:
      - name: go-admin
        image: registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:v1.2.2
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8000
        volumeMounts:
        - name: go-admin
          mountPath: /temp
        - name: go-admin
          mountPath: /static
        - name: go-admin-config
          mountPath: /config/
          readOnly: true
      volumes:
      - name: go-admin
        persistentVolumeClaim:
          claimName: go-admin
      - name: go-admin-config
        configMap:
          name: settings-admin
---

創建前端nginx配置configmap

kubectl create configmap nginx-frontend --from-file=default.conf -n go-admin#default.confserver {
  listen       80;
  listen  [::]:80;
  server_name  localhost;

  #charset koi8-r;
  #access_log  /var/log/nginx/host.access.log  main;

  location / {
      root   /usr/share/nginx/html;
      index  index.html index.htm;
  }}

部署前端服務v1版本dev分支

kubectl apply -f deploy.yml# deploy.yml---
apiVersion: v1
kind: Service
metadata:
  name: go-admin-ui
  namespace: go-admin
  labels:
    app: go-admin-ui
    service: go-admim-ui
spec:
  ports:
    - port: 80
      name: http
      protocol: TCP
  selector:
    app: go-admin-ui
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: go-admin-ui-v1
  namespace: go-admin
  labels:
    app: go-admin-ui
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: go-admin-ui
      version: v1
  template:
    metadata:
      labels:
        app: go-admin-ui
        version: v1
    spec:
      containers:
        - name: go-admin-ui
          image: registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin-ui:v1.2.2
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 80
          volumeMounts:
            - name: frontendconf
              mountPath: /etc/nginx/conf.d/default.conf
              subPath: default.conf
              readOnly: true
      volumes:
        - name: frontendconf
          configMap:
            name: nginx-frontend
---

創建dr

kubectl apply -f destination-go-admin.yaml -n go-admin#destination-go-admin.yamlapiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: go-admin-ui
  namespace: go-admin
spec:
  host: go-admin-ui
  subsets:
  - name: v1
    labels:
      version: v1
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: go-admin
  namespace: go-admin
spec:
  host: go-admin
  subsets:
  - name: v1
    labels:
      version: v1

創建gateway和vs(域名改成實際域名)

kubectl apply -f go-admin-gateway.yml -n go-admin#go-admin-gateway.yml---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: go-admin-gateway
  namespace: go-admin
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "go-admin.xxxxxx.com"---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: go-admin-ui
  namespace: go-admin
spec:
  hosts:
  - "*"
  gateways:
  - go-admin-gateway
  http:
  - match:
    - uri:
        prefix: /api
    - uri:
        prefix: /login
    route:
    - destination:
        host: go-admin
        subset: v1
        port:
          number: 8000
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: go-admin-ui
        subset: v1
        port:
          number: 80

看完了這篇文章,相信你對“go-admin如何部署到istio平臺”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!

向AI問一下細節

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

AI

合川市| 永康市| 全椒县| 北碚区| 且末县| 尼玛县| 大渡口区| 灵石县| 盐山县| 崇明县| 新营市| 岳阳市| 和静县| 富阳市| 曲麻莱县| 临桂县| 镇宁| 云霄县| 江川县| 辛集市| 九台市| 临澧县| 儋州市| 玉树县| 黄龙县| 玛沁县| 仁布县| 剑川县| 河源市| 寿光市| 德昌县| 来凤县| 宁波市| 琼结县| 保靖县| 赤峰市| 广南县| 平度市| 陇西县| 合肥市| 炉霍县|