AppController is a pod that you can spawn in your Kubernetes cluster which will take care of your co...
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
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.
AppController uses three basic concepts:
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 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_factorkey with stringified percentage integer value of how many replicas should be ready to fulfill the status check.
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.
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: ```yaml apiVersion: appcontroller.k8s/v1alpha1 kind: Dependency metadata: name: dependency-1 parent: pod/
apiVersion: appcontroller.k8s/v1alpha1 kind: Dependency metadata: name: dependency-2 parent: pod/
apiVersion: appcontroller.k8s/v1alpha1 kind: Dependency metadata: name: dependency-3 parent: job/
apiVersion: appcontroller.k8s/v1alpha1 kind: Dependency metadata: name: dependency-4 parent: replicaset/ child: job/ meta: success_factor: "80" ``` Load it to k8s:
kubectl create -f dependencies_file.yaml
Start the graph deployment:
kubectl exec k8s-appcontroller kubeac -- run
Use the following command:
kubectl exec k8s-appcontroller kubeac -- get-status
to get current status of deployment. You might use
-rto get detailed report or
-jto get a JSON representation of status.
In order to build, issue::
This would vendor the dependencies with glide and build the container with a given tag. The default tag is
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.yamlfile for you to fill).
Example value of this variable could be
app=app1. AppController pod with this value in
KUBERNETES_AC_LABEL_SELECTORvariable will work only with Dependencies and Definitions that contain
app: app1key-value pair in their
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
kubeac deploycommand available on AppController pod, but this should be only done for testing purposes and is not encouraged in production.
Here is the brief list of our mid term Roadmap: