8000
Skip to content

khestia/gravitee-kubernetes-operator

 
 

Repository files navigation

Gravitee.io Kubernetes Operator

License CircleCI semantic-release: 📦🚀 Go Report Card

Gravitee.io

Introduction

APIM 3.19.0 has introduced the BETA release of the Gravitee Kubernetes Operator (GKO) - a new technical component designed to be deployed on an existing APIM-ready Kubernetes Cluster. It can also be deployed on a local cluster for testing purposes.

You can use the GKO to define, deploy, and publish APIs to your API Portal and API Gateway and to manage Custom Resource Definitions (CRDs) as part of the process.

In future releases, the GKO will support additional functionality to enable the following:

  • Using the GKO as an Ingress Controller for deploying Ingresses to an API Gateway.

  • Deploying Gravitee products (API Management, Access Management, Alert Engine).

  • Improving automation processes through covering CICD aspects when using Kubernetes with APIM.

  • Managing most API Management resources without directly relying on the Console or on the Management API.

Note
The GKO is currently in BETA and only works with APIM version 3.19.0 (and above). Version 1.0 (GA) is planned for the end of 2022 as part of the release of APIM 3.20.0. Until then, the source code will continue to be subject to further development, which could result in breaking changes - please do not use in production.

User documentation

You can find detailed information about the Gravitee Kubernetes Operator in the following sections of the Gravitee user documentation:

The GKO API reference documentation is available here.

Developer guide

Initialize your environment

Install tooling for development

All the tool needed to run the make targets used during development can be installed by running the following command:

make install-tools

To get more information about the available make targets, run:

make help

Run the operator locally

To run the operator locally against an APIM-ready k3d cluster, run the following commands:

# Initialize a local kubernetes cluster running APIM
make k3d-init

# Install the operator CRDs into the cluster
make install

# Run the operator controller on your local machine
make run

Debug the operator and APIM

To be able to run the operator against a local instance of both an APIM Gateway and an APIM Management API, you will need to:

  • Attach to a local cluster context.

  • Create a local service account to authenticate the gateway against the local cluster.

  • Create an API Context pointing to your local APIM Management API.

  • Run what you need to debug in debug mode.

# Create a service account token with 'cluster-admin' role in the current context and
# use this token to authenticate against the current cluster
make k3d-admin

make run # or run using a debugger if you need to debug the operator as well

# Create the debug Management Context resource for APIM
kubectl apply -f ./config/samples/context/debug/api-context-with-credentials.yml

# Create a basic API Definition resource
kubectl apply -f ./config/samples/apim/api-with-context.yml

Run the operator as a deployment on the k3d cluster

Some features and behaviors of the operator can only be tested when running it as a deployment on the k3d cluster.

This is a case for e.g. for webhooks or when testing the operator deployed in multiple namespaces.

You can deploy the operator on your k3d cluster by running the following commands:

make k3d-build k3d-push k3d-deploy

Working with the repo

When committing your contributions, please follow conventional commits and semantic release best practices.

Release process

/!\ All new changes should be committed to the alpha branch.

To create a new release, we need to merge alpha into master. A github action do the job.

Go in the Actions tab and select the Trigger Release workflow. Run it with the following parameters:

  • Source branch: alpha

  • Target branch: master

A new release is automatically created on master and a new tag is pushed. When a new tag is pushed, a github action Sync Branches is triggered to rebase alpha on master.

Troubleshooting

Local Docker image registry

The k3d registry host used to share images between your host and your k3d cluster is defined as k3d-graviteeio.docker.localhost. On most linux / macos platforms, *.localhost` should resolve to 127.0.0.1. If this is not the case on your device, you need to add the following entry in your /etc/hosts file:

127.0.0.1 k3d-graviteeio.docker.localhost

About

Gravitee Operator for Kubernetes (GKO)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 84.6%
  • JavaScript 8.2%
  • Makefile 4.7%
  • Dockerfile 1.1%
  • Other 1.4%
0