1.7.3.2. 自動のサイドカーコンテナー挿入の有効化
アプリケーションを Red Hat OpenShift Service Mesh にデプロイする場合は、sidecar.istio.io/inject
アノテーションに値 "true"
を指定して、挿入をオプトインする必要があります。オプトインにより、サイドカーコンテナーの挿入が OpenShift エコシステム内の複数のフレームワークが使用する、ビルダー Pod などの他の OpenShift 機能に干渉しないようにします。
前提条件
- 自動のサイドカーコンテナー挿入を有効にするデプロイメントを特定します。
- アプリケーションの YAML 設定ファイルを見つけます。
手順
- エディターでアプリケーションの設定 YAML ファイルを開きます。
sidecar.istio.io/inject
を、以下に示すように"true"
の値が含まれる設定 YAML に追加します。スリープテストアプリケーションの例
apiVersion: apps/v1 kind: Deployment metadata: labels: app: sleep name: sleep spec: replicas: 1 selector: matchLabels: app: sleep template: metadata: annotations: sidecar.istio.io/inject: "true" labels: app: sleep spec: containers: - name: sleep image: tutum/curl command: ["/bin/sleep","infinity"] imagePullPolicy: IfNotPresent
- 設定ファイルを作成します。