Skip to content

MartinMekk/naiserator

 
 

Repository files navigation

Naiserator

CircleCI Go Report Card

Naiserator is a Kubernetes operator that handles the lifecycle of the CustomResource called nais.io/Application. The main goal of Naiserator is to simplify application deployment by providing a high-level abstraction tailored for the NAIS-platform. Naiserator supersedes naisd.

When an Application resource is created in Kubernetes (see example application), Naiserator will generate several resources that work together to form a complete deployment:

  • Deployment that runs a specified number of application instances,
  • Service which points to the application endpoint,
  • Ingress adding TLS termination and virtualhost support,
  • Horizontal pod autoscaler for automatic application scaling,
  • Service account for granting correct permissions to managed resources.

These resources will remain in Kubernetes until the Application resource is deleted.

Migrating from naisd

In order to switch from naisd to Naiserator, you need to complete a few migration tasks. See migration from naisd to naiserator for a detailed explanation of the steps involved.

Prerequisites

Deployment

Development

  • The Go programming language, version 1.11 or later
  • Docker Desktop or other Docker release compatible with Kubernetes
  • Kubernetes, either through minikube or a local cluster

Installation

You can deploy the most recent release of Naiserator by applying to your cluster:

kubectl apply -f hack/resources/

Development

Go modules are used for dependency tracking. Make sure you do export GO111MODULE=on before running any Go commands. It is no longer needed to have the project checked out in your $GOPATH.

kubectl apply -f pkg/apis/naiserator/v1alpha1/application.yaml
kubectl apply -f examples/app.yaml
make local

Code generation

In order to use the Kubernetes Go library, we need to use classes that work together with the interfaces in that library. Those classes are mostly boilerplate code, and to ensure healthy and happy developers, we use code generators for that.

When the CRD changes, or additional Kubernetes resources need to be generated, you have to run code generation:

make codegen-crd
make codegen-updater
git add -A
git commit -a -m "Update boilerplate k8s API code"

About

nais application operator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 92.1%
  • Shell 3.4%
  • Smarty 2.5%
  • Makefile 1.3%
  • Dockerfile 0.7%