This is a test api and webapp with some common functionalities to test various needs for development, environment setup and devops tools connectivity and workflows.
-
Api to update the app version
http://localhost:5000/appver?val=<New-version>
-
Api to greet a user for the webapp
http://localhost:5000/greet/<name>
http://localhost:5000/api/greet/<name>
-
Api for server info
http://localhost:5000/api/info
-
Update app version for the webapp ( by api)
-
Greet user with POST method ( via api and web)
-
Get server info, once deployed on Kubernetes (on homepage and via api in json format)
-
For running on Kubernetes, by using
kubectl kustomise
we can modify image (name & tag) and other configurable parans via updating kustomization.yaml in kubernetes folder. -
This app can be built in 3 ways
5.1 With gunicorn WSGI server - Dockerfile added.
5.2 With python and Flask module only - Dockerfile added.
5.3 With buildpack,
- The build command can be overriden by Procfile in root folder.
- Other params can be passed as command line options in build command.
- The buildpack command to build OCI image for app using pack CLI locally using container runtime.
$ pack build helloapp-img \ --path ~/files/helloapppython \ --env BP_CPYTHON_VERSION=3.9.13 \ --buildpack paketo-buildpacks/python \ --builder paketobuildpacks/builder:full
-
The buildpack command to build OCI image for app using kpack [kp] CLI in kubernetes cluster configured with remote image registry.
$ kp image create helloapppython \ --tag registry.mylab.com/rsingh-lib/helloapppython \ --cluster-builder default \ --namespace helloapppython \ --wait \ --git https://github.com/rajks24/helloapppython.git \ --git-revision main \ --env BP_CPYTHON_VERSION=3.9.13
- Add open api swagger
You can reach me on Twitter @rajinh24