OpenShift 4.3 通过脚本配置ServiceMesh和Serverless运行环境

文章目录

    • Install CatalogSourceConfig
    • Install Servicemesh
    • Install Knative Serving
    • Install Knative Eventing

Install CatalogSourceConfig

  1. 创建CatalogSourceConfig资源
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/redhat-operators-csc.yaml
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/community-operators-csc.yaml
  1. 查看CatalogSourceConfig资源
$ oc -n openshift-marketplace get csc
NAME                           STATUS      MESSAGE                                       AGE
community-operators-packages   Succeeded   The object has been successfully reconciled   48s
redhat-operators-packages      Succeeded   The object has been successfully reconciled   58s

Install Servicemesh

  1. 安装Servicemesh所需Operator
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/servicemesh/subscription.yaml
subscription.operators.coreos.com/elastic-search created
subscription.operators.coreos.com/jaeger created
subscription.operators.coreos.com/kiali created
subscription.operators.coreos.com/servicemesh created
  1. 查看Operator安装状态。
$ oc get csv -w
NAME                                         DISPLAY                          VERSION               REPLACES                     PHASE
elasticsearch-operator.4.1.34-202002040910   Elasticsearch Operator           4.1.34-202002040910                                Succeeded
jaeger-operator.v1.13.1                      Jaeger Operator                  1.13.1                                             Succeeded
kiali-operator.v1.0.11                       Kiali Operator                   1.0.11                kiali-operator.v1.0.10       Succeeded
servicemeshoperator.v1.0.8                   Red Hat OpenShift Service Mesh   1.0.8                 servicemeshoperator.v1.0.7   Succeeded
  1. 新建Servicemesh用的项目,然后创建Servicemesh的ServiceMeshControlPlane和ServiceMeshMemberRoll
$ oc new-project istio-system 
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/servicemesh/smcp.yaml
$ oc create -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/servicemesh/smmr.yaml
  1. 查看Servicemesh相关pod创建情况
$ oc get pods -n istio-system -w
NAME                                     READY   STATUS    RESTARTS   AGE
cluster-local-gateway-54c465457d-d8q77   1/1     Running   0          88s
istio-citadel-84b9959cc6-vm4n2           1/1     Running   0          2m47s
istio-galley-cc75d7c89-k56qj             1/1     Running   0          2m33s
istio-ingressgateway-bdb9f6dd6-nlsnv     1/1     Running   0          88s
istio-pilot-58f6d6b8f5-6nh2c             1/1     Running   0          2m10s

Install Knative Serving

  1. 安装serverless-operator的Operator订阅
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/knative-serving/subscription.yaml
  1. 查看serverless-operator的部署情况。
$ oc get csv | grep serverless-operator
serverless-operator.v1.4.1                   OpenShift Serverless Operator    1.4.1                 serverless-operator.v1.4.0   Succeeded
  1. 新建Knative Serving资源的项目,然后创建所需对象。
$ oc new-project knative-serving  
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/knative-serving/cr.yaml
  1. 查看支持knative-serving的pod运行情况
$ oc get pods -n knative-serving
NAME                               READY   STATUS    RESTARTS   AGE
activator-84b5f4f4d6-cv92n         1/1     Running   0          60s
autoscaler-84d84b65db-5xprt        1/1     Running   0          59s
autoscaler-hpa-66f7f47c4c-4fhtl    1/1     Running   0          59s
controller-cb7dff454-6rht5         1/1     Running   0          55s
networking-istio-c9c98f574-65mpt   1/1     Running   0          52s
webhook-65b6db457c-cjr7d           1/1     Running   0          54s
  1. 查看knative-serving的状态,成功完成后显示以下内容。
$ oc get knativeserving.operator.knative.dev/knative-serving -n knative-serving --template='{{range .status.conditions}}{{printf "%s =%s\n" .type .status}}{{end}}'
DependenciesInstalled=True
DeploymentsAvailable=True
InstallSucceeded=True
Ready=True

Install Knative Eventing

  1. 创建运行Knative Eventing资源的项目
$ oc new-project knative-eventing
  1. 安装Knative Eventing的Operator订阅
$ oc apply -f https://raw.githubusercontent.com/liuxiaoyu-git/knative-tutorial/release/0.7.x/install/knative-eventing/subscription.yaml
  1. 查看knative-eventing-operator安装情况
$ oc get csv -n knative-eventing
NAME                                         DISPLAY                          VERSION               REPLACES                            PHASE
elasticsearch-operator.4.1.34-202002040910   Elasticsearch Operator           4.1.34-202002040910                                       Succeeded
jaeger-operator.v1.13.1                      Jaeger Operator                  1.13.1                                                    Succeeded
kiali-operator.v1.0.9                        Kiali Operator                   1.0.9                 kiali-operator.v1.0.8               Succeeded
knative-eventing-operator.v0.12.0            Knative Eventing Operator        0.12.0                knative-eventing-operator.v0.11.0
serverless-operator.v1.4.1                   OpenShift Serverless Operator    1.4.1                 serverless-operator.v1.4.0          Succeeded
servicemeshoperator.v1.0.7                   Red Hat OpenShift Service Mesh   1.0.7                 servicemeshoperator.v1.0.6          Succeeded
  1. 查看支持knative-eventing的pod运行情况
$ oc get pods -n knative-eventing -w
NAME                                   READY   STATUS    RESTARTS   AGE
eventing-controller-6b69c6778b-4flw2   1/1     Running   0          2m35s
eventing-webhook-c7d46444b-wpkfw       1/1     Running   0          2m32s
imc-controller-69c4775c85-wqd6r        1/1     Running   0          2m27s
imc-dispatcher-655ff59648-zzcf6        1/1     Running   0          2m26s
sources-controller-7887fbc859-l86vk    1/1     Running   0          2m35s

你可能感兴趣的:(OpenShift,4,Knative,微服务)