From 194f0bbd54016dba017f18f0a5ba5d39f5b7c0aa Mon Sep 17 00:00:00 2001 From: HITMAN <112652819+ayushpatil2122@users.noreply.github.com> Date: Sun, 17 Nov 2024 23:53:56 +0530 Subject: [PATCH 1/4] added a tabs for the Linux, macOS and Windows --- .../docs/tasks/tls/managing-tls-in-a-cluster.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md index 57a1cf510388d..32b105ce62bfe 100644 --- a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md +++ b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md @@ -260,11 +260,24 @@ This produces a signed serving certificate file, `ca-signed-server.pem`. Finally, populate the signed certificate in the API object's status: -```shell +{{< tabs name="Upload the signed certificate" >}} +{{< tab name="Linux" codelang="bash" >}} + kubectl get csr my-svc.my-namespace -o json | \ + jq '.status.certificate = "'$(base64 ca-signed-server.pem | tr -d '\n')'"' | \ + kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - +{{< /tab >}} +{{< tab name="macOS" codelang="bash" >}} + kubectl get csr my-svc.my-namespace -o json | \ + jq '.status.certificate = "'$(base64 -i ca-signed-server.pem | tr -d '\n')'"' | \ + kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - +{{< /tab >}} +{{< tab name="Windows" codelang="bash" >}} kubectl get csr my-svc.my-namespace -o json | \ jq '.status.certificate = "'$(base64 ca-signed-server.pem | tr -d '\n')'"' | \ kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - -``` +{{< /tab >}} +{{< /tabs >}} + {{< note >}} This uses the command line tool [`jq`](https://jqlang.github.io/jq/) to populate the base64-encoded From 95eb1ced1811a50bd999f317b7aa8834696d364a Mon Sep 17 00:00:00 2001 From: HITMAN <112652819+ayushpatil2122@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:32:35 +0530 Subject: [PATCH 2/4] Update content/en/docs/tasks/tls/managing-tls-in-a-cluster.md Co-authored-by: Utkarsh Singh <96516301+utkarsh-singh1@users.noreply.github.com> --- content/en/docs/tasks/tls/managing-tls-in-a-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md index 32b105ce62bfe..be5be7b0782f3 100644 --- a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md +++ b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md @@ -262,7 +262,7 @@ Finally, populate the signed certificate in the API object's status: {{< tabs name="Upload the signed certificate" >}} {{< tab name="Linux" codelang="bash" >}} - kubectl get csr my-svc.my-namespace -o json | \ +kubectl get csr my-svc.my-namespace -o json | \ jq '.status.certificate = "'$(base64 ca-signed-server.pem | tr -d '\n')'"' | \ kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - {{< /tab >}} From 261dc5ecbdaf6b01704ba594ac99fbcf5e4544c8 Mon Sep 17 00:00:00 2001 From: HITMAN <112652819+ayushpatil2122@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:32:45 +0530 Subject: [PATCH 3/4] Update content/en/docs/tasks/tls/managing-tls-in-a-cluster.md Co-authored-by: Utkarsh Singh <96516301+utkarsh-singh1@users.noreply.github.com> --- content/en/docs/tasks/tls/managing-tls-in-a-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md index be5be7b0782f3..ced8bdb287805 100644 --- a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md +++ b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md @@ -267,7 +267,7 @@ kubectl get csr my-svc.my-namespace -o json | \ kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - {{< /tab >}} {{< tab name="macOS" codelang="bash" >}} - kubectl get csr my-svc.my-namespace -o json | \ +kubectl get csr my-svc.my-namespace -o json | \ jq '.status.certificate = "'$(base64 -i ca-signed-server.pem | tr -d '\n')'"' | \ kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - {{< /tab >}} From d61fc2035e6fa788c8b023962e3115106b6e0ad7 Mon Sep 17 00:00:00 2001 From: HITMAN <112652819+ayushpatil2122@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:47:57 +0530 Subject: [PATCH 4/4] Update managing-tls-in-a-cluster.md --- content/en/docs/tasks/tls/managing-tls-in-a-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md index ced8bdb287805..9ea7c61419c74 100644 --- a/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md +++ b/content/en/docs/tasks/tls/managing-tls-in-a-cluster.md @@ -271,7 +271,7 @@ kubectl get csr my-svc.my-namespace -o json | \ jq '.status.certificate = "'$(base64 -i ca-signed-server.pem | tr -d '\n')'"' | \ kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f - {{< /tab >}} -{{< tab name="Windows" codelang="bash" >}} +{{< tab name="Windows" codelang="powershell" >}} kubectl get csr my-svc.my-namespace -o json | \ jq '.status.certificate = "'$(base64 ca-signed-server.pem | tr -d '\n')'"' | \ kubectl replace --raw /apis/certificates.k8s.io/v1/certificatesigningrequests/my-svc.my-namespace/status -f -