import "github.com/juju/juju/caas/kubernetes/provider"
bootstrap.go builtin.go cloud.go config.go configmap.go constraints.go credentials.go customresourcedefinitions.go detectcloud.go dockerconfig.go errors.go events.go ingress.go init.go k8s.go k8swatcher.go metadata.go namespaces.go operator.go precheck.go provider.go providerconfig.go rbac.go resources.go secrets.go storage.go template.go
const ( CredAttrUsername = "username" CredAttrPassword = "password" CredAttrClientCertificateData = "ClientCertificateData" CredAttrClientKeyData = "ClientKeyData" CredAttrToken = "Token" RBACLabelKeyName = "rbac-id" )
const ( // Container event reason list CreatedContainer = "Created" StartedContainer = "Started" FailedToCreateContainer = "Failed" FailedToStartContainer = "Failed" KillingContainer = "Killing" PreemptContainer = "Preempting" BackOffStartContainer = "BackOff" ExceededGracePeriod = "ExceededGracePeriod" // Pod event reason list FailedToKillPod = "FailedKillPod" FailedToCreatePodContainer = "FailedCreatePodContainer" FailedToMakePodDataDirectories = "Failed" NetworkNotReady = "NetworkNotReady" // Image event reason list PullingImage = "Pulling" PulledImage = "Pulled" FailedToPullImage = "Failed" FailedToInspectImage = "InspectFailed" ErrImageNeverPullPolicy = "ErrImageNeverPull" BackOffPullImage = "BackOff" )
Constants below are copied from "k8s.io/kubernetes/pkg/kubelet/events" to avoid introducing the huge dependency. Remove them once k8s.io/kubernetes added as a dependency.
const ( // OperatorPodIPEnvName is the environment name for operator pod IP. OperatorPodIPEnvName = "JUJU_OPERATOR_POD_IP" // OperatorServiceIPEnvName is the environment name for operator service IP. OperatorServiceIPEnvName = "JUJU_OPERATOR_SERVICE_IP" // OperatorNamespaceEnvName is the environment name for k8s namespace the operator is in. OperatorNamespaceEnvName = "JUJU_OPERATOR_NAMESPACE" // JujuRunServerSocketPort is the port used by juju run callbacks. JujuRunServerSocketPort = 30666 )
const ( WorkloadStorageKey = "workload-storage" OperatorStorageKey = "operator-storage" )
const ( // K8s_ProviderType defines the Juju storage type which can be used // to provision storage on k8s models. K8s_ProviderType = storage.ProviderType("kubernetes") // StorageClass is the name of a storage class resource. StorageClass = "storage-class" )
const CAASProviderType = "kubernetes"
const ( // JujuControllerStackName is the juju CAAS controller stack name. JujuControllerStackName = "controller" )
const (
ServiceTypeConfigKey = "kubernetes-service-type"
)
var ( // TemplateFileNameServerPEM is the template server.pem file name. TemplateFileNameServerPEM = "template-" + mongo.FileNameDBSSLKey // TemplateFileNameAgentConf is the template agent.conf file name. TemplateFileNameAgentConf = "template-" + agent.AgentConfigFilename )
func BaseKubeCloudOpenParams(cloud cloud.Cloud, credential cloud.Credential) (environs.OpenParams, error)
BaseKubeCloudOpenParams provides a basic OpenParams for a cluster
func CloudFromKubeConfig(reader io.Reader, cloudParams KubeCloudParams) (cloud.Cloud, cloud.Credential, error)
CloudFromKubeConfig attempts to extract a cloud and credential details from the provided Kubeconfig.
CloudSpecToK8sRestConfig tranlates cloudspec to k8s rest config.
ConfigDefaults returns the default values for a kubernetes configuration.
func ConfigSchema() environschema.Fields
ConfigSchema returns the configuration schema for a kubernetes provider config.
DecideControllerNamespace decides the namespace name to use for a new controller.
IsClusterQueryError returns true if err is a ClusterQueryError.
IsNoRecommendedStorageError returns true if err is a NoRecommendedStorageError
IsUnknownClusterError returns true if err is a UnknownClusterError
MaskError is used to signify that an error should not be reported back to the caller.
func UpdateKubeCloudWithStorage(k8sCloud *cloud.Cloud, storageParams KubeCloudStorageParams) (storageMsg string, err error)
UpdateKubeCloudWithStorage updates the passed Cloud with storage details retrieved from the clouds' cluster.
func ValidateStorageProvider(providerType storage.ProviderType, attributes map[string]interface{}) error
ValidateStorageProvider returns an error if the storage type and config is not valid for a Kubernetes deployment.
type CRDGetterInterface interface { Get(string) (*apiextensionsv1beta1.CustomResourceDefinition, error) }
type ClientConfigFuncGetter func(string) (clientconfig.ClientConfigFunc, error)
ClientConfigFuncGetter returns a function returning az reader that will read a k8s cluster config for a given cluster type
ClusterQueryError represents an issue when querying a cluster.
func (e ClusterQueryError) Error() string
CommandRunner allows to run commands on the underlying system
type DockerConfig map[string]DockerConfigEntry
DockerConfig represents the config file used by the docker CLI.
DockerConfigEntry represents an Auth entry in the dockerconfigjson.
type DockerConfigJSON struct { Auths DockerConfig `json:"auths"` }
DockerConfigJSON represents ~/.docker/config.json file info.
type GetClusterMetadataFunc func(KubeCloudStorageParams) (*caas.ClusterMetadata, error)
GetClusterMetadataFunc returns the ClusterMetadata using the provided ClusterMetadataChecker
type KubeCloudParams struct { ClusterName string ContextName string CloudName string // CredentialUID ensures RBAC resources are unique. CredentialUID string HostCloudRegion string CaasType string ClientConfigGetter ClientConfigFuncGetter Clock jujuclock.Clock }
KubeCloudParams defines the parameters used to extract a k8s cluster definition from kubeconfig data.
type KubeCloudStorageParams struct { WorkloadStorage string HostCloudRegion string MetadataChecker caas.ClusterMetadataChecker GetClusterMetadataFunc GetClusterMetadataFunc }
KubeCloudStorageParams defines the parameters used to determine storage details for a k8s cluster.
type NewK8sClientFunc func(c *rest.Config) (kubernetes.Interface, apiextensionsclientset.Interface, dynamic.Interface, error)
NewK8sClientFunc defines a function which returns a k8s client based on the supplied config.
type NewK8sWatcherFunc func(wi watch.Interface, name string, clock jujuclock.Clock) (*kubernetesNotifyWatcher, error)
NewK8sWatcherFunc defines a function which returns a k8s watcher based on the supplied config.
NoRecommendedStorageError represents when Juju is unable to determine which storage a cluster uses (or should use)
func (e NoRecommendedStorageError) Error() string
func (e NoRecommendedStorageError) StorageProvider() string
RandomPrefixFunc defines a function used to generate a random hex string.
UnknownClusterError occurs when the provided cluster is not known to Juju.
func (e UnknownClusterError) Error() string
Path | Synopsis |
---|---|
exec | |
exec/mocks | Package mocks is a generated GoMock package. |
mocks | Package mocks is a generated GoMock package. |
specs | |
specs/mocks | Package mocks is a generated GoMock package. |
Package provider imports 81 packages (graph) and is imported by 40 packages. Updated 2019-12-09. Refresh now. Tools for package owners.