broker

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlobalCIDRConfigMapName     = "submariner-globalnet-info"
	GlobalnetStatusKey          = "globalnetEnabled"
	ClusterInfoKey              = "clusterinfo"
	GlobalnetCidrRange          = "globalnetCidrRange"
	GlobalnetClusterSize        = "globalnetClusterSize"
	DefaultGlobalnetCIDR        = "242.0.0.0/8"
	DefaultGlobalnetClusterSize = 65536 // i.e., x.x.x.x/16 subnet mask
)
View Source
const InfoFileName = "broker-info.subm"

Variables

This section is empty.

Functions

func ClusterSAName added in v0.12.0

func ClusterSAName(clusterID string) string

func CreateGlobalnetConfigMap added in v0.5.0

func CreateGlobalnetConfigMap(kubeClient kubernetes.Interface, globalnetEnabled bool, defaultGlobalCidrRange string,
	defaultGlobalClusterSize uint, namespace string) error

func CreateNewBrokerRoleBinding added in v0.3.0

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

nolint:wrapcheck // No need to wrap here

func CreateNewBrokerSA added in v0.3.0

func CreateNewBrokerSA(kubeClient kubernetes.Interface, submarinerBrokerSA, inNamespace string) (brokerSA *v1.ServiceAccount, err error)

nolint:wrapcheck // No need to wrap here

func CreateOrUpdateBrokerAdminRole added in v0.5.0

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

nolint:wrapcheck // No need to wrap here

func CreateOrUpdateClusterBrokerRole added in v0.7.0

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

nolint:wrapcheck // No need to wrap here

func CreateSAForCluster added in v0.3.0

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

CreateSAForCluster creates a new SA, and binds it to the submariner cluster role.

func Ensure

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

func GetGlobalnetConfigMap added in v0.5.0

func GetGlobalnetConfigMap(kubeClient kubernetes.Interface, namespace string) (*v1.ConfigMap, error)

nolint:wrapcheck // No need to wrap here

func NewBrokerAdminRole added in v0.3.0

func NewBrokerAdminRole() *rbacv1.Role

Create a role to bind to Broker SA.

func NewBrokerClusterRole added in v0.3.0

func NewBrokerClusterRole() *rbacv1.Role

Create a role for each Cluster SAs to bind to.

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 NewGlobalnetConfigMap added in v0.5.0

func NewGlobalnetConfigMap(globalnetEnabled bool, defaultGlobalCidrRange string,
	defaultGlobalClusterSize uint, namespace string) (*v1.ConfigMap, error)

func UpdateGlobalnetConfigMap added in v0.5.0

func UpdateGlobalnetConfigMap(k8sClientset kubernetes.Interface, namespace string,
	configMap *v1.ConfigMap, newCluster ClusterInfo) error

func WaitForClientToken added in v0.3.0

func WaitForClientToken(kubeClient kubernetes.Interface, submarinerBrokerSA, inNamespace string) (*v1.Secret, error)

func WriteInfoToFile added in v0.12.0

func WriteInfoToFile(restConfig *rest.Config, brokerNamespace, ipsecFile string, components stringset.Interface,
	customDomains []string, status reporter.Interface) error

Types

type ClusterInfo added in v0.5.0

type ClusterInfo struct {
	ClusterID  string   `json:"cluster_id"`
	GlobalCidr []string `json:"global_cidr"`
}

type Info added in v0.12.0

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 added in v0.12.0

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

func (*Info) GetBrokerAdministratorConfig added in v0.12.0

func (d *Info) GetBrokerAdministratorConfig() (*rest.Config, error)

func (*Info) GetComponents added in v0.12.0

func (d *Info) GetComponents() stringset.Interface

func (*Info) IsConnectivityEnabled added in v0.12.0

func (d *Info) IsConnectivityEnabled() bool

func (*Info) IsServiceDiscoveryEnabled added in v0.12.0

func (d *Info) IsServiceDiscoveryEnabled() bool

Jump to

Keyboard shortcuts

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