Skip to content

Commit

Permalink
Updated the outdated example mentioned in Development.md file with la…
Browse files Browse the repository at this point in the history
…test one (kyverno#10706)

* Updated Expose the endpoint on a local port section in DEVELOPMENT.md file

Signed-off-by: Geetha Madhuri <[email protected]>

* Updated the outdated example mentioned in Development.md file with latest one

Signed-off-by: Geetha Madhuri <[email protected]>

---------

Signed-off-by: Geetha Madhuri <[email protected]>
  • Loading branch information
Geetha-Bojanki authored Jul 24, 2024
1 parent db45329 commit f9a8388
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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-7d67c967c6-slbpr 6060
Forwarding from 127.0.0.1:6060 -> 6060
Forwarding from [::1]:6060 -> 6060
$ 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.
Expand Down

0 comments on commit f9a8388

Please sign in to comment.