Giter VIP home page Giter VIP logo

fiaas-deploy-daemon's Introduction

fiaas-deploy-daemon

FIAAS logo


Build status

You need Python 3.9+ and pip(7.x.x or higher) on your PATH to work with fiaas-deploy-daemon.

Supported use-cases

This application is written to support three separate use-cases:

  • Normal: Running inside a cluster, deploying applications in the same cluster
  • Bootstrap: Running outside a cluster, deploying itself into a specified cluster
  • Development: Running outside a cluster, not actually deploying anything (dry-run)

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.

Getting started with developing

  • Use $ pip install -r requirements.txt to install dependencies
  • Make changes to code Run tests with tox:
  • $ 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:

Running fiaas-deploy-daemon against a local minikube or kind backed Kubernetes cluster

This 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:

  • Set up development environment and install fiaas-deploy-daemon ($ pip install -r requirements.txt)

With kind:

With 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:

Deploying an application via CustomResourceDefinition

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.

IntelliJ runconfigs

Running fiaas-deploy-daemon

Use this configuration both for debugging and for manual bootstrapping into a cluster.

  • Create a Python configuration with a suitable name: fiaas-deploy-daemon (dev)
  • Script: Find the fiaas-deploy-daemon executable in the virtualenvs bin directory
    • If using bash, try which fiaas-deploy-daemon inside the virtualenv
  • Script parameters:
    • --debug
    • If you want to deploy to a kubernetes cluster use --api-server, --api-token and --api-cert as suitable
  • Python Interpreter: Make sure to add the virtualenv as an SDK, and use that interpreter

Tests

  • Create a Python tests -> py.test configuration with a suitable name (name of test-file)
  • Target: The specific test-file you wish to run
  • Python Interpreter: Make sure to add the virtualenv as an SDK, and use that interpreter

fiaas-config

fiaas-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.

Release Process

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.

fiaas-deploy-daemon's People

Contributors

oyvindio avatar mortenlj avatar birgirst avatar gregjones avatar j18e avatar fiunchinho avatar soellman avatar tg90nor avatar portega-adv avatar blockjesper avatar herodes1991 avatar srvaroa avatar perj avatar adriengentil avatar amanya avatar xavileon avatar ninaangelvik avatar sa-mao avatar j-boivie avatar pergon avatar rarruda avatar bjornakr avatar cdemonchy avatar gardleopard avatar simenb avatar stigkj avatar henrik242 avatar gerardsegarra avatar biochimia avatar emilva avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.