Labels and annotations for Airlock Microgateway
Label to inject Microgateway Engine in application Pods
The Microgateway Operator injects the Microgateway Engine containers to the upstream application Pods triggered by the label following label:
See also example manifests w/o Istio mesh configuration at the end of this article.
Adding the label to an existing, running Pod has no effect. Use kubectl apply -f <deployment.yaml>
to apply the configuration changes and to have the Microgateway Engine injected with a Deployment.
Annotations for the Microgateway Operator
Annotations can be added to configure some general behavior of the container. The table below lists and explains the annotations the Microgateway Operator is aware of.
Annotation | Default | Possible values | Description |
---|---|---|---|
| “” | “<int>, ...” | Comma-separated list of inbound ports to be excluded from redirection to the Microgateway Engine by the Microgateway CNI plugin. Notice The Istio default ports for the Istio sidecar proxy are automatically excluded when setting the annotation This means ports:
|
|
|
| Annotation to set which service mesh should be used. This annotation is relevant info for the Microgateway CNI plugin to configure the redirection of the traffic to the Microgateway Engine correctly. |
|
|
| Annotation to set the Microgateway Engine log level. |
| By default, no engine resource requirements are set. Engine resources can be set via annotation or Helm values. If both are set, annotations take precedence. | 1, 100m, 0.5, ... | Overrides |
| By default, no engine resource requirements are set. Engine resources can be set via annotation or Helm values. If both are set, annotations take precedence. | 1, 100m, 0.5, ... Any CPU resource unit can be used. | Overrides |
| By default, no engine resource requirements are set. Engine resources can be set via annotation or Helm values. If both are set, annotations take precedence. | 64Mi, 1G, ... Any Kubernetes memory resource unit can be used. | Overrides |
| By default, no engine resource requirements are set. Engine resources can be set via annotation or Helm values. If both are set, annotations take precedence. | 128Mi, 1G, ... Any Kubernetes memory resource unit can be used. | Overrides |
Example configuration for a web application without Istio
The following example Kubernetes manifest file contains annotations to protect the web application with Airlock Microgateway.
Ensure that in such a setup the annotation sidecar.microgateway.airlock.com/serviceMesh
is set to none
or not set at all.
SidecarGateway configuration to protect a web application:
- Our example uses a simple web application Pod with the label
app: example-app
. - The
spec.applications.containerPort
is the container port of the web application that has to be secured by Airlock Microgateway. The default8080
can be overridden to connect to the application's HTTP port. In our example, theexample-app
Pod listens for requests on port5051
. - The security settings to be applied are referenced in the CR
ContentSecurity
namedcontent-security-example
.
This setup is still possible if Istio is deployed in your Kubernetes cluster. The important thing is, that the web application Pod does not have Istio injected. Neither through labeling the namespace nor with the corresponding annotation. For more information consult (Istio) Sidecar injection.
Example for a web application with Istio
The following example Kubernetes manifest file contains annotations to protect the web application with Airlock Microgateway alongside Istio service mesh:
Ensure that in such a setup the annotation sidecar.microgateway.airlock.com/serviceMesh
is set to istio
.
SidecarGateway configuration to protect a web application:
- Our example uses a simple web application Pod with the label
app: example-app
. - The
spec.applications.containerPort
is the container port of the web application that has to be secured by Airlock Microgateway. The default8080
can be overridden to connect to the application's HTTP port. In our example, theexample-app
Pod listens for requests on port5051
. - The security settings to be applied are referenced in the CR
ContentSecurity
namedcontent-security-example
.
The web application Pod has Istio injected. The example illustrates the way by annotating the Pod. For more information consult (Istio) Sidecar injection.
Further information and links
Internal links:
- Architecture with injected sidecars: Architecture without a service mesh
- Architecture with injected sidecars and Istio service mesh: Architecture with Istio