kubernetes-ingress-controller
:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.
Top Related Projects
NGINX and NGINX Plus Ingress Controllers for Kubernetes
Ingress-NGINX Controller for Kubernetes
The Cloud Native Application Proxy
Connect, secure, control, and observe services.
Contour is a Kubernetes ingress controller using Envoy proxy.
Quick Overview
The Kong Kubernetes Ingress Controller is an open-source project that integrates Kong, a popular API gateway, with Kubernetes. It allows users to manage and secure their Kubernetes services using Kong's powerful features, such as authentication, rate limiting, and traffic control, directly through Kubernetes Ingress resources.
Pros
- Seamless integration with Kubernetes, leveraging native Ingress resources
- Provides advanced API gateway features like authentication, rate limiting, and traffic control
- Supports both Kong Enterprise and open-source versions
- Offers flexible configuration options through Custom Resource Definitions (CRDs)
Cons
- Steeper learning curve compared to simpler ingress controllers
- Requires additional resources to run Kong alongside Kubernetes
- May introduce complexity in smaller or simpler deployments
- Limited support for older Kubernetes versions
Getting Started
To get started with the Kong Kubernetes Ingress Controller, follow these steps:
- Install Kong Ingress Controller using Helm:
helm repo add kong https://charts.konghq.com
helm repo update
helm install kong kong/kong -n kong --create-namespace
- Create a simple Ingress resource:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
kubernetes.io/ingress.class: kong
spec:
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: example-service
port:
number: 80
- Apply the Ingress resource:
kubectl apply -f example-ingress.yaml
For more advanced configurations and usage, refer to the official documentation on the project's GitHub repository.
Competitor Comparisons
NGINX and NGINX Plus Ingress Controllers for Kubernetes
Pros of kubernetes-ingress
- More lightweight and focused specifically on Kubernetes ingress
- Simpler configuration and setup process
- Better performance for basic ingress scenarios
Cons of kubernetes-ingress
- Less feature-rich compared to Kong's solution
- Limited API gateway capabilities
- Fewer advanced traffic management options
Code Comparison
kubernetes-ingress configuration:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: example.com
http:
paths:
- path: /prefix(/|$)(.*)
pathType: Prefix
backend:
service:
name: example-service
port:
number: 80
kubernetes-ingress-controller configuration:
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: sample-customization
route:
methods:
- GET
- POST
strip_path: true
preserve_host: true
upstream:
hash_on: none
hash_fallback: none
healthchecks:
active:
healthy:
http_statuses:
- 200
interval: 5
successes: 5
Both controllers offer Kubernetes ingress functionality, but Kong's solution provides more advanced features and customization options at the cost of increased complexity. The kubernetes-ingress project is better suited for simpler deployments, while kubernetes-ingress-controller offers more powerful API gateway capabilities for complex scenarios.
Ingress-NGINX Controller for Kubernetes
Pros of ingress-nginx
- Officially supported by Kubernetes, ensuring compatibility and regular updates
- Simpler setup and configuration for basic use cases
- Extensive documentation and large community support
Cons of ingress-nginx
- Limited advanced features compared to Kong's offering
- May require additional components for complex routing scenarios
- Less flexibility in terms of customization and extensibility
Code Comparison
ingress-nginx configuration:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: example.com
http:
paths:
- path: /prefix(/|$)(.*)
pathType: Prefix
backend:
service:
name: example-service
port:
number: 80
kubernetes-ingress-controller configuration:
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: example-kong-ingress
route:
methods:
- GET
- POST
regex_priority: 0
strip_path: true
upstream:
hash_on: none
hash_fallback: none
healthchecks:
active:
healthy:
http_statuses:
- 200
interval: 5
successes: 5
The code examples demonstrate the different configuration approaches between the two controllers. ingress-nginx uses standard Kubernetes Ingress resources with annotations, while kubernetes-ingress-controller utilizes custom resources for more granular control over routing and upstream configurations.
The Cloud Native Application Proxy
Pros of Traefik
- Simpler configuration and easier to set up, especially for beginners
- Built-in support for multiple protocols (HTTP, TCP, UDP) and service discovery mechanisms
- More extensive middleware options out-of-the-box
Cons of Traefik
- Less scalable for very large deployments compared to Kubernetes Ingress Controller
- Limited advanced features and customization options
- Steeper learning curve for complex scenarios
Code Comparison
Traefik configuration example:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: myingress
spec:
entryPoints:
- web
routes:
- match: Host(`example.com`) && PathPrefix(`/api`)
kind: Rule
services:
- name: myservice
port: 80
Kubernetes Ingress Controller configuration example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myingress
annotations:
konghq.com/strip-path: "true"
spec:
rules:
- host: example.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: myservice
port:
number: 80
Both examples demonstrate routing configuration, but Traefik uses its custom IngressRoute resource, while Kubernetes Ingress Controller uses the standard Kubernetes Ingress resource with Kong-specific annotations.
Connect, secure, control, and observe services.
Pros of istio
- More comprehensive service mesh capabilities, including advanced traffic management, security, and observability features
- Built-in support for multi-cluster deployments and hybrid cloud environments
- Stronger ecosystem and community support, with a wider range of integrations and extensions
Cons of istio
- Higher complexity and steeper learning curve compared to simpler ingress controllers
- Increased resource consumption and potential performance overhead due to its extensive feature set
- May be overkill for smaller or less complex deployments that don't require full service mesh functionality
Code comparison
kubernetes-ingress-controller configuration:
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: sample-customization
route:
methods:
- GET
- POST
istio configuration:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sample-routing
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v1
Both projects provide Kubernetes-native configurations, but istio offers more granular control over traffic routing and service mesh features, while kubernetes-ingress-controller focuses on simpler ingress management.
Contour is a Kubernetes ingress controller using Envoy proxy.
Pros of Contour
- Lightweight and efficient, with a smaller resource footprint
- Built-in support for WebSocket and gRPC protocols
- Simpler configuration model, making it easier to set up and manage
Cons of Contour
- Less extensive feature set compared to Kong's ingress controller
- Limited plugin ecosystem and extensibility options
- Fewer advanced traffic management capabilities
Code Comparison
Contour configuration example:
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: example
spec:
virtualhost:
fqdn: example.com
routes:
- conditions:
- prefix: /
services:
- name: example-service
port: 80
Kong Ingress Controller configuration example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
annotations:
kubernetes.io/ingress.class: kong
spec:
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: example-service
port:
number: 80
Both examples demonstrate basic routing configuration, but Kong's ingress controller uses standard Kubernetes Ingress resources with annotations, while Contour uses its custom HTTPProxy resource for more advanced configurations.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Kong Ingress Controller for Kubernetes (KIC)
Use Kong for Kubernetes Gateway API or Ingress. Configure plugins, health checking, load balancing and more, all using Custom Resource Definitions (CRDs) and Kubernetes-native tooling.
Features | Get started | Documentation | main branch builds | Seeking help
Features
- Gateway API support Use Gateway API resources (official successor of Ingress resources) to configure Kong. Native support for TCP, UDP, TLS, gRPC and HTTP/HTTPS traffic, reuse the same gateway for multiple protocols and namespaces.
- Ingress support Use Ingress resources to configure Kong.
- Declarative configuration for Kong Configure all of Kong features in declarative Kubernetes native way with CRDs.
- Seamlessly operate Kong Scale and manage multiple replicas of Kong Gateway automatically to ensure performance and high-availability.
- Health checking and load-balancing Load balance requests across your pods and supports active & passive health-checks.
- Enhanced API management using plugins
Use a wide array of plugins for e.g.
- authentication
- request/response transformations
- rate-limiting
Get started (using Helm)
You can use Minikube or Kind on your local machine or use a hosted Kubernetes service like GKE.
Install the Gateway API CRDs
This command will install all resources that have graduated to GA or beta,
including GatewayClass
, Gateway
, HTTPRoute
, and ReferenceGrant
.
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
Or, if you want to use experimental resources and fields such as TCPRoute
s and UDPRoute
s,
please run this command.
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/experimental-install.yaml
Install the Kong Ingress Controller with Helm
helm install kong --namespace kong --create-namespace --repo https://charts.konghq.com ingress
To learn more details about Helm chart follow the Helm chart documentation.
Once installed, please follow the Getting Started guide to start using Kong in your Kubernetes cluster.
Note: Kong Enterprise users, please follow along with our enterprise guide to setup the enterprise version.
Get started (using Operator)
As an alternative to Helm, you can also install Kong Ingress Controller using the Kong Gateway Operator by following this quick start guide.
Container images
Release images
Release builds of Kong Ingress Controller can be found on Docker Hub in kong/kubernetes-ingress-controller repository.
At the moment we're providing images for:
- Linux
amd64
- Linux
arm64
main
branch builds
Nightly pre-release builds of the main
branch are available from the
kong/nightly-ingress-controller repository hosted on Docker Hub:
main
contains unreleased new features for upcoming minor and major releases:
docker pull kong/nightly-ingress-controller:nightly
Documentation
All documentation for the Kong Ingress Controller is present in the kong/docs.konghq.com repository. Pull Requests are welcome for additions and corrections.
Guides and Tutorials
Please browse through the guides to get started and to learn specific ingress controller operations.
Contributing
We â¤ï¸ pull requests and weâre continually working hard to make it as easy as possible for developers to contribute. Before beginning development with the Kong Ingress Controller, please familiarize yourself with the following developer resources:
Seeking help
Please search through the FAQs, posts on the discussions page or the Kong Nation Forums as it's likely that another user has run into the same problem. If you don't find an answer, please feel free to post a question.
If you've found a bug, please open an issue.
For a feature request, please open an issue using the feature request template.
You can also talk to the developers behind Kong in the #kong channel on the Kubernetes Slack server.
Community meetings
You can join monthly meetups hosted by Kong to ask questions, provide feedback, or just to listen and hang out. See the Online Meetups Page to sign up and receive meeting invites and Zoom links.
Preview and Experimental Features
At any time the KIC may include features or options that are considered experimental and are not enabled by default, nor available in the Kong Documentation Site.
To try out new features that are behind feature gates, please see the preview features in FEATURE_GATES.md and documentation for these preview features can be found in FEATURE_PREVIEW_DOCUMENTATION.md.
Top Related Projects
NGINX and NGINX Plus Ingress Controllers for Kubernetes
Ingress-NGINX Controller for Kubernetes
The Cloud Native Application Proxy
Connect, secure, control, and observe services.
Contour is a Kubernetes ingress controller using Envoy proxy.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot