This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.2.3.2. サービス証明書の追加
サービスとの通信のセキュリティーを保護するには、サービスと同じ namespace のシークレットに署名済みの提供証明書とキーのペアを生成します。
生成される証明書は、内部サービス DNS 名 <service.name>.<service.namespace>.svc にのみ有効であり、内部通信用にのみ有効です。
前提条件
- サービスが定義されていること。
手順
サービスに
service.beta.openshift.io/serving-cert-secret-nameのアノテーションを付けます。oc annotate service <service_name> \ service.beta.openshift.io/serving-cert-secret-name=<secret_name>$ oc annotate service <service_name> \1 service.beta.openshift.io/serving-cert-secret-name=<secret_name>2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow たとえば、以下のコマンドを使用してサービス
test1にアノテーションを付けます。oc annotate service test1 service.beta.openshift.io/serving-cert-secret-name=test1
$ oc annotate service test1 service.beta.openshift.io/serving-cert-secret-name=test1Copy to Clipboard Copied! Toggle word wrap Toggle overflow アノテーションが存在することを確認するためにサービスを検査します。
oc describe service <service_name>
$ oc describe service <service_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow アノテーションが出力に一覧表示されていることを確認します。
... Annotations: service.beta.openshift.io/serving-cert-secret-name: <service_name> service.beta.openshift.io/serving-cert-signed-by: openshift-service-serving-signer@1556850837 ...... Annotations: service.beta.openshift.io/serving-cert-secret-name: <service_name> service.beta.openshift.io/serving-cert-signed-by: openshift-service-serving-signer@1556850837 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
クラスターがサービスのシークレットを生成した後に、
Pod仕様がこれをマウントでき、Pod はシークレットが利用可能になった後にこれを実行できます。