kube

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright The Pharmer Authors.

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 The Pharmer Authors.

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 The Pharmer Authors.

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 The Pharmer Authors.

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

This section is empty.

Variables

View Source
var (
	// TokenIDRegexpString defines token's id regular expression pattern
	TokenIDRegexpString = "^([a-z0-9]{6})$"
	// TokenIDRegexp is a compiled regular expression of TokenIDRegexpString
	TokenIDRegexp = regexp.MustCompile(TokenIDRegexpString)
	// TokenRegexpString defines id.secret regular expression pattern
	TokenRegexpString = "^([a-z0-9]{6})\\.([a-z0-9]{16})$"
	// TokenRegexp is a compiled regular expression of TokenRegexpString
	TokenRegexp = regexp.MustCompile(TokenRegexpString)
)

Functions

func CreateConfigMap

func CreateConfigMap(kc kubernetes.Interface, name, namespace string, data map[string]string) error

func CreateCredentialSecret

func CreateCredentialSecret(client kubernetes.Interface, cloudProvider, namespace string, data map[string]string) error

func CreateNamespace

func CreateNamespace(kc kubernetes.Interface, namespace string) error

func CreateSecret

func CreateSecret(kc kubernetes.Interface, name, namespace string, data map[string][]byte) error

func CreateValidKubeadmToken

func CreateValidKubeadmToken(kc kubernetes.Interface, duration time.Duration) (string, error)

func GetAdminConfig

func GetAdminConfig(cluster *api.Cluster, caCertPair *certificates.CertKeyPair) (*api.KubeConfig, error)

func GetBooststrapClient

func GetBooststrapClient(cluster *api.Cluster, caCert *certificates.CertKeyPair) (clusterclient.Client, error)

func GetClusterAPIClient

func GetClusterAPIClient(certStore store.CertificateStore, clusterEndpoint string) (clientset.Interface, error)

func GetExistingKubeadmToken

func GetExistingKubeadmToken(kc kubernetes.Interface, duration time.Duration) (string, error)

func GetKubeadmToken

func GetKubeadmToken() string

func NewAdminClient

func NewAdminClient(certStore store.CertificateStore, clusterEndpoint string) (kubernetes.Interface, error)

WARNING: Returned KubeClient uses admin client cert. This should only be used for Cluster provisioning operations.

func NewRestConfig

func NewRestConfig(certStore store.CertificateStore, clusterEndpoint string) (*rest.Config, error)

func NewRestConfigFromKubeConfig

func NewRestConfigFromKubeConfig(in *api.KubeConfig) *rest.Config

func ParseToken

func ParseToken(s string) (string, string, error)

func RandStringRunes

func RandStringRunes(n int) string

func WaitForReadyMaster

func WaitForReadyMaster(log logr.Logger, client kubernetes.Interface) error

func WaitForReadyMasterVersion

func WaitForReadyMasterVersion(client kubernetes.Interface, desiredVersion *semver.Version) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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