github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/caas/kubernetes/provider/constants/constants.go (about) 1 // Copyright 2020 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package constants 5 6 import ( 7 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 8 9 agentconstants "github.com/juju/juju/agent/constants" 10 ) 11 12 const ( 13 // Domain is the primary TLD for juju when giving resource domains to 14 // Kubernetes 15 Domain = "juju.is" 16 17 // LegacyDomain is the legacy primary TLD for juju when giving resource domains to 18 // Kubernetes 19 LegacyDomain = "juju.io" 20 21 // AgentHTTPProbePort is the default port used by the HTTP server responding 22 // to caas probes 23 AgentHTTPProbePort = "3856" 24 25 // AgentHTTPPathLiveness is the path used for liveness probes on the agent 26 AgentHTTPPathLiveness = "/liveness" 27 28 // AgentHTTPPathReadiness is the path used for readiness probes on the agent 29 AgentHTTPPathReadiness = "/readiness" 30 31 // AgentHTTPPathStartup is the path used for startup probes on the agent 32 AgentHTTPPathStartup = "/startup" 33 34 // DefaultPebbleDir is the default directory Pebble considers when starting 35 // up. 36 DefaultPebbleDir = "/var/lib/pebble/default" 37 38 // JujuExecServerSocketPort is the port used by juju run callbacks. 39 JujuExecServerSocketPort = 30666 40 41 // TemplateFileNameAgentConf is the template agent.conf file name. 42 TemplateFileNameAgentConf = "template-" + agentconstants.AgentConfigFilename 43 44 // ControllerAgentConfigFilename is the agent conf filename 45 // for the controller agent for the api server. 46 ControllerAgentConfigFilename = "controller-agent.conf" 47 48 // ControllerUnitAgentConfigFilename is the agent conf filename 49 // for the controller unit agent which runs the charm. 50 ControllerUnitAgentConfigFilename = "controller-unit-agent.conf" 51 52 // CAASProviderType is the provider type for k8s. 53 CAASProviderType = "kubernetes" 54 55 // CAASImageRepoSecretName is the name of the secret for image pull. 56 CAASImageRepoSecretName = "juju-image-pull-secret" 57 58 // JujuControllerStackName is the juju CAAS controller stack name. 59 JujuControllerStackName = "controller" 60 61 // ControllerServiceFQDNTemplate is the FQDN of the controller service using the cluster DNS. 62 ControllerServiceFQDNTemplate = "controller-service.controller-%s.svc.cluster.local" 63 64 // CharmVolumeName is the name of the k8s volume where shared charm data is stored. 65 CharmVolumeName = "charm-data" 66 67 // JujuUserID is the juju user id for rootless juju agents. 68 // NOTE: 170 uid/gid must be updated here and in caas/Dockerfile and caas/scripts.go 69 JujuUserID = 170 70 // JujuGroupID is the juju group id for rootless juju agents. 71 JujuGroupID = 170 72 // JujuSudoUserID is the juju user id for rootless juju agents with sudo. 73 // NOTE: 171 uid/gid must be updated here and in caas/Dockerfile 74 JujuSudoUserID = 171 75 // JujuSudoGroupID is the juju group id for rootless juju agents with sudo. 76 JujuSudoGroupID = 171 77 // JujuFSGroupID is the group id for all fs entries written to k8s volumes. 78 JujuFSGroupID = 170 79 ) 80 81 // DefaultPropagationPolicy returns the default propagation policy. 82 func DefaultPropagationPolicy() *metav1.DeletionPropagation { 83 v := metav1.DeletePropagationForeground 84 return &v 85 } 86 87 // DeletePropagationBackground returns the background propagation policy. 88 func DeletePropagationBackground() *metav1.DeletionPropagation { 89 v := metav1.DeletePropagationBackground 90 return &v 91 }