# Start With Kubernetes

## Overview

open-appsec for Kubernetes protects web applications and APIs running in Kubernetes environments.\
It integrates with the popular [Ingress NGINX (Ingress Controller](https://kubernetes.github.io/ingress-nginx)), securing the ingress HTTP/S traffic to [Services](https://kubernetes.io/docs/concepts/services-networking/service/) inside Kubernetes [clusters](https://kubernetes.io/docs/concepts/architecture/).\
It also integrates with [Kong Gateway](https://konghq.com) (native Lua-based Kong plugin available) as well as [APISIX](https://apisix.apache.org/) API Gateways, securing distributed, exposed APIs at the API Gateway level.\
If you are using [Istio Service Mesh](https://istio.io/) with your Kubernetes clusters, you can integrate open-appsec directly with your existing [Istio Ingress Gateway](https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/).\
\
More integrations are planned to be added in the future (e.g. Envoy Gateway, Emissary Ingress).

{% tabs %}
{% tab title="Ingress NGINX" %}
The NGINX Ingress Controller and open-appsec for Kubernetes agent are deployed together with a single Helm chart. This diagram shows an example of a Kubernetes service exposed outside the Kubernetes cluster with an Ingress controller protected with open-appsec. The NGINX Ingress Controller container contains the open-appsec Attachment which communicates with the open-appsec Agent.



![](https://1225393248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNcZmX14M2KdTBrq9EOnI%2Fuploads%2FfT6upbIOyp10PjOzKmtJ%2Fimage.png?alt=media\&token=5f3616a4-e671-4631-85c1-ff6e081f6731)
{% endtab %}

{% tab title="Kong Gateway" %}
open-appsec can be flexibly integrated with Kong. This diagram shows K8s Web APIs/Apps exposed by an Kong API Gateway that is protected by open-appsec. Inside the Kong Gateway Pod there are following containers: Kong Gateway container, open-appsec Agent container and optional Kong Controller (Ingress Controller). Here open-appsec is integrated with the Kong Gateway container which contains the open-appsec Attachment for communication with the open-appsec Agent, this is implemented using a native Lua-based Kong plugin for attaching the open-appsec agent to the Kong Gateway.

<figure><img src="https://1225393248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNcZmX14M2KdTBrq9EOnI%2Fuploads%2Fta3h5sZuFH7UhhnlULqr%2FDeploy_Kong_Kubernetes_Elpis_updated.svg?alt=media&#x26;token=c5cbb46c-fd5f-49f8-9cf4-f91a14489007" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="APISIX gateway" %}
For Kubernetes based-deployments of APISIX integrated with open-appsec there’s a helm chart available, which is based on the official APISIX helm chart and further enhanced to also include the open-appsec attachment in the APISIX gateway container and the deployment of the open-appsec agent as a sidecar container in the same pod.

Here’s a simple architecture schematic for deployment on Kubernetes.

<figure><img src="https://1225393248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNcZmX14M2KdTBrq9EOnI%2Fuploads%2F9boh1hSUCU1V7PJwTipV%2Fimage.png?alt=media&#x26;token=94cf28a5-a476-4f18-aeb1-999c0b1f8bd2" alt="" width="563"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Istio Ingress Gateway" %}
open-appsec integrates with Istio Ingress Gateway in Kubernetes environments with Istio service mesh. This diagram shows K8s Web APIs/Apps exposed by an Istio Ingress Gateway that is protected by open-appsec. As part of the open-appsec deployment, using a K8s webhook, the open-appsec Agent container is injected automatically to the Istio Ingress Gateway pod and an Attachment filter is added to and loaded by the Envoy-based, `istio-proxy` container. This open-appsec Attachment filter is required for communication with the open-appsec Agent.

<figure><img src="https://1225393248-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNcZmX14M2KdTBrq9EOnI%2Fuploads%2Fp1WGoPojYryKoogTi5U5%2Fimage.png?alt=media&#x26;token=e539eae3-91d9-4047-a01a-0962436e47de" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Deployment Options

The recommended deployment option depends on the proxy solution you want to integrate with:

### Deployment with helm chart (recommended)

For integration with the following solutions, we provide a flexible helm chart, which is an extended version based on the original helm chart of the proxy solution to integrate with and offers separate, optional CRD deployment for locally, declaratively-managed deployments:&#x20;

* **Ingress NGINX**
* **APISIX API Gateway**
* Kong API Gateway (first generation of Kong integration using an NGINX attachment, an improved, native Kong integration using Lua-plugin is available further below!)

{% content-ref url="start-with-kubernetes/install-using-helm-new-flow-beta" %}
[install-using-helm-new-flow-beta](start-with-kubernetes/install-using-helm-new-flow-beta)
{% endcontent-ref %}

### Deployment with injector helm chart (recommended)

For integration with the following proxy solutions, we provide a helm chart, which is used additionally to the original helm chart of the solution to integrate with, this helm chart automatically injects all required open-appsec components using a Kubernetes webhook into the existing solution's deployment:&#x20;

* **Kong API Gateway** (recommended Kong integration, using native Lua-based attachment plugin)
* **Istio Ingress Gateway**

{% content-ref url="start-with-kubernetes/install-with-helm-using-webhook" %}
[install-with-helm-using-webhook](start-with-kubernetes/install-with-helm-using-webhook)
{% endcontent-ref %}

### First generation helm chart (will be deprecated soon)

Our first generation Kubernetes helm chart is an extended version based on the original helm chart of the proxy solution to integrate with, following proxy solutions are supported:

{% hint style="warning" %}
This will be deprecated soon, as more flexible, improved helm-based installation options were made available already. This is shown primarily for existing users that still use this early deployment option.
{% endhint %}

* Ingress NGINX
* APISIX API Gateway
* Kong API Gateway (first generation of Kong integration using an NGINX attachment, an improved, native Kong integration using Lua-plugin is available further below!)

{% content-ref url="start-with-kubernetes/install-using-helm" %}
[install-using-helm](start-with-kubernetes/install-using-helm)
{% endcontent-ref %}

{% hint style="success" %}
You can always connect your deployment later to the open-appsec [central management web UI](https://my.openappsec.io/) (provided as SaaS service), which provides cloud logging & reporting, central management and monitoring of multiple K8s clusters and an easy-to-use WebUI for all administrative tasks.
{% endhint %}
