apigateway-operator

command module
v0.0.0-...-c3747e5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

README

apigateway-operator

!!WIP!!

kubernetes operator that dynamically adds services to an ingress resource

This project defines a CustomResourceDefinition ApiGateway and an Operator that brings this CRD to life.

The Apigateway Operator creates an Ingress for every apigateway. The ingress handles traffic for every service, that has a label with then same name "XY" as specified in the ApiGateways attribute ServiceLabel.

Every Service with this Label is added to the Ingress. The value of the label serves as the path in the ingress.

For an ApiGateway

apiVersion: cw.com/v1
kind: ApiGateway
metadata:
  name: christians-apigateway2
spec:
  serviceLabel: labelOfServicesThatHAveTobeAddedToIngress

an Ingress is created like that:

apiVersion: cw.com/v1
kind: ApiGateway
metadata:
  name: christians-apigateway2
spec:
  serviceLabel: labelOfServicesThatHAveTobeAddedToIngress
  host: cw.de
  backend:
    serviceName: lumpensammler
    servicePort: 8080

If a service with the label labelOfServicesThatHAveTobeAddedToIngress is created

apiVersion: cw.com/v1
kind: ApiGateway
metadata:
  name: christians-apigateway2
spec:
  serviceLabel: labelOfServicesThatHAveTobeAddedToIngress
  host: cw.de
  backend:
    serviceName: lumpensammler
    servicePort: 8080

then this service is adde automatically to the ingress

Name:             christians-apigateway2-ingress
Namespace:        default
Address:
Default backend:  lumpensammler:8080 (<none>)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *
        /pathforthiservice   servicetest:10001 (10.244.0.36:6379,10.244.0.37:6379)
Annotations:
Events:  <none>

Custom Resource Defintion

First thing that's needed for a new Operator is a custom resource definition as specified in api-gateway-crd.yaml

This can be added with

kubectl apply -f api-gateway-crd.yaml

Check the new crd is installed:

kubectl get crd

Just to try it: create the first api-gateway, check that it is there and delete it again

kubectl apply -f api-gateway.yaml

kubectl get ApiGateway

kubectl describe ApiGateway apigateway

# kubectl delete apigateway apigateway

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
apis/apigateway/v1alpha
Package v1alpha is the v1alpha version of the API.
Package v1alpha is the v1alpha version of the API.
generated/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/apigateway/v1alpha
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/apigateway/v1alpha/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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