Careful!

You are browsing documentation for a version of Kuma that is not the latest release.

MeshGatewayInstance

MeshGatewayInstance is a Kubernetes-only resource for deploying Kuma’s builtin gateway.

MeshGateway and MeshGatewayRoute allow specifying builtin gateway listener and route configuration but don’t handle deploying kuma-dp instances that listen and serve traffic.

Kuma offers MeshGatewayInstance to manage a Kubernetes Deployment and Service that together provide service capacity for the MeshGateway with the matching kuma.io/service tag.

If you’re not using the default Mesh, you’ll need to label the MeshGatewayInstance using kuma.io/mesh.

Consider the following example:

apiVersion: kuma.io/v1alpha1
kind: MeshGatewayInstance
metadata:
  name: edge-gateway
  namespace: default
  labels:
    kuma.io/mesh: default # only necessary if not using default Mesh
spec:
  replicas: 2
  serviceType: LoadBalancer
  tags:
    kuma.io/service: edge-gateway

Once a MeshGateway exists with kuma.io/service: edge-gateway, the control plane creates a new Deployment in the default namespace. This Deployment deploys 2 replicas of kuma-dp and corresponding builtin gateway Dataplane running with kuma.io/service: edge-gateway. The control plane also creates a new Service to send network traffic to the builtin Dataplane pods. The Service is of type LoadBalancer, and its ports are automatically adjusted to match the listeners on the corresponding MeshGateway.

Customization

Additional customization of the generated Service or Pods is possible via spec.serviceTemplate and spec.podTemplate. For example, you can add annotations and/or labels to the generated objects:

spec:
  replicas: 1
  serviceType: LoadBalancer
  tags:
    kuma.io/service: edge-gateway
  resources:
    limits: ...
    requests: ...
  serviceTemplate:
    metadata:
      annotations:
        service.beta.kubernetes.io/aws-load-balancer-internal: "true"
    spec:
      loadBalancerIP: ...
  podTemplate:
    metadata:
      labels:
        app-name: my-app
        ...

You can also modify several security-related parameters for the generated Pods or specify a loadBalancerIP for the Service:

spec:
  replicas: 1
  serviceType: LoadBalancer
  tags:
    kuma.io/service: edge-gateway
  resources:
    limits: ...
    requests: ...
  serviceTemplate:
    metadata:
      labels:
        svc-id: "19-001"
    spec:
      loadBalancerIP: ...
  podTemplate:
    metadata:
      annotations:
        app-monitor: "false"
    spec:
      serviceAccountName: my-sa
      securityContext:
        fsGroup: ...
      container:
        securityContext:
          readOnlyRootFilesystem: true

See also

Schema

apiVersion string
APIVersion defines the versioned schema of this representation of an object. Servers should convert ...
kind string
Kind is a string value representing the REST resource this object represents. Servers may infer this...
metadata object
spec object
MeshGatewayInstanceSpec specifies the options available for a GatewayDataplane.
PodTemplate configures the Pod owned by this config.
Metadata holds metadata configuration for a Service.
annotations object
Annotations holds annotations to be set on an object.
labels object
Labels holds labels to be set on an objects.
Spec holds some customizable fields of a Pod.
Container corresponds to PodSpec.Container
ContainerSecurityContext corresponds to PodSpec.Container.SecurityContext
readOnlyRootFilesystem boolean
ReadOnlyRootFilesystem corresponds to PodSpec.Container.SecurityContext.ReadOnlyRootFilesystem
PodSecurityContext corresponds to PodSpec.SecurityContext
fsGroup integer
FSGroup corresponds to PodSpec.SecurityContext.FSGroup
serviceAccountName string
ServiceAccountName corresponds to PodSpec.ServiceAccountName.
replicas integer
Replicas is the number of dataplane proxy replicas to create. For now this is a fixed number, but in...
Default: 1
Resources specifies the compute resources for the proxy container. The default can be set in the con...
Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container...
name string required
Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used...
limits object
Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/d...
requests object
Requests describes the minimum amount of compute resources required. If Requests is omitted for a co...
ServiceTemplate configures the Service owned by this config.
Metadata holds metadata configuration for a Service.
annotations object
Annotations holds annotations to be set on an object.
labels object
Labels holds labels to be set on an objects.
Spec holds some customizable fields of a Service.
loadBalancerIP string
LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
serviceType enum
ServiceType specifies the type of managed Service that will be created to expose the dataplane proxi...
Values: LoadBalancer | ClusterIP | NodePort
Default: "LoadBalancer"
tags object
Tags specifies the Kuma tags that are propagated to the managed dataplane proxies. These tags should...
status object
MeshGatewayInstanceStatus holds information about the status of the gateway instance.
Conditions is an array of gateway instance conditions.
lastTransitionTime string required
lastTransitionTime is the last time the condition transitioned from one status to another. This shou...
message string required
message is a human readable message indicating details about the transition. This may be an empty st...
observedGeneration integer
observedGeneration represents the .metadata.generation that the condition was set based upon. For in...
reason string required
reason contains a programmatic identifier indicating the reason for the condition's last transition....
status enum required
status of the condition, one of True, False, Unknown.
Values: True | False | Unknown
type string required
type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are ...
LoadBalancer contains the current status of the load-balancer, if one is present.
Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service ...
hostname string
Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)
ip string
IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balanc...
ipMode string
IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is sp...
Ports is a list of records of service ports If used, every port defined in the service should have a...
error string
Error is to record the problem with the service port The format of the error shall comply with the f...
port integer required
Port is the port number of the service port of which status is recorded here
protocol string required
Protocol is the protocol of the service port of which status is recorded here The supported values a...
Default: "TCP"