• Stars
    star
    219
  • Rank 177,603 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AppController is a pod that you can spawn in your Kubernetes cluster which will take care of your complex deployments for you.

AppController Build Status Stories in Progress Go Report Card

AppController is a pod that you can spawn in your Kubernetes cluster which will take care of your complex deployments for you.

In ideal world of Kubernetes you don't need to care about dependencies. Unfortunately reality can be different: your applications most like will have some sort of dependencies and your components will require to be deployed in certain order. One of the examples is the database that needs to be installed before all other components can be launched. Best way is to refactor your apps in such a way so they do not fail when database connection is not yet available. For complex applications it can take a lot of time, blocking you from running your workloads on Kubernetes. AppController enables you to use Kubernetes for your complex applications out of hand.

Despite managing complex dependencies and ordered execution, AppController is completely Kubernetes native, using k8s objects and features. This way once you refactor your applications to be full blown micro services, you don't need to change anything. Zero vendor lock-in.

AppController team works closely with other Kubernetes projects to provide wide and seamless integrations.

Basic concepts

AppController uses three basic concepts:

K8s Objects

AppController interacts with bare Kubernetes objects by creating them (if they are needed by deployment and do not exist yet) and reading their state. The state is used by AppController to ensure that dependencies for other objects are met.

Dependencies

Dependencies are objects that represent vertices in your deployment graph. You can define them and easily create them with kubectl. Dependencies are ThirdPartyResource which is API extension provided by AppController. It's worth mentioning, that Dependencies can represent dependency between pre-existing K8s object (not orchestrated by AppController) and Resource Definitions, so parts of your deployment graph can depend on objects that were created in your cluster before you even started AppController-aided-deployment. Dependency could have metadata which can contain additional informations about how to determine if it's fulfilled.

Dependency on Replica Set accepts success_factor key with stringified percentage integer value of how many replicas should be ready to fulfill the status check.

Resource Definitions

Resource Definitions are objects that represent Kubernetes Objects that are not yet created, but are part of deployment graph. They store manifests of underlying objects. AppController supports most of Kubernetes Objects, if some object type is missing please create github issue about it.

Resource Definitions are (the same as Dependencies) ThirdPartyResource API extension.

Demo

General AppController demos

asciicast

Voice demo from sig-apps meeting

Voice demo from kubernetes community meeting

Helm integration demo

asciicast

Usage

Run AppController pod:

kubectl create -f https://raw.githubusercontent.com/Mirantis/k8s-AppController/master/manifests/appcontroller.yaml

Suppose you have some yaml files with single k8s object definitions (pod and jobs are supported right now). Create AppController ResourceDefintions for them:

cat path_to_your_pod.yaml | kubectl exec -i k8s-appcontroller kubeac wrap | kubectl create -f -

Create file with dependencies:

apiVersion: appcontroller.k8s/v1alpha1
kind: Dependency
metadata:
  name: dependency-1
parent: pod/<pod_resource_name_1>
child: job/<job_resource_name_2>
---
apiVersion: appcontroller.k8s/v1alpha1
kind: Dependency
metadata:
  name: dependency-2
parent: pod/<pod_resource_name_2>
child: pod/<pod_resource_name_3>
---
apiVersion: appcontroller.k8s/v1alpha1
kind: Dependency
metadata:
  name: dependency-3
parent: job/<job_resource_name_1>
child: job/<job_resource_name_3>
---
apiVersion: appcontroller.k8s/v1alpha1
kind: Dependency
metadata:
  name: dependency-4
parent: replicaset/<replicaset_resource_name_1>
child: job/<job_resource_name_1>
meta:
  success_factor: "80"

Load it to k8s:

kubectl create -f dependencies_file.yaml

Start the graph deployment:

kubectl exec k8s-appcontroller kubeac -- run

Reporting

Use the following command:

kubectl exec k8s-appcontroller kubeac -- get-status

to get current status of deployment. You might use -r to get detailed report or -j to get a JSON representation of status.

Building

In order to build, issue::

make TAG=some-docker-tag

This would vendor the dependencies with glide and build the container with a given tag. The default tag is mirantis/k8s-appcontroller

Multiple AppControllers

You can have multiple AppController pods running in your Kubernetes cluster. You can separate your workloads by labeling your Dependencies and Definitions.

Your AppController objects will be retrieved by AppController for processing based on the selector you provide inside pod environment variable KUBERNETES_AC_LABEL_SELECTOR. You can pass this variable to pod using Kubernetes environment variable passing mechanism (empty environment variable is already in manifests/appcontroller.yaml file for you to fill).

Example

Example value of this variable could be app=app1. AppController pod with this value in KUBERNETES_AC_LABEL_SELECTOR variable will work only with Dependencies and Definitions that contain app: app1 key-value pair in their metadata.labels section.

Special cases

If the selector is empty, the AppController pod will use all Dependencies and Definitions available in cluster.

You can also override this behaviour by using -l flag for kubeac deploy command available on AppController pod, but this should be only done for testing purposes and is not encouraged in production.

Roadmap

Here is the brief list of our mid term Roadmap:

  • Joining Kubernetes Incubator
  • Cooperation with Helm project
  • Failure handling
  • Flows implementation
  • HA for AppController Pod
  • Real life examples
  • Documentation improvements

More Repositories

1

cri-dockerd

dockerd as a compliant Container Runtime Interface for Kubernetes
Go
1,008
star
2

virtlet

Kubernetes CRI implementation for running VM workloads
Go
735
star
3

kqueen

Kubernetes queen - cluster manager
Python
138
star
4

pipeline-library

Groovy
97
star
5

k8s-externalipcontroller

External IP controller is k8s application which is deployed on top of k8s cluster and which configures External IPs on k8s worker node(s) to provide IP connectivity.
Go
78
star
6

k8s-netchecker-server

Basic network checker service to check DNS and connectivity in kubernetes cluster
Go
67
star
7

compliance

Docker Enterprise Edition Security Controls for Compliance
Go
66
star
8

openstack-lbaas

Load balancing service for OpenStack
Python
53
star
9

criproxy

Multiple CRIs per node & running CRI implementations inside pods
Go
41
star
10

k8s-apps

Kubernetes Helm charts
Go
40
star
11

ceph-lcm

Python
36
star
12

disk_perf_test_tool

Python
36
star
13

reclass-system-salt-model

32
star
14

fuel

Ruby
32
star
15

mk-pipelines

Groovy
27
star
16

launchpad

27
star
17

fuelweb

Python
23
star
18

k8s-daemonupgradecontroller

DaemonSet upgrade controller for kubernetes
23
star
19

k8s-devbox

Reproducible Kubernetes development environment
Shell
19
star
20

mk-lab-salt-model

DEPRECATED - this lab model is outdated and not maintained.
Shell
16
star
21

stepler

Full documentation
Python
15
star
22

mos-integration-tests

Python
14
star
23

lens-extension-cc

A Lens Extension that makes it easy to connect Lens to a Mirantis Container Cloud instance and add its clusters to Lens.
JavaScript
14
star
24

k8s-netchecker-agent

Basic network checker agent to check DNS and connectivity in kubernetes cluster
Go
13
star
25

stackalytics

OpenStack contribution dashboard
Python
12
star
26

openstack-utils

Python
11
star
27

CloudFerry

Openstack workload migration tool
Python
9
star
28

kostyor

Orchestrate OpenStack upgrades
Python
9
star
29

kqueen-ui

Separated UI for https://github.com/Mirantis/kqueen
Python
9
star
30

solar

This repo is OUTDATED!!! We moved to OpenStack
Python
8
star
31

swift-encrypt

Python
8
star
32

mos-horizon

Python
7
star
33

cloudpipe-image-auto-creation

Fully automated cloudpipe image creation
Shell
7
star
34

release-openstack-k8s

Shell
7
star
35

tcp-qa

Python
6
star
36

gosa-openstack

Gosa plugin for managing Nova users
6
star
37

vmware-dvs

Python
6
star
38

dhcp-relay

DHCPv4-Relay (opinionated Golang implementation).
Go
5
star
39

fuel-main

Python
5
star
40

devops

Python
5
star
41

training-lab

Training lab for MCP in Azure
HCL
5
star
42

mcc-on-equinix-terraform-templates

mcc-on-equinix-terraform-templates
HCL
5
star
43

ceph-monitoring

Python
5
star
44

rabbitmq-autocluster

5
star
45

puppet-bootstrap

Bootstrap scripts for Foreman and Puppet servers
Shell
4
star
46

statkube

Kubernetes development stats
Go
4
star
47

openstack-fedora-specs

Shell
4
star
48

fuel-plugin-standalone-ceph

Puppet
4
star
49

nova-scheduler-volume-affinity-filter

Python
4
star
50

terraform-provider-k0sctl

Go
4
star
51

rally-plugins

Custom rally plugins for testing platform components
Python
4
star
52

zabbix-configuration-files

Zabbix configuration files
3
star
53

dataops-dataeng

A tool to scrape data from multiple integrations
Go
3
star
54

fuel-docs

Python
3
star
55

openstack-ha-tests

The repository with HA/destructive tests for OpenStack clouds
Python
3
star
56

telegraf

Go
3
star
57

kostyor-openstack-ansible

OpenStack Ansible driver for Kostyor.
Python
3
star
58

mos-tempest-runner

The repository with scripts which allow to run Tempest tests for OpenStack clouds
Python
3
star
59

security

Home of the Mirantis PSIRT
2
star
60

fuelweb-test

Python
2
star
61

mcp-common-scripts

Shell
2
star
62

stacklight-salt-model

Shell
2
star
63

launchpad-reports-summary

status
JavaScript
2
star
64

ucpbackup

Shell
2
star
65

puppet-savanna

Ruby
2
star
66

terraform-provider-msr

Go
2
star
67

docker-aptly

Shell
2
star
68

fuel-plugin-external-ceph

Puppet
2
star
69

tools-sustaining

Python
2
star
70

osagent

Python agent for Windows that sets password. Works with OpenStack + XCP
Python
2
star
71

astute

Ruby
2
star
72

container-cloud-cli

PowerShell
2
star
73

mos-ci-deployment-scripts

Shell
2
star
74

docker-jenkins

CSS
2
star
75

openstack-lbaas-cli

CLI for OpenStack LBaaS
Python
1
star
76

mirantis-demos

Shell
1
star
77

cvp-configuration

Shell
1
star
78

rpc_monitor

monitoring tools for oslo.messaging
Python
1
star
79

f2s

Python
1
star
80

mos-updates

1
star
81

docker-gerrit

CSS
1
star
82

openstack-k8s-virtual-lab

Shell
1
star
83

solar-qa

1
star
84

cvp-sanity-checks

Python
1
star
85

rundeck-cis-jobs

1
star
86

mira-ceph-ansible

Python
1
star
87

puppet-control-template

Generic template for Puppet Control repository
Ruby
1
star
88

fuel-provision

1
star
89

bird-containers

Shell
1
star
90

whale

Python
1
star
91

mos-components-ci

Shell
1
star
92

k8s-istio-webinar

Shell
1
star
93

k8srnd-sockshop-catalogue

Go
1
star
94

fuel-plugin-backup

Shell
1
star
95

ifmap-python-client

Python
1
star
96

rally

1
star
97

sriov-scheduler

Go
1
star
98

terraform-provider-mirantis

This is Mirantis' terraform module containing providers for all Mirantis products
Go
1
star
99

helm-charts

Smarty
1
star
100

ccp-docker-jenkins

Shell
1
star