Documentation ¶
Index ¶
- Constants
- Variables
- func MakeJSMChannelServiceName(name string) string
- func MakeK8sService(kc *v1alpha1.NatsJetStreamChannel, opts ...ServiceOption) (*corev1.Service, error)
- func MakeRoleBinding(ns, name string, sa *corev1.ServiceAccount, roleName string, ...) *rbacv1.RoleBinding
- func MakeServiceAccount(namespace, name string) *corev1.ServiceAccount
- type DispatcherDeploymentArgs
- type DispatcherDeploymentBuilder
- type DispatcherServiceArgs
- type DispatcherServiceBuilder
- type ServiceOption
Constants ¶
const ( ChannelLabelKey = "messaging.knative.dev/channel" ChannelLabelValue = "nats-jetstream-channel" RoleLabelKey = "messaging.knative.dev/role" DispatcherRoleLabelValue = "dispatcher" ControllerRoleLabelValue = "controller" )
const ( MessagingRoleLabel = "messaging.knative.dev/role" MessagingRole = "nats-jetstream-channel" )
const (
DispatcherContainerName = "dispatcher"
)
Variables ¶
var ( DispatcherLabels = map[string]string{ ChannelLabelKey: ChannelLabelValue, RoleLabelKey: DispatcherRoleLabelValue, } )
Functions ¶
func MakeK8sService ¶
func MakeK8sService(kc *v1alpha1.NatsJetStreamChannel, opts ...ServiceOption) (*corev1.Service, error)
MakeK8sService creates a new K8s Service for a Channel resource. It also sets the appropriate OwnerReferences on the resource so handleObject can discover the Channel resource that 'owns' it. As well as being garbage-collected when the Channel is deleted.
func MakeRoleBinding ¶
func MakeRoleBinding(ns, name string, sa *corev1.ServiceAccount, roleName string, isClusterRole bool) *rbacv1.RoleBinding
MakeRoleBinding creates a RoleBinding object for the JetStream dispatcher service account 'sa' in the Namespace 'ns'.
func MakeServiceAccount ¶
func MakeServiceAccount(namespace, name string) *corev1.ServiceAccount
MakeServiceAccount creates a ServiceAccount object for the Namespace 'ns'.
Types ¶
type DispatcherDeploymentArgs ¶
type DispatcherDeploymentArgs struct { DispatcherScope string DispatcherNamespace string Image string Replicas int32 ServiceAccount string ConfigMapName string ConfigMapHash string OwnerRef metav1.OwnerReference DeploymentAnnotations map[string]string DeploymentLabels map[string]string DeploymentResources corev1.ResourceRequirements DeploymentNodeSelector map[string]string DeploymentAffinity *corev1.Affinity PodAnnotations map[string]string PodLabels map[string]string }
type DispatcherDeploymentBuilder ¶
type DispatcherDeploymentBuilder struct {
// contains filtered or unexported fields
}
func NewDispatcherDeploymentBuilder ¶
func NewDispatcherDeploymentBuilder() *DispatcherDeploymentBuilder
NewDispatcherDeploymentBuilder returns a builder which builds from scratch a dispatcher deployment. Intended to be used when creating the dispatcher deployment for the first time.
func NewDispatcherDeploymentBuilderFromDeployment ¶
func NewDispatcherDeploymentBuilderFromDeployment(d *v1.Deployment) *DispatcherDeploymentBuilder
NewDispatcherDeploymentBuilderFromDeployment returns a builder which builds a dispatcher deployment from the given deployment. Intended to be used when updating an existing dispatcher deployment.
func (*DispatcherDeploymentBuilder) Build ¶
func (b *DispatcherDeploymentBuilder) Build() *v1.Deployment
func (*DispatcherDeploymentBuilder) WithArgs ¶
func (b *DispatcherDeploymentBuilder) WithArgs(args *DispatcherDeploymentArgs) *DispatcherDeploymentBuilder
type DispatcherServiceArgs ¶
type DispatcherServiceBuilder ¶
type DispatcherServiceBuilder struct {
// contains filtered or unexported fields
}
func NewDispatcherServiceBuilder ¶
func NewDispatcherServiceBuilder() *DispatcherServiceBuilder
NewDispatcherServiceBuilder returns a builder which builds from scratch a dispatcher service. Intended to be used when creating the dispatcher service for the first time.
func NewDispatcherServiceBuilderFromService ¶
func NewDispatcherServiceBuilderFromService(s *corev1.Service) *DispatcherServiceBuilder
NewDispatcherServiceBuilderFromService returns a builder which builds a dispatcher service from the given service. Intended to be used when updating an existing dispatcher service.
func (*DispatcherServiceBuilder) Build ¶
func (b *DispatcherServiceBuilder) Build() *corev1.Service
func (*DispatcherServiceBuilder) WithArgs ¶
func (b *DispatcherServiceBuilder) WithArgs(args *DispatcherServiceArgs) *DispatcherServiceBuilder
type ServiceOption ¶
ServiceOption can be used to optionally modify the K8s service in MakeK8sService.
func ExternalService ¶
func ExternalService(namespace, service string) ServiceOption
ExternalService is a functional option for MakeK8sService to create a K8s service of type ExternalName pointing to the specified service in a namespace.