You need Python 3.12 and pip
(7.x.x or higher) on your PATH
to work with fiaas-deploy-daemon.
This application is written to support three separate use-cases:
A combination of command-line arguments and environment-variables control which use-case is in effect, and how the application should act. There is no global flag to select a use-case, instead the application will look at available information at each step and determine its course of action.
See the config-module for more information.
$ pip install -r requirements.txt
to install dependenciestox
:$ tox -e codestyle
checks code style, indentations etc.$ tox -e test
runs unit tests$ tox -e integration_test
runs end-to-end/integration tests. These tests require docker and kind v0.18.0+.Useful resources:
minikube
or kind
backed Kubernetes clusterThis workflow is intended for manual testing of fiaas-deploy-daemon against a live Kubernetes cluster while developing.
To run fiaas-deploy-daemon locally and connect it to a local cluster, do the following:
$ pip install -r requirements.txt
)With kind:
$ kind create cluster --image kindest/node:v1.31.0
$ bin/run_fdd_against_kind
With minikube:
$ minikube start
$ bin/run_fdd_against_minikube
There should be a bunch of logging while fiaas-deploy-daemon starts and initializes the required CustomResourceDefinitions. This is normal.
If you need to test some behavior manually you can deploy applications into minikube via fiaas-deploy-daemon in a few ways:
You can deploy applications by creating a Application CustomResource
apiVersion: fiaas.schibsted.io/v1
kind: Application
metadata:
labels:
app: example
fiaas/deployment_id: test
name: example
namespace: default
spec:
application: example
image: nginx:1.13.0
config:
version: 3
ingress:
- host: example.com
metrics:
prometheus:
enabled: false
resources:
limits:
memory: 128M
cpu: 200m
requests:
memory: 64M
cpu: 100m
Create the resource by saving this in a file like e.g. example.yml
and then run
$ kubectl --context minikube create -f example.yml
.
Use this configuration both for debugging and for manual bootstrapping into a cluster.
which fiaas-deploy-daemon
inside the virtualenvfiaas-deploy-daemon will read a fiaas-config to determine how to deploy your application.
This configuration is a YAML file. If any field is missing, a default value will be used.
The default values, and explanation of their meaning are available at /defaults
on any
running instance.
Successful CI builds of the master
branch will push a container image to fiaas/fiaas-deploy-daemon:$timestamp-$commit_ref
and fiaas/fiaas-deploy-daemon:development
. As the development
tag's name suggests, it is primarily intended for testing. Do not use this container image tag in production. Refer to the releases section section in Github to find the most recent stable release.
Refer to Creating a Release for how to create a new release version.