constants

package
v0.0.0-...-a753888 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 27

Documentation

Index

Constants

View Source
const (
	// Domain is the primary TLD for juju when giving resource domains to
	// Kubernetes
	Domain = "juju.is"

	// LegacyDomain is the legacy primary TLD for juju when giving resource domains to
	// Kubernetes
	LegacyDomain = "juju.io"

	// AgentHTTPProbePort is the default port used by the HTTP server responding
	// to caas probes
	AgentHTTPProbePort = "3856"

	// AgentHTTPPathLiveness is the path used for liveness probes on the agent
	AgentHTTPPathLiveness = "/liveness"

	// AgentHTTPPathReadiness is the path used for readiness probes on the agent
	AgentHTTPPathReadiness = "/readiness"

	// AgentHTTPPathStartup is the path used for startup probes on the agent
	AgentHTTPPathStartup = "/startup"

	// DefaultPebbleDir is the default directory Pebble considers when starting
	// up.
	DefaultPebbleDir = "/var/lib/pebble/default"

	// JujuExecServerSocketPort is the port used by juju run callbacks.
	JujuExecServerSocketPort = 30666

	// TemplateFileNameAgentConf is the template agent.conf file name.
	TemplateFileNameAgentConf = "template-" + agentconstants.AgentConfigFilename

	// ControllerAgentConfigFilename is the agent conf filename
	// for the controller agent for the api server.
	ControllerAgentConfigFilename = "controller-agent.conf"

	// ControllerUnitAgentConfigFilename is the agent conf filename
	// for the controller unit agent which runs the charm.
	ControllerUnitAgentConfigFilename = "controller-unit-agent.conf"

	// CAASProviderType is the provider type for k8s.
	CAASProviderType = "kubernetes"

	// CAASImageRepoSecretName is the name of the secret for image pull.
	CAASImageRepoSecretName = "juju-image-pull-secret"

	// JujuControllerStackName is the juju CAAS controller stack name.
	JujuControllerStackName = "controller"

	// ControllerServiceFQDNTemplate is the FQDN of the controller service using the cluster DNS.
	ControllerServiceFQDNTemplate = "controller-service.controller-%s.svc.cluster.local"

	// CharmVolumeName is the name of the k8s volume where shared charm data is stored.
	CharmVolumeName = "charm-data"

	// JujuUserID is the juju user id for rootless juju agents.
	// NOTE: 170 uid/gid must be updated here and in caas/Dockerfile and caas/scripts.go
	JujuUserID = 170
	// JujuGroupID is the juju group id for rootless juju agents.
	JujuGroupID = 170
	// JujuSudoUserID is the juju user id for rootless juju agents with sudo.
	// NOTE: 171 uid/gid must be updated here and in caas/Dockerfile
	JujuSudoUserID = 171
	// JujuSudoGroupID is the juju group id for rootless juju agents with sudo.
	JujuSudoGroupID = 171
	// JujuFSGroupID is the group id for all fs entries written to k8s volumes.
	JujuFSGroupID = 170
)
View Source
const (
	EnvAgentHTTPProbePort  = "HTTP_PROBE_PORT"
	EnvJujuContainerNames  = "JUJU_CONTAINER_NAMES"
	EnvJujuK8sPodName      = "JUJU_K8S_POD_NAME"
	EnvJujuK8sPodUUID      = "JUJU_K8S_POD_UUID"
	EnvJujuK8sUnitPassword = "JUJU_K8S_UNIT_PASSWORD"

	// ApplicationInitContainer is the init container which sets up the charm agent config.
	ApplicationInitContainer = "charm-init"
	// ApplicationCharmContainer is the container which runs the unit agent.
	ApplicationCharmContainer = "charm"
)
View Source
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"
)
View Source
const (
	// LabelJujuAppCreatedBy is a Juju application label to apply to objects
	// created by applications managed by Juju. Think istio, kubeflow etc
	// See https://bugs.launchpad.net/juju/+bug/1892285
	LabelJujuAppCreatedBy = "app.juju.is/created-by"

	// LabelKubernetesAppName is the common meta key for kubernetes app names.
	// See https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels
	LabelKubernetesAppName = "app.kubernetes.io/name"

	// LabelKubernetesAppManaged is the common meta key for kubernetes apps
	// that are managed by a non k8s process (such as Juju).
	// See https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels
	LabelKubernetesAppManaged = "app.kubernetes.io/managed-by"

	// LabelJujuModelOperatorDisableWebhook is the label used for bypassing
	// model admission validation and mutation on objects.
	LabelJujuModelOperatorDisableWebhook = "model.juju.is/disable-webhook"

	// LabelJujuModelName is the juju label applied for juju models.
	LabelJujuModelName = "model.juju.is/name"

	// LabelJujuOperatorName is the juju label applied to Juju operators to
	// identify their name. Operator names are generally named after the thing
	// the operator is controlling. i.e an operator name for a model test would be
	// "test"
	LabelJujuOperatorName = "operator.juju.is/name"

	// LabelJujuOperatorTarget is the juju label applied to Juju operators to
	// describe the modeling paradigm they target. For example model,
	// application
	LabelJujuOperatorTarget = "operator.juju.is/target"

	// LabelJujuStorageName is the juju label applied to Juju storage objects to
	// describe their name.
	LabelJujuStorageName = "storage.juju.is/name"

	// LegacyLabelKubernetesAppName is the legacy label key used for juju app
	// identification. This purely exists to maintain backwards functionality.
	// See https://bugs.launchpad.net/juju/+bug/1888513
	LegacyLabelKubernetesAppName = "juju-app"

	// LegacyLabelModelName is the legacy label key used for juju models. This
	// purely exists to maintain backwards functionality.
	// See https://bugs.launchpad.net/juju/+bug/1888513
	LegacyLabelModelName = "juju-model"

	// LegacyLabelModelOperator is the legacy label key used for juju model
	// operators. This purely exists to maintain backwards functionality.
	// See https://bugs.launchpad.net/juju/+bug/1888513
	LegacyLabelModelOperator = "juju-modeloperator"

	// LegacyLabelKubernetesOperatorName is the legacy label key used for juju
	// operators. This purely exists to maintain backwards functionality.
	// See https://bugs.launchpad.net/juju/+bug/1888513
	LegacyLabelKubernetesOperatorName = "juju-operator"

	// LegacyLabelJujuStorageName is the legacy label key used for juju storage
	// pvc. This purely exists to maintain backwards functionality.
	// See https://bugs.launchpad.net/juju/+bug/1888513
	LegacyLabelStorageName = "juju-storage"
)
View Source
const (
	// StorageProviderType defines the Juju storage type which can be used
	// to provision storage on k8s models.
	StorageProviderType = storage.ProviderType("kubernetes")

	// StorageClass is the name of a storage class resource.
	StorageClass       = "storage-class"
	StorageProvisioner = "storage-provisioner"
	StorageMedium      = "storage-medium"
	StorageMode        = "storage-mode"
)
View Source
const (
	// WorkloadStorageKey is the model config attribute used to specify
	// the storage class for provisioning workload storage.
	WorkloadStorageKey = "workload-storage"

	// OperatorStorageKey is the model config attribute used to specify
	// the storage class for provisioning operator storage.
	OperatorStorageKey = "operator-storage"
)

Variables

View Source
var (
	// StorageBaseDir is the base storage dir for the k8s series.
	StorageBaseDir = getK8sStorageBaseDir()

	// LegacyPVNameRegexp matches how Juju labels persistent volumes.
	// The pattern is: juju-<storagename>-<digit>
	LegacyPVNameRegexp = regexp.MustCompile(`^juju-(?P<storageName>\D+)-\d+$`)

	// PVNameRegexp matches how Juju labels persistent volumes.
	// The pattern is: <storagename>-<digit>
	PVNameRegexp = regexp.MustCompile(`^(?P<storageName>\D+)-\w+$`)
)

Functions

func DefaultPropagationPolicy

func DefaultPropagationPolicy() *metav1.DeletionPropagation

DefaultPropagationPolicy returns the default propagation policy.

func DeletePropagationBackground

func DeletePropagationBackground() *metav1.DeletionPropagation

DeletePropagationBackground returns the background propagation policy.

func QualifiedStorageClassName

func QualifiedStorageClassName(namespace, storageClass string) string

QualifiedStorageClassName returns a qualified storage class name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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