Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions operators/stackable-listener-operator/25.11.0/manifests/Listener.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: listeners.listeners.stackable.tech
annotations:
helm.sh/resource-policy: keep
spec:
group: listeners.stackable.tech
names:
categories: []
kind: Listener
plural: listeners
shortNames: []
singular: listener
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1alpha1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ListenerSpec via `CustomResource`
properties:
spec:
description: |-
Exposes a set of pods to the outside world.

Essentially a Stackable extension of a Kubernetes Service. Compared to a Service, a Listener changes three things:
1. It uses a cluster-level policy object (ListenerClass) to define how exactly the exposure works
2. It has a consistent API for reading back the exposed address(es) of the service
3. The Pod must mount a Volume referring to the Listener, which also allows
["sticky" scheduling](https://docs.stackable.tech/home/25.11/listener-operator/listener#_sticky_scheduling).

Learn more in the [Listener documentation](https://docs.stackable.tech/home/25.11/listener-operator/listener).
properties:
className:
description: The name of the [ListenerClass](https://docs.stackable.tech/home/25.11/listener-operator/listenerclass).
nullable: true
type: string
extraPodSelectorLabels:
additionalProperties:
type: string
default: {}
description: Extra labels that the Pods must match in order to be exposed. They must _also_ still have a Volume referring to the Listener.
type: object
ports:
description: Ports that should be exposed.
items:
properties:
name:
description: |-
The name of the port.

The name of each port *must* be unique within a single Listener.
type: string
port:
description: The port number.
format: int32
type: integer
protocol:
description: The layer-4 protocol (`TCP` or `UDP`).
nullable: true
type: string
required:
- name
- port
type: object
nullable: true
type: array
publishNotReadyAddresses:
default: true
description: Whether incoming traffic should also be directed to Pods that are not `Ready`.
nullable: true
type: boolean
type: object
status:
description: Informs users about how to reach the Listener.
nullable: true
properties:
ingressAddresses:
description: All addresses that the Listener is currently reachable from.
items:
description: One address that a Listener is accessible from.
properties:
address:
description: The hostname or IP address to the Listener.
type: string
addressType:
description: The type of address (`Hostname` or `IP`).
enum:
- Hostname
- IP
type: string
ports:
additionalProperties:
format: int32
type: integer
description: Port mapping table.
type: object
required:
- address
- addressType
- ports
type: object
nullable: true
type: array
nodePorts:
additionalProperties:
format: int32
type: integer
description: |-
Port mappings for accessing the Listener on each Node that the Pods are currently running on.

This is only intended for internal use by listener-operator itself. This will be left unset if using a ListenerClass that does
not require Node-local access.
nullable: true
type: object
serviceName:
description: The backing Kubernetes Service.
nullable: true
type: string
type: object
required:
- spec
title: Listener
type: object
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: listenerclasses.listeners.stackable.tech
annotations:
helm.sh/resource-policy: keep
spec:
group: listeners.stackable.tech
names:
categories: []
kind: ListenerClass
plural: listenerclasses
shortNames: []
singular: listenerclass
scope: Cluster
versions:
- additionalPrinterColumns: []
name: v1alpha1
schema:
openAPIV3Schema:
description: Auto-generated derived type for ListenerClassSpec via `CustomResource`
properties:
spec:
description: |-
Defines a policy for how [Listeners](https://docs.stackable.tech/home/25.11/listener-operator/listener) should be exposed.
Read the [ListenerClass documentation](https://docs.stackable.tech/home/25.11/listener-operator/listenerclass)
for more information.
properties:
loadBalancerAllocateNodePorts:
default: true
description: |-
Configures whether a LoadBalancer service should also allocate node ports (like NodePort).

Ignored unless serviceType is LoadBalancer.
type: boolean
loadBalancerClass:
description: |-
Configures a custom Service loadBalancerClass, which can be used to access secondary
load balancer controllers that are installed in the cluster, or to provision
custom addresses manually.

Ignored unless serviceType is LoadBalancer.
nullable: true
type: string
pinnedNodePorts:
default: false
description: |-
Whether or not a Pod exposed using a NodePort should be pinned to a specific Kubernetes node.

By pinning the Pod to a specific (stable) Kubernetes node, stable addresses can be
provided using NodePorts. The pinning is achieved by listener-operator setting the
`volume.kubernetes.io/selected-node` annotation on the Listener PVC.

However, this only works on setups with long-living nodes. If your nodes are rotated on
a regular basis, the Pods previously running on a removed node will be stuck in Pending
until you delete the PVC with the pinning.

Because of this we don't enable pinning by default to support all environments.
type: boolean
preferredAddressType:
default: HostnameConservative
description: |-
Whether addresses should prefer using the IP address (`IP`) or the hostname (`Hostname`).
Can also be set to `HostnameConservative`, which will use `IP` for `NodePort` service types, but `Hostname` for everything else.

The other type will be used if the preferred type is not available.

Defaults to `HostnameConservative`.
enum:
- Hostname
- IP
- HostnameConservative
type: string
serviceAnnotations:
additionalProperties:
type: string
default: {}
description: Annotations that should be added to the Service object.
type: object
serviceExternalTrafficPolicy:
description: |-
Service Internal Traffic Policy enables internal traffic restrictions to only route internal
traffic to endpoints within the node the traffic originated from. The "internal" traffic
here refers to traffic originated from Pods in the current cluster. This can help to reduce
costs and improve performance. See [Kubernetes docs][k8s-docs].

[k8s-docs]: https://kubernetes.io/docs/concepts/services-networking/service-traffic-policy/
enum:
- Cluster
- Local
nullable: true
type: string
serviceType:
description: The method used to access the services.
enum:
- NodePort
- LoadBalancer
- ClusterIP
type: string
required:
- serviceType
type: object
required:
- spec
title: ListenerClass
type: object
served: true
storage: true
subresources: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: podlisteners.listeners.stackable.tech
annotations:
helm.sh/resource-policy: keep
spec:
group: listeners.stackable.tech
names:
categories: []
kind: PodListeners
plural: podlisteners
shortNames: []
singular: podlisteners
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1alpha1
schema:
openAPIV3Schema:
description: Auto-generated derived type for PodListenersSpec via `CustomResource`
properties:
spec:
description: |-
Informs users about Listeners that are bound by a given Pod.

This is not expected to be created or modified by users. It will be created by
the Stackable Listener Operator when mounting the listener volume, and is always
named `pod-{pod.metadata.uid}`.
properties:
listeners:
additionalProperties:
properties:
ingressAddresses:
description: |-
Addresses allowing access to this Pod.

Compared to `ingress_addresses` on the Listener status, this list is restricted to addresses that can access this Pod.

This field is intended to be equivalent to the files mounted into the Listener volume.
items:
description: One address that a Listener is accessible from.
properties:
address:
description: The hostname or IP address to the Listener.
type: string
addressType:
description: The type of address (`Hostname` or `IP`).
enum:
- Hostname
- IP
type: string
ports:
additionalProperties:
format: int32
type: integer
description: Port mapping table.
type: object
required:
- address
- addressType
- ports
type: object
nullable: true
type: array
scope:
description: '`Node` if this address only allows access to Pods hosted on a specific Kubernetes Node, otherwise `Cluster`.'
enum:
- Node
- Cluster
type: string
required:
- scope
type: object
description: |-
All Listeners currently bound by the Pod.

Indexed by Volume name (not PersistentVolume or PersistentVolumeClaim).
type: object
required:
- listeners
type: object
required:
- spec
title: PodListeners
type: object
served: true
storage: true
subresources: {}
Loading