krakend

module
v0.0.0-...-7e39f45 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT

README

KrakenD Operator for Kubernetes

Kubernetes operator for installing and managing KrakenD - an open-source API Gateway - in Kubernetes namespaces.

Overview

The KrakenD Kubernetes Operator simplifies the deployment and management of the KrakenD API Gateway and its configurations within Kubernetes namespaces.

Features

  • Automated Deployment: Install and manage KrakenD API Gateway using custom resources.
  • Configuration Management: Simplify API endpoint configurations with sane defaults.
  • Custom Resources: Utilize Krakend and ApiEndpoints custom resources for deployment and configuration.

Getting Started

Prerequisites
  • A Kubernetes cluster (local or remote)
  • kubectl configured to interact with your cluster
  • Helm installed
Installation
  1. Install Custom Resource Definitions (CRDs):
kubectl apply -k config/crd/
  1. Deploy the Operator:
make deploy IMG=<your-registry>/krakend:latest
Usage
Deploying KrakenD

Create a Krakend resource to deploy KrakenD in your namespace:

apiVersion: krakend.nais.io/v1
kind: Krakend
metadata:
  name: my-namespace
  namespace: my-namespace
spec:
  ingress:
  enabled: true
  className: your-ingress-class
  annotations: {}
  hosts:
    - host: my-namespace.nais.io
    paths:
      - path: /
      pathType: ImplementationSpecific
  authProviders:
  - name: some-jwt-auth-provider
    alg: RS256
    jwkUrl: https://the-jwk-url
    issuer: https://the-jwt-issuer
  deployment:
  replicaCount: 2
  image:
    tag: 2.4.3
  resources:
    limits:
    cpu: 100m
    memory: 128Mi
    requests:
    cpu: 100m
    memory: 128Mi

Apply the resource:

kubectl apply -f <your-krakend-resource.yaml>
Configuring API Endpoints

Create an ApiEndpoints resource to define your API endpoints:

apiVersion: krakend.nais.io/v1
kind: ApiEndpoints
metadata:
  name: app1
  namespace: my-namespace
spec:
  appName: app1
  auth:
  name: some-jwt-auth-provider
  cache: true
  debug: true
  audience:
    - "audience1"
  scopes:
    - "scope1"
  rateLimit:
  maxRate: 10
  clientMaxRate: 0
  strategy: ip
  capacity: 0
  clientCapacity: 0
  endpoints:
  - path: /app1/somesecurestuff
    method: GET
    backendHost: http://app1
    backendPath: /somesecurestuff
  - path: /anotherapp
    method: GET
    backendHost: https://anotherapp.nais.io
    backendPath: /
  openEndpoints:
  - path: /doc
    method: GET
    backendHost: http://app1
    backendPath: /doc

Apply the resource:

kubectl apply -f <your-apiendpoints-resource.yaml>

Development

Running Locally
  1. Install Sample Custom Resources:
kubectl apply -k config/samples/
  1. Build and Push Docker Image:
make docker-build docker-push IMG=<your-registry>/krakend:latest
  1. Deploy the Controller:
make deploy IMG=<your-registry>/krakend:latest
Uninstalling

To remove the CRDs and the controller:

make uninstall
make undeploy

Contributing

Contributions are welcome! Please refer to the CONTRIBUTING.md for guidelines.

Additional Resources

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the krakend v1 API group +kubebuilder:object:generate=true +groupName=krakend.nais.io
Package v1 contains API Schema definitions for the krakend v1 API group +kubebuilder:object:generate=true +groupName=krakend.nais.io
cmd
samples command
internal
pkg
migration module

Jump to

Keyboard shortcuts

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