broker

package
v0.20.0-m1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const InfoFileName = "broker-info.subm"
View Source
const (
	LocalClientBrokerSecretName = "submariner-broker-secret"
)

Variables

This section is empty.

Functions

func CreateNewBrokerAdminSA added in v0.16.0

func CreateNewBrokerAdminSA(ctx context.Context, kubeClient kubernetes.Interface, inNamespace string) (err error)

func CreateNewBrokerRoleBinding

func CreateNewBrokerRoleBinding(ctx context.Context, kubeClient kubernetes.Interface, serviceAccount, roleName, inNamespace string) (
	brokerRoleBinding *rbacv1.RoleBinding, err error,
)

func CreateNewBrokerSA

func CreateNewBrokerSA(ctx context.Context, kubeClient kubernetes.Interface, submarinerBrokerSA, inNamespace string) (err error)

func CreateOrUpdateBrokerAdminRole

func CreateOrUpdateBrokerAdminRole(ctx context.Context, clientset kubernetes.Interface, inNamespace string) (created bool, err error)

func CreateOrUpdateBrokerAdminRoleBinding added in v0.16.0

func CreateOrUpdateBrokerAdminRoleBinding(ctx context.Context, kubeClient kubernetes.Interface, inNamespace string) (
	created bool, err error,
)

func CreateOrUpdateClusterBrokerRole

func CreateOrUpdateClusterBrokerRole(ctx context.Context, kubeClient kubernetes.Interface, inNamespace string) (bool, error)

func CreateSAForCluster

func CreateSAForCluster(ctx context.Context, kubeClient kubernetes.Interface, clusterID, inNamespace string) (*v1.Secret, error)

CreateSAForCluster creates a new SA for each new cluster joined and binds it to the submariner cluster role.

func Ensure

func Ensure(ctx context.Context, crdUpdater crd.Updater, kubeClient kubernetes.Interface, componentArr []string, createCRDs bool,
	brokerNS string,
) error

func GenerateRandomPSK added in v0.15.0

func GenerateRandomPSK() ([]byte, error)

GenerateRandomPSK returns a securely generated array suitable for use as a PSK.

func NewBrokerRoleBinding

func NewBrokerRoleBinding(serviceAccount, role, namespace string) *rbacv1.RoleBinding

Create a role for to bind the cluster admin (subctl) SA.

func NewBrokerSA

func NewBrokerSA(submarinerBrokerSA string) *v1.ServiceAccount

func RecoverData added in v0.15.0

func RecoverData(submCluster *cluster.Info, broker *v1alpha1.Broker, brokerNamespace, brokerURL string,
	brokerRestConfig *rest.Config, status reporter.Interface,
) error

func WriteInfoToFile

func WriteInfoToFile(restConfig *rest.Config, brokerNamespace, brokerURL string, ipsecPSK []byte, components set.Set[string],
	customDomains []string, status reporter.Interface,
) error

Types

type Info

type Info struct {
	BrokerURL        string         `json:"brokerURL"`
	ClientToken      *corev1.Secret `omitempty,json:"clientToken"`
	IPSecPSK         *corev1.Secret `omitempty,json:"ipsecPSK"`
	ServiceDiscovery bool           `omitempty,json:"serviceDiscovery"`
	Components       []string       `json:",omitempty"`
	CustomDomains    *[]string      `omitempty,json:"customDomains"`
}

func ReadInfoFromFile

func ReadInfoFromFile(filename string) (*Info, error)

func (*Info) GetBrokerAdministratorConfig

func (d *Info) GetBrokerAdministratorConfig(ctx context.Context, insecure bool) (*rest.Config, error)

func (*Info) GetComponents

func (d *Info) GetComponents() set.Set[string]

func (*Info) IsConnectivityEnabled

func (d *Info) IsConnectivityEnabled() bool

func (*Info) IsServiceDiscoveryEnabled

func (d *Info) IsServiceDiscoveryEnabled() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL