Skip to content

Gravitee Operator for Kubernetes (GKO)

License

Notifications You must be signed in to change notification settings

gravitee-io/gravitee-kubernetes-operator

Repository files navigation

Gravitee.io Kubernetes Operator

License alpha semantic-release: 📦🚀 Go Report Card

Gravitee.io

Introduction

APIM 3.19.0 has introduced the first release of the Gravitee Kubernetes Operator (GKO).

You can use the GKO to define, deploy, and publish APIs to your API Portal and API Gateway through Custom Resource Definitions (CRDs).

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 local cluster, run the following commands:

# Initialize a local kubernetes cluster running APIM
make start-cluster

# 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 a Management 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 cluster-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

Working with the repo

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

Release process

To release a new version of the operator go to the dedicated Trigger Release workflow and run it with the default parameters.

This will:

  • checkout a new ci-prepare-release branch from alpha

  • rebase the master branch on top of it

  • open a pull request from ci-prepare-release to master

Once the pull request is merged, semantic release will automatically create a new release, which includes:

  • updating the changelog using conventional commits

  • publishing a new docker image on docker hub with the new version tag

  • publishing a new helm chart on helm.gravitee.io with the new version tag