# term 1
cd histo-example
go clean && go build .
./histo-example
# term 2 - run some load
for i in {1..100000};do curl http://localhost:2112/hello1; curl http://localhost:2112/hello2; sleep 0.5; done
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metrics_examples | |
import ( | |
"net/http" | |
"time" | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promauto" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To deploy: kubectl apply -f nginx-hello-world-deployment.yaml | |
# Access it with the API as a proxy: | |
# $ kubectl proxy | |
# Then in your browser: http://localhost:8001/api/v1/namespaces/default/services/nginx:/proxy/#!/ | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export JWT_TOKEN=$(curl -s -H "Content-Type:application/json" -XPOST http://localhost:8080/tokenz -d '{"email":"youremail@youremaildomain.app", "password":"password"}' | jq -r '.token') | |
curl -H "Content-Type:application/json" -H "Authorization: Bearer $JWT_TOKEN" $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"github.com/gin-gonic/gin" | |
) | |
// album represents data about a record album. | |
type album struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
canadacentral env-1 demogroup-1 | |
westus env-2 demogroup-1 | |
westus env-3 demogroup-1 | |
westus env-4 demogroup-1 | |
westus env-5 demogroup-1 | |
uksouth env-1 demogroup-2 | |
canadacentral env-2 demogroup-2 | |
canadacentral env-3 demogroup-2 | |
canadacentral env-4 demogroup-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# description | |
below we show some examples of running containers under docker with KKM | |
# examples | |
```shell | |
$ docker run -d --rm -p 8080:8080 --runtime=krun --name spring-boot-hello kontainguide/spring-boot-hello:1.0 | |
$ curl http://localhost:8080 | |
# python | |
$ docker run -d --rm -p 5000:5000 --runtime=krun --name py-flask-hello kontainguide/py-flask-hello:1.0 |
# ref: https://knative.dev/docs/getting-started/quickstart-install/#install-the-knative-cli
echo
echo "installing knative with kind cluster..."
echo "downloading kn CLI"
sudo curl -s -Lo /usr/local/bin/kn https://github.com/knative/client/releases/download/knative-v1.4.1/kn-linux-amd64
sudo chmod +x /usr/local/bin/kn
sleep 2
echo
kubectl get configmap/config-features -n knative-serving -o yaml
echo "patching configmap/config-features to enable podspec.runtimeclassname for installing KM..."
Either run like this:
docker run --pid=host --runtime=krun sm/node-express-hello
or add to code: Reference: https://emmer.dev/blog/you-don-t-need-an-init-system-for-node.js-in-docker/
// Trap CTRL-C
NewerOlder