k8s

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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 (
	ClusterName           = "karmada"
	UserName              = "admin"
	KArmadaKubeConfigName = "karmada-apiserver.config"
)
View Source
const (

	//karmada-scheduler
	KArmadaSchedulerDeploymentName     = "karmada-scheduler"
	KArmadaSchedulerServiceAccountName = "karmada-scheduler"
)

Variables

View Source
var (
	Namespace          string
	KubeConfig         string
	KArmadaMasterIP    string
	KArmadaMasterPort  int32
	DataPath           string
	ExternalIP         string
	StorageClassesName string
	NodeSelectorLabels = map[string]string{}

	//etcd
	EtcdStorageMode string
	EtcdImage       string
	EtcdInitImage   string
	EtcdReplicas    int32
	EtcdDataPath    string
	EtcdStorageSize string

	//	karmada
	KArmadaApiServerImage                string
	KArmadaApiServerReplicas             int32
	KArmadaSchedulerImage                string
	KArmadaKubeControllerManagerImage    string
	KArmadaControllerManagerImage        string
	KArmadaControllerManagerReplicas     int32
	KArmadaKubeControllerManagerReplicas int32
	KArmadaSchedulerReplicas             int32
	KArmadaWebhookImage                  string
	KArmadaWebhookReplicas               int32
)

install flags

Functions

func Deploy

func Deploy()

func WaitEtcdReplicasetInDesired

func WaitEtcdReplicasetInDesired(c *kubernetes.Clientset, namespace, selector string, timeout int) error

WaitEtcdReady Wait Etcd Ready

func WaitPodReady

func WaitPodReady(c *kubernetes.Clientset, namespace, selector string, timeout int) error

Types

type InstallOptions

type InstallOptions struct {
	Namespace          string
	CertAndKeyFileName certs.CertAndKeyFileName
	CertAndKeyFileData map[string][]byte
	KubeClientSet      *kubernetes.Clientset
	RestConfig         *rest.Config
	MasterIP           []net.IP
}

func (*InstallOptions) AddNodeSelectorLabels

func (i *InstallOptions) AddNodeSelectorLabels() error

func (*InstallOptions) ClusterRoleBindingFromSpec

func (i *InstallOptions) ClusterRoleBindingFromSpec(clusterRoleBindingName, clusterRoleName, saName string) *rbacv1.ClusterRoleBinding

func (*InstallOptions) ClusterRoleFromSpec

func (i *InstallOptions) ClusterRoleFromSpec(name string, rules []rbacv1.PolicyRule) *rbacv1.ClusterRole

func (*InstallOptions) CreateClusterRole

func (i *InstallOptions) CreateClusterRole(clusterRole *rbacv1.ClusterRole) error

func (*InstallOptions) CreateClusterRoleBinding

func (i *InstallOptions) CreateClusterRoleBinding(clusterRole *rbacv1.ClusterRoleBinding) error

func (*InstallOptions) CreateNamespace

func (i *InstallOptions) CreateNamespace() error

IfNotExist

func (*InstallOptions) CreateSecret

func (i *InstallOptions) CreateSecret(secret *corev1.Secret) error

func (*InstallOptions) CreateService

func (i *InstallOptions) CreateService(service *corev1.Service) error

func (*InstallOptions) CreateServiceAccount

func (i *InstallOptions) CreateServiceAccount(sa *[]corev1.ServiceAccount) error

func (*InstallOptions) SecretFromSpec

func (i *InstallOptions) SecretFromSpec(name string, secretType corev1.SecretType, data map[string]string) *corev1.Secret

func (*InstallOptions) ServiceAccountFromSpec

func (i *InstallOptions) ServiceAccountFromSpec(name []string) *[]corev1.ServiceAccount

type InstallOptionsController

type InstallOptionsController interface {
	CreateNamespace() error
	AddNodeSelectorLabels() error
	CreateServiceAccount(sa *[]corev1.ServiceAccount) error
	CreateClusterRole(clusterRole *rbacv1.ClusterRole) error
	CreateClusterRoleBinding(clusterRole *rbacv1.ClusterRoleBinding) error
	CreateSecret(secret *corev1.Secret) error
	CreateService(service *corev1.Service) error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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