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.8.3.4.2.8. 組み合わせ
ここでは、特定のニーズに対応するために上記の方法を組み合わせてソースクローンのシークレットを作成する方法についての例を紹介します。
.gitconfig ファイルで SSH ベースの認証シークレットを作成するには、以下を実行します。
oc create secret generic <secret_name> \ --from-file=ssh-privatekey=<path/to/ssh/private/key> \ --from-file=<path/to/.gitconfig> \ --type=kubernetes.io/ssh-auth
$ oc create secret generic <secret_name> \ --from-file=ssh-privatekey=<path/to/ssh/private/key> \ --from-file=<path/to/.gitconfig> \ --type=kubernetes.io/ssh-auth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow .gitconfig ファイルと CA 証明書を組み合わせてシークレットを作成するには、以下を実行します。
oc create secret generic <secret_name> \ --from-file=ca.crt=<path/to/certificate> \ --from-file=<path/to/.gitconfig>
$ oc create secret generic <secret_name> \ --from-file=ca.crt=<path/to/certificate> \ --from-file=<path/to/.gitconfig>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow CA 証明書ファイルで Basic 認証のシークレットを作成するには、以下を実行します。
oc create secret generic <secret_name> \ --from-literal=username=<user_name> \ --from-literal=password=<password> \ --from-file=ca.crt=</path/to/file> \ --type=kubernetes.io/basic-auth
$ oc create secret generic <secret_name> \ --from-literal=username=<user_name> \ --from-literal=password=<password> \ --from-file=ca.crt=</path/to/file> \ --type=kubernetes.io/basic-auth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow .gitconfig ファイルで Basic 認証のシークレットを作成するには、以下を実行します。
oc create secret generic <secret_name> \ --from-literal=username=<user_name> \ --from-literal=password=<password> \ --from-file=</path/to/.gitconfig> \ --type=kubernetes.io/basic-auth
$ oc create secret generic <secret_name> \ --from-literal=username=<user_name> \ --from-literal=password=<password> \ --from-file=</path/to/.gitconfig> \ --type=kubernetes.io/basic-auth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow .gitconfig ファイルと CA 証明書ファイルを合わせて Basic 認証シークレットを作成するには、以下を実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow