KubernetesOperator Custom Resource

apiVersion: ngrok.k8s.ngrok.com/v1alpha1

kind: KubernetesOperator

The KubernetesOperator custom resource handles synchronizing the state of your ngrok Kubernetes operator instance with the ngrok API. A KubernetesOperator resource is created automatically when you install the ngrok operator with Helm and has configuration that matches your installation options from Helm so that you can identify it in the ngrok cloud.

KubernetesOperator Structure and Types

The following outlines the high level structure and typings of a KubernetesOperator
apiVersion: ngrok.k8s.ngrok.com/v1alpha1
kind: KubernetesOperator
metadata:
  name: <string>
  namespace: <string>
spec:
  description: <string>           # optional, default: "Created by the ngrok-operator"
  metadata: <string>              # optional, default: "{"owned-by":"ngrok-operator"}"
  enabledFeatures: <[]string>     # optional
  region: <string>                # required, default: "global"
  deployment:                     # optional
    name: <string>                # required
    namespace: <string>           # required
    version: <string>             # required
  binding:                        # optional
    endpointSelectors: <[]string> # required
    ingressEndpoint: <string>     # optional
    tlsSecretName: <string>       # required, default: "default-tls"

KubernetesOperator Fields

The following sections outline each field of the KubernetesOperator custom resource, whether they are required, what their default values are (if applicable), and a description of their purpose/constraints.

spec

spec defines the desired state of the KubernetesOperator Type: Object Required: yes Default: none Fields:
Field NameTypeRequiredDefaultDescription
spec.descriptionstringno"Created by the ngrok-operator"Human-readable description for this KubernetesOperator to help identify/describe it
spec.metadatastringno"{"owned-by":"ngrok-operator"}"String of arbitrary data associated with the object in the ngrok API/Dashboard
spec.enabledFeatures[]string (enum)nononeList of the features that are enabled for this instance of the ngrok Kubernetes operator
spec.regionstringyes"global"The ngrok region in which the ingress for this operator is served
spec.deploymentObjectnononeDeployment information for this instance of the ngrok Kubernetes Operator
spec.bindingObjectnononeConfiguration of the binding feature for this instance of the ngrok Kubernetes Operator

spec.description

Human-readable description of this object that can be used to help identify/describe it. Type: string Required: no Default: "Created by the ngrok-operator"

spec.metadata

String of arbitrary data associated with the object in the ngrok API/Dashboard. Type: string Required: no Default: "{"owned-by":"ngrok-operator"}"

spec.enabledFeatures

List of the features that are enabled for this instance of the ngrok Kubernetes operator Type: []string Required: no Default: none Allowed Values: "ingress", "gateway", "bindings"

spec.region

The ngrok region in which the ingress for this operator is served. Type: string (enum) Required: no Default: "global" Allowed Values: "au", "eu", "ap", "us", "jp", "in", "sa", "global"

spec.deployment

Deployment information for this instance of the ngrok Kubernetes Operator. Type: Object Required: no Default: none Fields:
Field NameTypeRequiredDefaultDescription
spec.deployment.namestringyesnoneThe name of the Kubernetes Deployment for this intance of the ngrok Kubernetes operator
spec.deployment.namespacestringyesnoneThe namespace of the Kubernetes Deployment for this intance of the ngrok Kubernetes operator
spec.deployment.versionstringyesnoneThe version of the Kubernetes Deployment for this intance of the ngrok Kubernetes operator

spec.deployment.name

The name of the Kubernetes Deployment for this intance of the ngrok Kubernetes operator Type: string Required: yes Default: none

spec.deployment.namespace

The namespace of the Kubernetes Deployment for this intance of the ngrok Kubernetes operator Type: string Required: yes Default: none

spec.deployment.version

The version of the Kubernetes Deployment for this intance of the ngrok Kubernetes operator Type: string Required: yes Default: none

spec.binding

Configuration of the binding feature for this intance of the ngrok Kubernetes Operator Type: Object Required: no Default: none Fields:
Field NameTypeRequiredDefaultDescription
spec.binding.endpointSelectors[]stringyesnoneList of CEL expressions that determine which kubernetes-bound Endpoints will be created by the operator
spec.binding.ingressEndpointstringnononeThe public ingress endpoint for this Kubernetes Operator
spec.binding.tlsSecretNamestringyesnoneThe name of the Kubernetes Secret that contains the TLS private/public keys to use for the ngrok forwarding endpoint

spec.binding.endpointSelectors

List of cel expression that determine which kubernetes-bound Endpoints will be created by the operator Type: []string Required: yes Default: none

spec.binding.ingressEndpoint

The public ingress endpoint for this Kubernetes Operator Type: string Required: no Default: none

spec.binding.tlsSecretName

The name of the Kubernetes Secret that contains the TLS private/public keys to use for the ngrok forwarding endpoint Type: string Required: yes Default: "default-tls"

Example KubernetesOperator

apiVersion: ngrok.k8s.ngrok.com/v1alpha1
kind: KubernetesOperator
metadata:
  name: ngrok-operator
  namespace: ngrok-operator
spec:
  description: Created by ngrok-operator
  metadata: '{"owned-by":"ngrok-operator"}'
  binding:
    endpointSelectors:
    - "true"
    ingressEndpoint: kubernetes-binding-ingress.ngrok.io:443
    tlsSecretName: ngrok-operator-default-tls
  deployment:
    name: ngrok-operator
    namespace: ngrok-operator
    version: 0.15.0
  enabledFeatures:
  - ingress
  - gateway
  - bindings
  region: global