broker

package
v0.0.0-...-630eec3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	GlobalCIDRConfigMapName = "submariner-globalnet-info"
	GlobalnetStatusKey      = "globalnetEnabled"
	ClusterInfoKey          = "clusterinfo"
	GlobalnetCidrRange      = "globalnetCidrRange"
	GlobalnetClusterSize    = "globalnetClusterSize"
)
View Source
const (
	SubmarinerBrokerAdminSA = "submariner-k8s-broker-admin"
)

Variables

This section is empty.

Functions

func CreateBrokerInfoConfigMap

func CreateBrokerInfoConfigMap(c client.Client, restConfig *rest.Config, instance *operatorv1alpha1.Fabric) error

func CreateGlobalnetConfigMap

func CreateGlobalnetConfigMap(c client.Client, globalnetEnabled bool, defaultGlobalCidrRange string,
	defaultGlobalClusterSize uint, namespace string) error

func CreateNewBrokerNamespace

func CreateNewBrokerNamespace(c client.Client) error

func CreateNewBrokerRoleBinding

func CreateNewBrokerRoleBinding(c client.Client, serviceAccount, role string) error

func CreateNewBrokerSA

func CreateNewBrokerSA(c client.Client, submarinerBrokerSA string) error

func CreateOrUpdateBrokerAdminRole

func CreateOrUpdateBrokerAdminRole(c client.Client) error

func CreateOrUpdateClusterBrokerRole

func CreateOrUpdateClusterBrokerRole(c client.Client) error

func CreateSAForCluster

func CreateSAForCluster(c client.Client, reader client.Reader, clusterID string) (*v1.Secret, error)

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

func Ensure

func Ensure(c client.Client, config *rest.Config, serviceDiscoveryEnabled, globalnetEnabled, crds bool) error

func GeneralGlobalnetConfigMap

func GeneralGlobalnetConfigMap(cm *v1.ConfigMap, globalnetEnabled bool, defaultGlobalCidrRange string, defaultGlobalClusterSize uint) error

func GetClientTokenSecret

func GetClientTokenSecret(reader client.Reader, brokerNamespace, submarinerBrokerSA string) (*v1.Secret, error)

func GetGlobalnetConfigMap

func GetGlobalnetConfigMap(reader client.Reader, namespace string) (*v1.ConfigMap, error)

func NewBrokerAdminRole

func NewBrokerAdminRole(role *rbacv1.Role) error

func NewBrokerClusterRole

func NewBrokerClusterRole(role *rbacv1.Role) error

func NewBrokerNamespace

func NewBrokerNamespace() *v1.Namespace

func NewBrokerRoleBinding

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

Create a role for to bind the cluster admin SA

func NewBrokerSA

func NewBrokerSA(submarinerBrokerSA string) *v1.ServiceAccount

func UpdateGlobalnetConfigMap

func UpdateGlobalnetConfigMap(c client.Client, namespace string,
	configMap *v1.ConfigMap, newCluster ClusterInfo) error

func WaitForClientToken

func WaitForClientToken(reader client.Reader, submarinerBrokerSA string) (secret *v1.Secret, err error)

Types

type BrokerInfo

type BrokerInfo struct {
	BrokerURL                   string     `json:"brokerURL"`
	ClientToken                 *v1.Secret `json:"clientToken,omitempty"`
	IPSecPSK                    *v1.Secret `json:"ipsecPSK,omitempty"`
	Components                  []string   `json:",omitempty"`
	CustomDomains               *[]string  `json:"customDomains,omitempty"`
	GlobalnetCIDRRange          string     `json:"globalnetCIDRRange,omitempty"`
	DefaultGlobalnetClusterSize uint       `json:"defaultGlobalnetClusterSize,omitempty"`
}

func NewFromCluster

func NewFromCluster(c client.Client, restConfig *rest.Config) (*BrokerInfo, error)

func NewFromConfigMap

func NewFromConfigMap(c client.Client) (*BrokerInfo, error)

func NewFromString

func NewFromString(str string) (*BrokerInfo, error)

func (*BrokerInfo) GetBrokerAdministratorCluster

func (data *BrokerInfo) GetBrokerAdministratorCluster() (cluster.Cluster, error)

func (*BrokerInfo) GetBrokerAdministratorConfig

func (data *BrokerInfo) GetBrokerAdministratorConfig() *rest.Config

func (*BrokerInfo) GetComponents

func (data *BrokerInfo) GetComponents() stringset.Interface

func (*BrokerInfo) IsConnectivityEnabled

func (data *BrokerInfo) IsConnectivityEnabled() bool

func (*BrokerInfo) IsGlobalnetEnabled

func (data *BrokerInfo) IsGlobalnetEnabled() bool

func (*BrokerInfo) IsServiceDiscoveryEnabled

func (data *BrokerInfo) IsServiceDiscoveryEnabled() bool

func (*BrokerInfo) SetComponents

func (data *BrokerInfo) SetComponents(componentSet stringset.Interface)

func (*BrokerInfo) ToString

func (data *BrokerInfo) ToString() (string, error)

func (*BrokerInfo) WriteConfigMap

func (data *BrokerInfo) WriteConfigMap(c client.Client, instance *operatorv1alpha1.Fabric) error

type ClusterInfo

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

Jump to

Keyboard shortcuts

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