sample-api

command
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Try It

  1. build and deploy ko apply -L -f pod.yaml
  2. execute script to request api of /v1/hello
PORT=`kubectl get svc sample-api -o go-template --template="{{ (index .spec.ports 0).nodePort }}"`
SECRET=`kubectl get sa sample-api -o go-template --template="{{ (index .secrets 0).name }}"`
TOKEN=`kubectl get secret ${SECRET} --template "{{.data.token}}" | base64 -d`

curl -H "Authorization: Bearer ${TOKEN}" -v "http://localhost:${PORT}/v1/hello"
  1. ensure that you will get all namespaces list count like this:
{
 "client": 13,
 "dynamicClient": 13
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL