2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

kubectlでTLS(SSL)証明書のSecretをKubernetesに作成する

Posted at
kubectl create secret tls {Secret名} \
  --cert={証明書ファイルのパス} \
  --key={鍵ファイルのパス} \
  -n {お好きな名前空間}

このコマンドを実行すると、下記のようなYAMLのリソースが作成される。kubectlで作成したくない場合はYAMLを作成してから、kubectl create -fとしても同じ結果になる。

apiVersion: v1
kind: Secret
metadata:
  name: test-tls
  namespace: default
data:
  tls.crt: >-
    {証明書ファイルをBASE64エンコードしたもの}
  tls.key: >-
    {鍵ファイルをBASE64エンコードしたもの}
type: kubernetes.io/tls
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?