From f9a8388c14549d2821b0d9906dc1955606607f38 Mon Sep 17 00:00:00 2001 From: Geetha Madhuri Bojanki <106727251+Geetha-Bojanki@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:48:39 +0530 Subject: [PATCH] Updated the outdated example mentioned in Development.md file with latest one (#10706) * Updated Expose the endpoint on a local port section in DEVELOPMENT.md file Signed-off-by: Geetha Madhuri * Updated the outdated example mentioned in Development.md file with latest one Signed-off-by: Geetha Madhuri --------- Signed-off-by: Geetha Madhuri --- DEVELOPMENT.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index bfa71a7b93..9e7fc84072 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -455,14 +455,27 @@ You can get at the application in the pod by port forwarding with kubectl, for e ````shell $ kubectl -n kyverno get pod -NAME READY STATUS RESTARTS AGE -kyverno-7d67c967c6-slbpr 1/1 Running 0 19s +NAME READY STATUS RESTARTS AGE +kyverno-admission-controller-57df6c565f-pxpnh 1/1 Running 0 20s +kyverno-background-controller-766589695-dhj9m 1/1 Running 0 20s +kyverno-cleanup-controller-54466dfbc6-5mlrc 1/1 Running 0 19s +kyverno-cleanup-update-requests-28695530-ft975 1/1 Running 0 19s +kyverno-reports-controller-76c49549f4-tljwm 1/1 Running 0 20s ```` +Check the port of the pod you'd like to forward using the command below. + ````bash -$ kubectl -n kyverno port-forward kyverno-7d67c967c6-slbpr 6060 -Forwarding from 127.0.0.1:6060 -> 6060 -Forwarding from [::1]:6060 -> 6060 +$ kubectl get pod kyverno-admission-controller-57df6c565f-pxpnh -n kyverno --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}' +9443 +```` + +Use the exposed port from above to run port-forward with the below command. + +````bash +$ kubectl -n kyverno port-forward kyverno-admission-controller-57df6c565f-pxpnh 6060:9443 +Forwarding from 127.0.0.1:6060 -> 9443 +Forwarding from [::1]:6060 -> 9443 ```` The HTTP endpoint will now be available as a local port.