util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPermission = 0664
)

DefaultPermission of the Kubernetes config file

View Source
const (
	DefaultPollingDuration = 1 * time.Hour
)

DefaultPollingDuration for CreateUpdate Call to AKS Cluster

Variables

View Source
var (
	DefaultKubeConfig = clientcmd.RecommendedHomeFile
)

DefaultKubeConfig is the location of Default Kubernetes config file

Functions

func Confirmation

func Confirmation() bool

Confirmation asks for user input before proceeding

func MergeConfig

func MergeConfig(config []byte, path string) error

MergeConfig is use to merge kubernetes configuration with default kube config ~/.kube/config

Types

type AKSClient

type AKSClient struct {
	SubscriptionID   string
	Authorizer       autorest.Authorizer
	ContainerService containerservice.ManagedClustersClient
}

AKSClient is an object representing session for subscription

func NewAKSClient

func NewAKSClient() (AKSClient, error)

NewAKSClient returns Azure Session Object

func (AKSClient) CreateOrUpdate

func (aksClient AKSClient) CreateOrUpdate(ctx context.Context, name string, cluster ValidAKSCluster) error

CreateOrUpdate creates or updates a managed cluster with the specified configuration for agents and Kubernetes version. Parameters: resourceGroupName - the name of the resource group. name - the name of AKS Cluster. object of ValidAKSCluster.

func (AKSClient) GetCredentials

func (aksClient AKSClient) GetCredentials(name string) ([]byte, error)

GetCredentials returns list of AKS clusters in resource group

func (AKSClient) GetUpgrades

func (aksClient AKSClient) GetUpgrades(name string) ([]string, string, error)

GetUpgrades get the available upgrade version and current version

func (AKSClient) ListAKS

func (aksClient AKSClient) ListAKS() (map[string]AksCluster, error)

ListAKS returns list of AKS clusters in resource group

func (AKSClient) ScaleAKS

func (aksClient AKSClient) ScaleAKS(ctx context.Context, name string, count int32) error

ScaleAKS returns list of AKS clusters in resource group

func (AKSClient) UpgradeAKS

func (aksClient AKSClient) UpgradeAKS(ctx context.Context, name string, k8sVersion string) error

UpgradeAKS returns list of AKS clusters in resource group

type AksCluster

type AksCluster struct {
	ResourceGroup string
	K8sVersion    string
	Nodes         int32
}

AksCluster is an object representing details for AKS cluster

type ValidAKSCluster

type ValidAKSCluster struct {
	ResourceGroup string
	K8sVersion    string
	Nodes         int32
	AKSInstance   containerservice.ManagedCluster
}

ValidAKSCluster is an object representing validated AKS Cluster

Jump to

Keyboard shortcuts

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