部署

结合实战来学习本 repo

注:knative 0.17 需要 k8s 1.16+

安装 client

$ curl https://github.com/knative/client/releases/download/v0.16.0/kn-linux-amd64 -o kn \
    && chmod +x kn && sudo mv kn /usr/local/bin/

安装 istio

安装 knative 需要选择安装一个网络层,可选的包括 Ambassador、Contour、Gloo、Istio、Kong、Kourier,这里选择 istio

安装 istio client

$ curl -L https://github.com/istio/istio/releases/download/1.6.8/istio-1.6.8-linux-amd64.tar.gz -o istio-1.6.8.tar \
    && tar -xf istio-1.6.8.tar && sudo mv istio-1.6.8/bin/istioctl /usr/local/bin/

安装 istio server

本篇不是对 istio 做介绍,这里就选用最简单的方式,通过 istio operator 来安装 istio server

$ cat istio-minimal-operator.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  values:
    global:
      proxy:
        autoInject: disabled
      useMCP: false
      jwtPolicy: first-party-jwt

  addonComponents:
    pilot:
      enabled: true
    prometheus:
      enabled: false

  components:
    ingressGateways:
    - name: istio-ingressgateway
      enabled: true
    - name: cluster-local-gateway
      enabled: true
      label:
        istio: cluster-local-gateway
        app: cluster-local-gateway
      k8s:
        service:
          type: ClusterIP
          ports:
          - port: 15020
            name: status-port
          - port: 80
            name: http2
          - port: 443
            name: https
$ istioctl manifest apply -f istio-minimal-operator.yaml

确认部署组件都已正常工作

安装 serving

安装

如果目标 k8s 集群有 loadBalancer service 的处理能力,那么可以参考官方文档arrow-up-right做一下 dns 配置。如果没有的话,可以先用一些比较简陋的方法,绕过这些配置,跑完完整流程

确认部署组件都已正常工作

验证

安装 eventing

安装

确认部署组件都已正常工作

验证

验证用的4个 yaml 文件:

Last updated

Was this helpful?