Leonardo Fagundes Luz Serrano a1608b7a68 Standardize app configs
Fixed versioning and adjusted some build files
to bring them as close to a standard as possible.

- Removed centos files
- Added version tracking via GITREVCOUNT
- Fixed mismatch in plugin name, set to python3-k8sapp-<app>
- Standardized plugin debian files (rules, *.install)
- Plugin wheels saved to /plugin instead of /plugin/<app>

Test Plan:
PASS - Build-pkgs -a
PASS - Build-image
PASS - Install, bootstrap, unlock
PASS - app tarball contains wheel file
PASS - wheel versioning updated properly

Story: 2010542
Task: 47196

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: I4f791b91476bc044410e42309e2c2954f3529a99
2023-01-20 15:30:32 +00:00
..
2023-01-20 15:30:32 +00:00

Sample App

Containerized application that retrieves metrics server data

How does it work ?

The sample app is a Nodejs app that requests the metrics every second and prints that in the console. The deployment creates a service account, roles and role binding to allows this application communicate with the api, this token is stored by default on /var/run/secrets/kubernetes.io/serviceaccount/token, the application is reading that token and doing the requests on the endpoint /apis/metrics.k8s.io/v1beta1/pods that returns all pod metrics and log it on console.

Structure

sample-app
├── centos
│   ├── docker
│   │   ├── Dockerfile
│   │   └── src
│   │       ├── package.json
│   │       └── sample-application.js
│   └── sample-app.stable_docker_image
└── readme.md

Important files

  • src - Contains Nodejs application
  • Dockerfile - Application Dockerfile

Run application

Deploy tha sample app using system helm-override-update --reuse-values --set atribute=value <app name> <chart name> <namespace> folow the steps below:

  • Run system helm-override-update --reuse-values --set sampleApp.create=true metrics-server metrics-server metrics-server
  • Run system application apply metrics-server to apply the override
  • Run kubectl get pods -n metric-server-test-app to get the name of the pod
  • Run kubectl logs -n metric-server-test-app pod-name --tail 1 -f to see the logs and check if the sample application is requesting successfully the metrics server api

Endpoints

All of the following endpoints are GET endpoints and they are under the base path /apis/metrics.k8s.io/v1beta1:

  • /nodes - all node metrics
  • /nodes/{node} - metrics for a specified node
  • /namespaces/{namespace}/pods - all pod metrics within namespace with support for all-namespaces
  • /namespaces/{namespace}/pods/{pod} - metrics for a specified pod
  • /pods - all pod metrics of all namespaces