Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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
- func CreateGlobalnetConfigMap(config *rest.Config, globalnetEnabled bool, defaultGlobalCidrRange string, ...) error
- func CreateNewBrokerNamespace(clientset *kubernetes.Clientset) (brokernamespace *v1.Namespace, err error)
- func CreateNewBrokerRoleBinding(clientset *kubernetes.Clientset, serviceAccount, role string) (brokerRoleBinding *rbac.RoleBinding, err error)
- func CreateNewBrokerSA(clientset *kubernetes.Clientset, submarinerBrokerSA string) (brokerSA *v1.ServiceAccount, err error)
- func CreateOrUpdateBrokerAdminRole(clientset *kubernetes.Clientset) (created bool, err error)
- func CreateOrUpdateClusterBrokerRole(clientset *kubernetes.Clientset) (created bool, err error)
- func CreateSAForCluster(clientset *kubernetes.Clientset, clusterID string) (*v1.Secret, error)
- func Ensure(config *rest.Config, componentArr []string, crds bool) error
- func GetClientTokenSecret(clientSet clientset.Interface, brokerNamespace, submarinerBrokerSA string) (*v1.Secret, error)
- func GetGlobalnetConfigMap(k8sClientset *kubernetes.Clientset, namespace string) (*v1.ConfigMap, error)
- func NewBrokerAdminRole() *rbacv1.Role
- func NewBrokerClusterRole() *rbacv1.Role
- func NewBrokerNamespace() *v1.Namespace
- func NewBrokerRoleBinding(serviceAccount, role string) *rbacv1.RoleBinding
- func NewBrokerSA(submarinerBrokerSA string) *v1.ServiceAccount
- func NewGlobalnetConfigMap(globalnetEnabled bool, defaultGlobalCidrRange string, ...) (*v1.ConfigMap, error)
- func UpdateGlobalnetConfigMap(k8sClientset *kubernetes.Clientset, namespace string, configMap *v1.ConfigMap, ...) error
- func WaitForClientToken(clientset *kubernetes.Clientset, submarinerBrokerSA string) (secret *v1.Secret, err error)
- type ClusterInfo
Constants ¶
const ( GlobalCIDRConfigMapName = "submariner-globalnet-info" GlobalnetStatusKey = "globalnetEnabled" ClusterInfoKey = "clusterinfo" GlobalnetCidrRange = "globalnetCidrRange" GlobalnetClusterSize = "globalnetClusterSize" )
const MaxGeneratedNameLength = 63 - 5
MaxGeneratedNameLength is the maximum generated length for a token, excluding the random suffix See k8s.io/apiserver/pkg/storage/names
const (
SubmarinerBrokerAdminSA = "submariner-k8s-broker-admin"
)
const (
SubmarinerBrokerNamespace = "submariner-k8s-broker"
)
Variables ¶
This section is empty.
Functions ¶
func CreateGlobalnetConfigMap ¶ added in v0.5.0
func CreateNewBrokerNamespace ¶ added in v0.3.0
func CreateNewBrokerNamespace(clientset *kubernetes.Clientset) (brokernamespace *v1.Namespace, err error)
func CreateNewBrokerRoleBinding ¶ added in v0.3.0
func CreateNewBrokerRoleBinding(clientset *kubernetes.Clientset, serviceAccount, role string) (brokerRoleBinding *rbac.RoleBinding, err error)
func CreateNewBrokerSA ¶ added in v0.3.0
func CreateNewBrokerSA(clientset *kubernetes.Clientset, submarinerBrokerSA string) (brokerSA *v1.ServiceAccount, err error)
func CreateOrUpdateBrokerAdminRole ¶ added in v0.5.0
func CreateOrUpdateBrokerAdminRole(clientset *kubernetes.Clientset) (created bool, err error)
func CreateOrUpdateClusterBrokerRole ¶ added in v0.7.0
func CreateOrUpdateClusterBrokerRole(clientset *kubernetes.Clientset) (created bool, err error)
func CreateSAForCluster ¶ added in v0.3.0
CreateSAForCluster creates a new SA, and binds it to the submariner cluster role
func GetClientTokenSecret ¶
func GetGlobalnetConfigMap ¶ added in v0.5.0
func NewBrokerAdminRole ¶ added in v0.3.0
Create a role to bind to Broker SA
func NewBrokerClusterRole ¶ added in v0.3.0
Create a role for each Cluster SAs to bind to
func NewBrokerNamespace ¶
func NewBrokerRoleBinding ¶
func NewBrokerRoleBinding(serviceAccount, role 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 UpdateGlobalnetConfigMap ¶ added in v0.5.0
func UpdateGlobalnetConfigMap(k8sClientset *kubernetes.Clientset, namespace string, configMap *v1.ConfigMap, newCluster ClusterInfo) error