pilot-operator

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2019 License: GPL-3.0 Imports: 23 Imported by: 0

README

Kubernetes Pilot Operator

Build Status

Kubernetes operator to manage and deploy Java, NodeJS and web applications.

API documentation

Docker image on Docker Hub

Requirements

  • Kubernetes 1.14.x / 1.13.x (other versions are not tested yet)
  • Go 1.12.x
  • Operator SDK v0.10.0

Local

Build

go mod vendor -v
operator-sdk build image_name

Tests

operator-sdk test local ./test/e2e --up-local --namespace default

This will use the default ~/.kube/config configuration or you can modify the env variable KUBECONFIG.

Motivations

Ansible has a push only strategy and does not sync well resources. If you delete a deployment from the Ansible vars, you should also remember to delete it manually from the cluster. Therefore, the architecture is not immutable.

We also found limitations with Kustomize which does not handle loops and complex logic because it was not designed for it. We used Helm instead but we've had issues syncing the versions from our CI/CD pipelines which only updates the tag and our source value file was not being synced. We did not want to manage the charts directly in each repository to avoid misconfiguration and syncing work accross our dozen microservices. We also had to duplicate the main charts to have default values between NodeJS, Java and Web applications. With Helm 2, Tiller also had lots of security issues and deploying multiple Tiller instances made the workflow more complex.

Pilot operator is designed to fix the limitations we've had and to manage deployments, hpa and services with simpler pipelines, logic and more flexible configuration files. Getting back to the core of what makes Kubernetes great and avoiding pushing the limits of Helm and Kustomize too far just because it did not meet our needs.

Pilot operator deployment

With kubectl:

git clone https://github.com/neo9/pilot-operator
cd pilot-operator/deploy
kubectl -n [namespace] apply -f ./crds
kubectl -n [namespace] apply -f ./

With Helm:

helm repo add n9 https://n9-charts.storage.googleapis.com
helm upgrade -i \
  --namespace integration \
  pilot n9/pilot-operator

# If you are deploying a second instance, crd are already created
# You can use --no-crd-hook instead
helm install --no-crd-hook \
  --namespace another-namespace \
  --name pilot n9/pilot-operator

Examples

Application

API documentation

apiVersion: pilot.neo9.fr/v1alpha1
kind: Application
metadata:
  name: my-api
  namespace: integration
spec:
  type: java
  repository: eu.gcr.io/example/my-api
  initTag: v0.0.1
  service:
    targetPort: 8080
  pod:
    secrets:
      - name: my-api
        key: MONGO_URI

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
pkg
apis/pilot
Package pilot contains pilot API versions.
Package pilot contains pilot API versions.
apis/pilot/v1alpha1
Package v1alpha1 contains API Schema definitions for the pilot v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=pilot.neo9.fr
Package v1alpha1 contains API Schema definitions for the pilot v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=pilot.neo9.fr
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL