diff --git a/nodelet/pkg/nodelet/nodelet.go b/nodelet/pkg/nodelet/nodelet.go index ce2a7a3f..a5998348 100644 --- a/nodelet/pkg/nodelet/nodelet.go +++ b/nodelet/pkg/nodelet/nodelet.go @@ -87,7 +87,7 @@ func (n *Nodelet) Run(ctx context.Context) error { func CreateNodeletFromConfig(ctx context.Context, cfg *config.Config) (*Nodelet, error) { log := zap.S() - phases, err := loadRolePhases(ctx, *cfg) + phases, err := loadRolePhases(ctx, cfg) if err != nil { // Phases could not be loaded. Cannot recover from this. return nil, fmt.Errorf("could not load phases: %v", err) diff --git a/nodelet/pkg/pf9kube/pf9/pf9-kube/defaults.env b/nodelet/pkg/pf9kube/pf9/pf9-kube/defaults.env index a06a1161..74a1b917 100644 --- a/nodelet/pkg/pf9kube/pf9/pf9-kube/defaults.env +++ b/nodelet/pkg/pf9kube/pf9/pf9-kube/defaults.env @@ -54,7 +54,7 @@ MAX_CERTS_RETRIES=10 source /etc/os-release if [[ "$ID" == "centos" ]]; then CERTS_SERIAL_FILE="/etc/pf9/kube.srl" -elif [[ "$ID" == "rhel" ]]; then +elif [[ "$ID" == "rhel" || "$ID" == "rocky" ]]; then CERTS_SERIAL_FILE="/etc/pf9/kube.d/rootCA.srl" fi diff --git a/nodelet/pkg/pf9kube/pf9/pf9-kube/master_utils.sh b/nodelet/pkg/pf9kube/pf9/pf9-kube/master_utils.sh index d32f2cc9..7b6bdac3 100644 --- a/nodelet/pkg/pf9kube/pf9/pf9-kube/master_utils.sh +++ b/nodelet/pkg/pf9kube/pf9/pf9-kube/master_utils.sh @@ -98,7 +98,7 @@ function ensure_etcd_running() # # TODO # PMK-3665: Customise ETCD in platform9 managed kubernetes cluster - # + # # The flexibility of customizing ETCD with the help of environment variables # needs support from DU side as well if we want it to be truly customizable # at the time of cluster creation or at the time of cluster update. @@ -152,7 +152,7 @@ function ensure_etcd_running() # # periodic can be used if you want to retain key value revisions from the # last time window specified in ETCD_AUTO_COMPACTION_RETENTION env variable. - # e.g. 1h or 30m + # e.g. 1h or 30m # # revision can be used if you want to retains last n revisions of key values. # You can specify the value in in ETCD_AUTO_COMPACTION_RETENTION env variable. @@ -332,7 +332,7 @@ function prepare_conf_files() # Image registries local quay_registry="${QUAY_PRIVATE_REGISTRY:-quay.io}" - local k8s_registry="${K8S_PRIVATE_REGISTRY:-k8s.gcr.io}" + local k8s_registry="${K8S_PRIVATE_REGISTRY:-registry.k8s.io}" local gcr_registry="${GCR_PRIVATE_REGISTRY:-gcr.io}" local docker_registry="${DOCKER_PRIVATE_REGISTRY}" @@ -877,7 +877,7 @@ function post_upgrade_monitoring_fix() echo "Monitoring found installed, fixing ownership of objects in pf9-monitoring" fi - # Need to create configmap because we are upgrading from an older pf9-kube version + # Need to create configmap because we are upgrading from an older pf9-kube version # where the new owner configmap was not present ${KUBECTL_SYSTEM} create configmap monitoring-owner -n pf9-monitoring \ --dry-run -o yaml | ${KUBECTL_SYSTEM} apply -f - @@ -1025,7 +1025,7 @@ function ensure_dns() { local coredns_template="${CONF_SRC_DIR}/networkapps/coredns.yaml" local coredns_file="${CONF_SRC_DIR}/networkapps/coredns-applied.yaml" - local k8s_registry="${K8S_PRIVATE_REGISTRY:-k8s.gcr.io}" + local k8s_registry="${K8S_PRIVATE_REGISTRY:-registry.k8s.io}" # Replace configuration values in calico spec with user input sed -e "s|__DNS_IP__|${DNS_IP}|g" \ diff --git a/nodelet/pkg/pf9kube/pf9/pf9-kube/os.sh b/nodelet/pkg/pf9kube/pf9/pf9-kube/os.sh index 4b463200..4d419415 100644 --- a/nodelet/pkg/pf9kube/pf9/pf9-kube/os.sh +++ b/nodelet/pkg/pf9kube/pf9/pf9-kube/os.sh @@ -1,16 +1,27 @@ source /etc/os-release if [[ "$ID" == "ubuntu" ]]; then - if [[ "$VERSION_ID" == "16.04" || "$VERSION_ID" == "18.04" || "$VERSION_ID" == "20.04" ]]; then + if [[ "$VERSION_ID" == "16.04" || "$VERSION_ID" == "18.04" || "$VERSION_ID" == "20.04" || "$VERSION_ID" == "22.04" ]]; then source os_ubuntu.sh export OS_FAMILY="ubuntu" + export OS_VERSION="${VERSION_ID}" else echo "Unknown Ubuntu version: ${VERSION_ID}" exit 1 fi -elif [[ "$ID" == "centos" || "$ID" == "rhel" ]]; then +elif [[ "$ID" == "centos" || "$ID" == "rhel" || "$ID" == "rocky" ]]; then source os_centos.sh export OS_FAMILY="centos" + if [[ "$VERSION_ID" =~ 9.* ]]; then + export OS_VERSION="9.x" + elif [[ "$VERSION_ID" =~ 8.* ]]; then + export OS_VERSION="8.x" + elif [[ "$VERSION_ID" =~ 7.* ]]; then + export OS_VERSION="7.x" + else + echo "Unknown CentOS/RHEL version: ${VERSION_ID}" + exit 1 + fi else echo "Unknown OS: ${ID}" exit 1 diff --git a/nodelet/pkg/pf9kube/pf9/pf9-kube/os_centos.sh b/nodelet/pkg/pf9kube/pf9/pf9-kube/os_centos.sh index b03dfdcd..e3705a62 100644 --- a/nodelet/pkg/pf9kube/pf9/pf9-kube/os_centos.sh +++ b/nodelet/pkg/pf9kube/pf9/pf9-kube/os_centos.sh @@ -9,14 +9,18 @@ DOCKER_PACKAGE="docker-ce" DOCKER_CLI="docker-ce-cli" CONTAINERD_PACKAGE="containerd.io" -if [[ "$VERSION_ID" =~ ^8.* ]]; then +if [[ "$VERSION_ID" =~ ^9.* ]]; then + DOCKER_PACKAGE_VERSION="3:20.10.24-3.el9" + DOCKER_CLI_VERSION="1:20.10.24-3.el9" + CONTAINERD_PACKAGE_VERSION="1.6.6-3.1.el9" +elif [[ "$VERSION_ID" =~ ^8.* ]]; then DOCKER_PACKAGE_VERSION="3:20.10.6-3.el8" DOCKER_CLI_VERSION="1:20.10.6-3.el8" - CONTAINERD_PACKAGE_VERSION="1.4.12-3.1.el8" + CONTAINERD_PACKAGE_VERSION="1.6.6-3.1.el8" else DOCKER_PACKAGE_VERSION="19.03.11-3.el7" DOCKER_CLI_VERSION="19.03.11-3.el7" - CONTAINERD_PACKAGE_VERSION="1.4.12-3.1.el7" + CONTAINERD_PACKAGE_VERSION="1.6.6-3.1.el7" fi @@ -149,23 +153,39 @@ function install_runtime_repo() { # Add the repository key rpm --import ${DOCKER_CENTOS_REPO_KEY} - # use $'' to make sure \n are interpreted correctly local docker_repo_string=$'[dockerrepo]\nname=Docker CE Stable - \$basearch\n' - if [ ! -z $DOCKER_CENTOS_REPO_URL ]; then - # Install the repository - cat > /etc/yum.repos.d/docker.mirrors < /etc/yum.repos.d/docker.mirrors < /etc/yum.repos.d/docker.repo } diff --git a/nodelet/pkg/pf9kube/pf9/pf9-kube/utils.sh b/nodelet/pkg/pf9kube/pf9/pf9-kube/utils.sh index ba97df69..15f3fe8a 100644 --- a/nodelet/pkg/pf9kube/pf9/pf9-kube/utils.sh +++ b/nodelet/pkg/pf9kube/pf9/pf9-kube/utils.sh @@ -546,7 +546,7 @@ function ensure_kubelet_running() local node_name=$1 local kubeconfig="/etc/pf9/kube.d/kubeconfigs/kubelet.yaml" local log_dir_path="/var/log/pf9/kubelet/" - local k8s_registry="${K8S_PRIVATE_REGISTRY:-k8s.gcr.io}" + local k8s_registry="${K8S_PRIVATE_REGISTRY:-registry.k8s.io}" local pause_img="${k8s_registry}/pause:3.6" prepare_kubelet_bootstrap_config @@ -565,7 +565,7 @@ function ensure_kubelet_running() --pod-infra-container-image=${pause_img} \ --dynamic-config-dir=${KUBELET_DYNAMIC_CONFIG_DIR} \ --cgroup-driver=${CONTAINERD_CGROUP}" - + # container-runtime: The container runtime to use. Possible values: docker, remote # container-runtime-endpoint: The endpoint of remote runtime service. Currently unix socket endpoint is supported on Linux # Examples: unix:///var/run/dockershim.sock or /run/containerd/containerd.sock @@ -580,7 +580,7 @@ function ensure_kubelet_running() if [ "$RUNTIME" == "containerd" ]; then local container_log_max_files=${CONTAINER_LOG_MAX_FILES:-${DOCKER_LOG_MAX_FILE}} - # Why not use DOCKER_LOG_MAX_SIZE variable? + # Why not use DOCKER_LOG_MAX_SIZE variable? # The formatting for docker config is 10m while kubelet expects 10Mi. To avoid implement string manipulation in bash just hardcoding # the same default as docker config for now. local container_log_max_size=${CONTAINER_LOG_MAX_SIZE:-"10Mi"} @@ -719,7 +719,7 @@ function ensure_proxy_running() --privileged \ --volume ${kubeconfig}:${kubeconfig_in_container}" - local k8s_registry="${K8S_PRIVATE_REGISTRY:-k8s.gcr.io}" + local k8s_registry="${K8S_PRIVATE_REGISTRY:-registry.k8s.io}" local container_name="proxy" local container_img="${k8s_registry}/kube-proxy:$KUBERNETES_VERSION" @@ -1227,7 +1227,7 @@ function make_kubeconfig() fi if [[ "$kube_server" == "$MASTER_IP" && "$USE_HOSTNAME" == "true" && "$CLOUD_PROVIDER_TYPE" == "local" && "$MASTER_VIP_ENABLED" == "false" ]]; then kube_server=$HOSTNAME - fi + fi if [ "$K8S_API_PORT" != "443" ]; then kube_server="${kube_server}:${K8S_API_PORT}" fi diff --git a/nodelet/pkg/phases/bash_script_based_phases/bash_script_base.go b/nodelet/pkg/phases/bash_script_based_phases/bash_script_base.go index 5cdcec45..b2ffe3be 100644 --- a/nodelet/pkg/phases/bash_script_based_phases/bash_script_base.go +++ b/nodelet/pkg/phases/bash_script_based_phases/bash_script_base.go @@ -44,7 +44,12 @@ func (p *Phase) GetPhaseName() string { func (p *Phase) runCommand(ctx context.Context, op string, cfg config.Config) ([]string, int) { baseCmd := constants.BaseCommand if _, ok := constants.ValidCgroupOps[op]; ok && cfg.UseCgroups { - baseCmd = constants.BaseCgroupCommand + if cfg.CgroupsV2 { + baseCmd = append(constants.BaseCgroupV2Command, fmt.Sprintf(constants.CgroupV2QuotaParam, cfg.CPULimit)) + baseCmd = append(baseCmd, constants.BaseCommand...) + } else { + baseCmd = constants.BaseCgroupCommand + } } command := append(baseCmd, p.Filename, op) if cfg.IsDebug() { diff --git a/nodelet/pkg/phases/phases.go b/nodelet/pkg/phases/phases.go index 21b76749..76a1dc15 100644 --- a/nodelet/pkg/phases/phases.go +++ b/nodelet/pkg/phases/phases.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "regexp" "time" "github.com/platform9/nodelet/nodelet/pkg/utils/command" @@ -18,7 +19,7 @@ var GetLocalCmd = command.New // InitAndLoadRolePhases initializes and then returns an map of order -> phase // when successful otherwise returns an error -func InitAndLoadRolePhases(ctx context.Context, cfg config.Config) ([]PhaseInterface, error) { +func InitAndLoadRolePhases(ctx context.Context, cfg *config.Config) ([]PhaseInterface, error) { var err error if cfg.UseCgroups { if cfg.DisableScripts { @@ -49,9 +50,20 @@ func InitAndLoadRolePhases(ctx context.Context, cfg config.Config) ([]PhaseInter return phaseList, nil } -func setupCgroup(ctx context.Context, cfg config.Config) error { +func setupCgroup(ctx context.Context, cfg *config.Config) error { localCmd := GetLocalCmd() commands := [][]string{} + + _, err := localCmd.RunCommand(ctx, nil, -1, "", "grep", "-i", "Rocky", "/etc/os-release") + if err == nil { + _, out, err := localCmd.RunCommandWithStdOut(ctx, nil, -1, "", "sed", "-nE", `s/^VERSION_ID=(.+)/\1/p`, "/etc/os-release") + if err == nil && len(out) > 0 { + if match, _ := regexp.MatchString(`.*9\.1\.*`, string(out[0])); match { + cfg.CgroupsV2 = true + } + } + } + // CPU limit percentage cpuQuotaPtc := cfg.CPULimit if cpuQuotaPtc <= 0 || cpuQuotaPtc > 100 { @@ -61,18 +73,20 @@ func setupCgroup(ctx context.Context, cfg config.Config) error { // Convert CPU limit percentage to time slice in microseconds // Refer last example here - https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt // We are trying to calculate a quota limit considering the period of 1s i.e. 1000000us - cpuQuota := cpuQuotaPtc / 100 * float64((1 * time.Second).Microseconds()) - cpuQuotaCmd := append(constants.CgroupQuotaCmd, fmt.Sprintf(constants.CgroupQuotaParam, cpuQuota), constants.CgroupName) - commands = append(commands, constants.CgroupCreateCmd) - commands = append(commands, constants.CgroupPeriodCmd) - commands = append(commands, cpuQuotaCmd) - for _, command := range commands { - exec := command[0] - args := command[1:] - _, err := localCmd.RunCommand(ctx, nil, -1, "", exec, args...) - if err != nil { - zap.S().Warnf("Error running command: %v", command) - return err + if !cfg.CgroupsV2 { + cpuQuota := cpuQuotaPtc / 100 * float64((1 * time.Second).Microseconds()) + cpuQuotaCmd := append(constants.CgroupQuotaCmd, fmt.Sprintf(constants.CgroupQuotaParam, cpuQuota), constants.CgroupName) + commands = append(commands, constants.CgroupCreateCmd) + commands = append(commands, constants.CgroupPeriodCmd) + commands = append(commands, cpuQuotaCmd) + for _, command := range commands { + exec := command[0] + args := command[1:] + _, err := localCmd.RunCommand(ctx, nil, -1, "", exec, args...) + if err != nil { + zap.S().Warnf("Error running command: %v", command) + return err + } } } return nil diff --git a/nodelet/pkg/phases/phases_suite_test.go b/nodelet/pkg/phases/phases_suite_test.go index 7221115c..995f9ddb 100644 --- a/nodelet/pkg/phases/phases_suite_test.go +++ b/nodelet/pkg/phases/phases_suite_test.go @@ -62,7 +62,7 @@ var _ = Describe("Test phases.go", func() { fakeCfg.DisableScripts = false fakeCfg.ClusterRole = "master" setupCgroupCmdMocks(true, mockCtrl, ctx) - phases, err := phases.InitAndLoadRolePhases(ctx, *fakeCfg) + phases, err := phases.InitAndLoadRolePhases(ctx, fakeCfg) assert.Nil(GinkgoT(), err) assert.NotEmpty(GinkgoT(), phases) }) @@ -71,7 +71,7 @@ var _ = Describe("Test phases.go", func() { fakeCfg.DisableScripts = false fakeCfg.ClusterRole = "worker" setupCgroupCmdMocks(true, mockCtrl, ctx) - phases, err := phases.InitAndLoadRolePhases(ctx, *fakeCfg) + phases, err := phases.InitAndLoadRolePhases(ctx, fakeCfg) assert.Nil(GinkgoT(), err) assert.NotEmpty(GinkgoT(), phases) }) @@ -80,7 +80,7 @@ var _ = Describe("Test phases.go", func() { fakeCfg.DisableScripts = false fakeCfg.ClusterRole = "none" setupCgroupCmdMocks(true, mockCtrl, ctx) - phases, err := phases.InitAndLoadRolePhases(ctx, *fakeCfg) + phases, err := phases.InitAndLoadRolePhases(ctx, fakeCfg) assert.Nil(GinkgoT(), err) assert.NotEmpty(GinkgoT(), phases) }) @@ -92,7 +92,7 @@ var _ = Describe("Test phases.go", func() { fakeCfg.DisableScripts = false fakeCfg.ClusterRole = "master" setupCgroupCmdMocks(false, mockCtrl, ctx) - phases, err := phases.InitAndLoadRolePhases(ctx, *fakeCfg) + phases, err := phases.InitAndLoadRolePhases(ctx, fakeCfg) assert.Nil(GinkgoT(), err) assert.NotEmpty(GinkgoT(), phases) }) @@ -101,7 +101,7 @@ var _ = Describe("Test phases.go", func() { fakeCfg.DisableScripts = false fakeCfg.ClusterRole = "worker" setupCgroupCmdMocks(false, mockCtrl, ctx) - phases, err := phases.InitAndLoadRolePhases(ctx, *fakeCfg) + phases, err := phases.InitAndLoadRolePhases(ctx, fakeCfg) assert.Nil(GinkgoT(), err) assert.NotEmpty(GinkgoT(), phases) }) @@ -110,7 +110,7 @@ var _ = Describe("Test phases.go", func() { fakeCfg.DisableScripts = false fakeCfg.ClusterRole = "none" setupCgroupCmdMocks(false, mockCtrl, ctx) - phases, err := phases.InitAndLoadRolePhases(ctx, *fakeCfg) + phases, err := phases.InitAndLoadRolePhases(ctx, fakeCfg) assert.Nil(GinkgoT(), err) assert.NotEmpty(GinkgoT(), phases) }) @@ -126,6 +126,8 @@ func setupCgroupCmdMocks(enabled bool, mockCtrl *gomock.Controller, ctx context. if enabled { cmdCount = 1 } + mockCmd.EXPECT().RunCommand(ctx, nil, -1, "", "grep", gomock.Any(), gomock.Any(), "/etc/os-release").Return(0, nil).Times(cmdCount) + mockCmd.EXPECT().RunCommandWithStdOut(ctx, nil, -1, "", "sed", gomock.Any(), gomock.Any(), "/etc/os-release").Return(0, []string{}, nil).Times(cmdCount) mockCmd.EXPECT().RunCommand(ctx, nil, -1, "", constants.CgroupCreateCmd[0], constants.CgroupCreateCmd[1], gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(0, nil).Times(cmdCount) mockCmd.EXPECT().RunCommand(ctx, nil, -1, "", constants.CgroupPeriodCmd[0], constants.CgroupPeriodCmd[1], gomock.Any(), gomock.Any(), gomock.Any()).Return(0, nil).Times(cmdCount) defaultCPUQuota := fmt.Sprintf(constants.CgroupQuotaParam, 400000) diff --git a/nodelet/pkg/utils/config/config.go b/nodelet/pkg/utils/config/config.go index 279e7dba..64962732 100644 --- a/nodelet/pkg/utils/config/config.go +++ b/nodelet/pkg/utils/config/config.go @@ -27,6 +27,7 @@ var DefaultConfig = Config{ ConnectTimeout: 20, FullRetryCount: 10, UseCgroups: true, + CgroupsV2: false, PhaseRetry: 3, CPULimit: 40, // percentage LoopInterval: constants.DefaultLoopInterval, // seconds @@ -62,6 +63,7 @@ type Config struct { KubeServiceState string `mapstructure:"KUBE_SERVICE_STATE"` FullRetryCount int `mapstructure:"FULL_RETRY_COUNT"` UseCgroups bool `mapstructure:"USE_CGROUPS"` + CgroupsV2 bool `mapstructure:"CGROUPS_V2"` PhaseRetry int `mapstructure:"PHASE_RETRY"` CPULimit float64 `mapstructure:"CPU_LIMIT"` PF9StatusThresholdSeconds int `mapstructure:"PF9_STATUS_THRESHOLD_SECONDS"` @@ -138,7 +140,8 @@ func getDefaultConfig() *Config { /* GetConfigFromDir : Tries to load YAML config files from configDir i.e. /etc/pf9/nodelet directory. - This function returns an error if the directory is inaccessible or if no config files could be loaded + + This function returns an error if the directory is inaccessible or if no config files could be loaded */ func GetConfigFromDir(configDir string) (*Config, error) { pf9File := fileio.New() diff --git a/nodelet/pkg/utils/config/config_suite_test.go b/nodelet/pkg/utils/config/config_suite_test.go index 085bd680..aa96fbf3 100644 --- a/nodelet/pkg/utils/config/config_suite_test.go +++ b/nodelet/pkg/utils/config/config_suite_test.go @@ -38,6 +38,7 @@ var _ = Describe("Test config.go", func() { KubeServiceState: constants.ServiceStateTrue, FullRetryCount: 10, UseCgroups: true, + CgroupsV2: false, PhaseRetry: 3, CPULimit: 40, PF9StatusThresholdSeconds: 30, diff --git a/nodelet/pkg/utils/config/testdata/multipleConfig/config.yaml b/nodelet/pkg/utils/config/testdata/multipleConfig/config.yaml index 43f55e5e..4eee51e8 100644 --- a/nodelet/pkg/utils/config/testdata/multipleConfig/config.yaml +++ b/nodelet/pkg/utils/config/testdata/multipleConfig/config.yaml @@ -9,6 +9,7 @@ CONNECTION_TIMEOUT: 30 KUBE_SERVICE_STATE: "true" FULL_RETRY_COUNT: 10 USE_CGROUPS: True +CGROUPS_V2: False PHASE_RETRY: 3 CPU_LIMIT: 40.0 PF9_STATUS_THRESHOLD_SECONDS: 30 diff --git a/nodelet/pkg/utils/config/testdata/singleConfig/config.yaml b/nodelet/pkg/utils/config/testdata/singleConfig/config.yaml index 43f55e5e..4eee51e8 100644 --- a/nodelet/pkg/utils/config/testdata/singleConfig/config.yaml +++ b/nodelet/pkg/utils/config/testdata/singleConfig/config.yaml @@ -9,6 +9,7 @@ CONNECTION_TIMEOUT: 30 KUBE_SERVICE_STATE: "true" FULL_RETRY_COUNT: 10 USE_CGROUPS: True +CGROUPS_V2: False PHASE_RETRY: 3 CPU_LIMIT: 40.0 PF9_STATUS_THRESHOLD_SECONDS: 30 diff --git a/nodelet/pkg/utils/constants/constants.go b/nodelet/pkg/utils/constants/constants.go index 0bda7ef9..81803821 100644 --- a/nodelet/pkg/utils/constants/constants.go +++ b/nodelet/pkg/utils/constants/constants.go @@ -33,6 +33,8 @@ const ( CgroupName = "pf9-kube-status" // CgroupQuotaParam : Cgroup param to set to limit CPU quotas CgroupQuotaParam = "cpu.cfs_quota_us=%v" + // CgroupV2QuotaParam : Cgroup param to set to limit CPU quotas, for cgroup v2 + CgroupV2QuotaParam = "CPUQuota=%v%%" // NotStartedState Phase state when no operation has been performed NotStartedState = "not-started" // RunningState Phase state when start operation was successful @@ -97,6 +99,8 @@ var ( BaseCgroupCommand = []string{"cgexec", "-g", "cpu:pf9-kube-status", "sudo", "/opt/pf9/pf9-kube/setup_env_and_run_script.sh"} // CgroupCreateCmd : Command for creating cgroup CgroupCreateCmd = []string{"sudo", "/usr/bin/cgcreate", "-a", "pf9:pf9group", "-t", "pf9:pf9group", "-g", "cpu:pf9-kube-status"} + //BaseCgroupV2Command: Base command to be used for invoking different phase scripts for cgroups v2 + BaseCgroupV2Command = []string{"sudo", "systemd-run", "--slice=cpu.slice:pf9-kube-status", "--pty", "--quiet", "-p", "CPUAccounting=true", "-p", "CPUQuotaPeriodSec=1000ms", "-p"} // CgroupPeriodCmd : Command for setting cpu.cfs_period_us property to 1s CgroupPeriodCmd = []string{"sudo", "/usr/bin/cgset", "-r", "cpu.cfs_period_us=1000000", CgroupName} // CgroupQuotaCmd : Base command for setting cpu.cfs_quota_us property @@ -130,10 +134,10 @@ var ( // MobyNamespace is namespace for docker MobyNamespace = "moby" // K8sRegistry represents registry for official images for kubernetes - K8sRegistry = "k8s.gcr.io" + K8sRegistry = "registry.k8s.io" - ServicesCIDR = "10.21.0.0/22" - ServicesCIDRv6 = "fd00:102::/116" + ServicesCIDR = "10.21.0.0/22" + ServicesCIDRv6 = "fd00:102::/116" ConfigSrcDir = "/opt/pf9/pf9-kube/conf" // CoreDNSTemplate is template file for coredns diff --git a/nodelet/tooling/tree/etc/sudoers.d/pf9-nodelet b/nodelet/tooling/tree/etc/sudoers.d/pf9-nodelet index a55b9940..2d2497e1 100644 --- a/nodelet/tooling/tree/etc/sudoers.d/pf9-nodelet +++ b/nodelet/tooling/tree/etc/sudoers.d/pf9-nodelet @@ -11,11 +11,26 @@ pf9 ALL = NOPASSWD: /opt/pf9/pf9-kube/setup_env_and_run_script.sh /opt/pf9/p NOPASSWD: /usr/bin/cgcreate -a pf9\:pf9group -t pf9\:pf9group -g cpu\:pf9-kube-status, \ NOPASSWD: /usr/bin/cgset -r * pf9-kube-status, \ NOPASSWD: /usr/bin/cgget -g cpu\:pf9-kube-status, \ - NOPASSWD: /usr/bin/systemctl start containerd, \ - NOPASSWD: /usr/bin/systemctl stop containerd, \ - NOPASSWD: /usr/bin/systemctl is-active containerd, \ - NOPASSWD: /usr/bin/chown pf9\:pf9group /run/containerd/containerd.sock, \ - NOPASSWD: /usr/bin/rm -rf /var/lib/nerdctl - + NOPASSWD: /*/chown pf9\:pf9group /var/opt/pf9/kube/kubelet-config/bootstrap-config.yaml, \ + NOPASSWD: /*/chown -R pf9\:pf9group /etc/pf9/*, \ + NOPASSWD: /*/chown pf9\:pf9group /etc/pf9/*, \ + NOPASSWD: /*/chown -R pf9\:pf9group /var/opt/pf9/kube/kubelet-config, \ + NOPASSWD: /*/chown pf9\:pf9group /run/systemd/system/pf9-kubelet.service, \ + NOPASSWD: /*/chmod 770 /run/systemd/system/pf9-kubelet.service, \ + NOPASSWD: /*/chown pf9\:pf9group /run/containerd/containerd.sock, \ + NOPASSWD: /*/systemctl daemon-reload, \ + NOPASSWD: /*/systemctl is-active pf9*, \ + NOPASSWD: /*/systemctl enable pf9*, \ + NOPASSWD: /*/systemctl restart pf9*, \ + NOPASSWD: /*/systemctl start pf9*, \ + NOPASSWD: /*/systemctl stop pf9*, \ + NOPASSWD: /bin/mkdir -p /var/lib/kubelet, \ + NOPASSWD: /bin/mkdir -p /var/opt/pf9/*, \ + NOPASSWD: /usr/bin/touch /run/systemd/system/pf9-kubelet.service, \ + NOPASSWD: /*/systemctl start containerd, \ + NOPASSWD: /*/systemctl stop containerd, \ + NOPASSWD: /*/systemctl is-active containerd, \ + NOPASSWD: /*/rm -rf /var/lib/nerdctl, \ + NOPASSWD: /usr/bin/systemd-run --slice=cpu.slice\:pf9-kube-status --pty --quiet * Defaults:pf9 !requiretty diff --git a/nodeletctl/go.mod b/nodeletctl/go.mod index f992f846..eed69e87 100644 --- a/nodeletctl/go.mod +++ b/nodeletctl/go.mod @@ -8,7 +8,7 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/mitchellh/go-homedir v1.1.0 - github.com/platform9/nodelet/nodelet v0.0.0-20220420170655-9ece5c5b1f61 + github.com/platform9/nodelet/nodelet v0.0.0-20230628163937-b77acde2bc89 github.com/platform9/pf9ctl v0.0.0-20230125134605-3783dcfca904 github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.11.0 diff --git a/nodeletctl/go.sum b/nodeletctl/go.sum index fdd6f20f..543b9dd0 100644 --- a/nodeletctl/go.sum +++ b/nodeletctl/go.sum @@ -96,6 +96,8 @@ github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JP github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= @@ -107,6 +109,7 @@ github.com/Microsoft/hcsshim v0.8.18/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwT github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= +github.com/Microsoft/hcsshim v0.9.2 h1:wB06W5aYFfUB3IvootYAY2WnOmIdgPGfqSI6tufQNnY= github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= @@ -126,6 +129,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492/go.mod h1:9Beu8XsUNNfzml7WBf3QmyPToP1wm1Gj/Vc5UJKqTzU= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -209,6 +214,7 @@ github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4S github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= +github.com/containerd/cgroups v1.0.3 h1:ADZftAkglvCiD44c77s5YmMqaP2pzVCFZvBmAlBdAP4= github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= @@ -233,6 +239,7 @@ github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTV github.com/containerd/containerd v1.5.5/go.mod h1:oSTh0QpT1w6jYcGmbiSbxv9OSQYaa88mPyWIuU79zyo= github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= +github.com/containerd/containerd v1.6.2 h1:pcaPUGbYW8kBw6OgIZwIVIeEhdWVrBzsoCfVJ5BjrLU= github.com/containerd/containerd v1.6.2/go.mod h1:sidY30/InSE1j2vdD1ihtKoJz+lWdaXMdiAeIupaf+s= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -241,12 +248,14 @@ github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cE github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/continuity v0.2.2 h1:QSqfxcn8c+12slxwu00AtzXrsami0MJb/MQs9lOLHLA= github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= @@ -271,10 +280,12 @@ github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDG github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI= github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= +github.com/containerd/typeurl v1.0.2 h1:Chlt8zIieDbzQFzXzAeBEF92KhExuE4p9p92/QmY7aY= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= @@ -344,6 +355,7 @@ github.com/docker/docker v20.10.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05b github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= @@ -438,6 +450,7 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= +github.com/gogo/googleapis v1.4.0 h1:zgVt4UpGxcqVOw97aRGxT4svlcmdK35fynLNctY32zI= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -453,6 +466,7 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -650,6 +664,7 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6eVEN4= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -723,11 +738,14 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= +github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/signal v0.6.0 h1:aDpY94H8VlhTGa9sNYUFCFsMZIUh5wm0B6XkIoJj/iY= github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= @@ -786,9 +804,11 @@ github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1 github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -797,17 +817,20 @@ github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rm github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runc v1.0.1/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/runc v1.1.0 h1:O9+X96OcDjkmmZyfaG996kV7yq8HsoU2h1XRRQcefG8= github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 h1:3snG66yBm59tKhhSPQrQ/0bCrv1LQbKt40LnUPiUxdc= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/opencontainers/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -829,11 +852,11 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pkg/sftp v1.12.0/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/platform9/nodelet/nodelet v0.0.0-20220420170655-9ece5c5b1f61 h1:H/LuV2kHpdMfjbw0XodT2hj3Z/P03z/YgzqzbxDlMtM= -github.com/platform9/nodelet/nodelet v0.0.0-20220420170655-9ece5c5b1f61/go.mod h1:ULPPCxfjvBhze6Vyw93cVMMy0xOjS2Mmyc6XRiOBIi8= +github.com/platform9/nodelet/nodelet v0.0.0-20230628163937-b77acde2bc89 h1:TRjHqveVHnJhfAmT9cmUZMS30w+YOk7Y297Z9pENMA8= +github.com/platform9/nodelet/nodelet v0.0.0-20230628163937-b77acde2bc89/go.mod h1:JxhpIApISZo6HWuewPhznqkSam4aEq0HHYVRpsipYC8= github.com/platform9/pf9-qbert/sunpike/apiserver v0.0.0-20210928133414-c4e8ce211671 h1:0Cw1OpBrYwy2rMemFwAqIO69AlU/uH8n7qED7cbMD50= github.com/platform9/pf9-qbert/sunpike/apiserver v0.0.0-20210928133414-c4e8ce211671/go.mod h1:j28m/sxhoHx59pAUgRQoa+qqlQZ3tg4zf37sg4e/ibQ= -github.com/platform9/pf9-qbert/sunpike/conductor v0.0.0-20210928133414-c4e8ce211671/go.mod h1:3WMWXxOKjUZtvqDe2MUFOZuogVcyAdKG/obAoyjTBoU= +github.com/platform9/pf9-qbert/sunpike/conductor v0.0.0-20221207021428-7b763143f9f5/go.mod h1:121XjMoOSHw8bvobMfJoNH5J3h+GcwZlCo2T1N4O+4c= github.com/platform9/pf9ctl v0.0.0-20230125134605-3783dcfca904 h1:PLrnZA286fdSJFWyc/amgxRy7l1zFxs+fA3FOr272Ws= github.com/platform9/pf9ctl v0.0.0-20230125134605-3783dcfca904/go.mod h1:f1j2irdWF84iQW/BSy+qgdyCkjDtR0RhYvoY1zfyv1k= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -850,6 +873,7 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -864,6 +888,7 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -895,6 +920,7 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shipengqi/kube v0.1.1/go.mod h1:UKykaaxHTcPRfLQcrIsupyqhJBDWutLO0Jd72krxEc8= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -903,6 +929,7 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -974,6 +1001,7 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= @@ -996,6 +1024,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -1028,6 +1057,7 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= @@ -1186,6 +1216,7 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1227,6 +1258,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1343,6 +1375,7 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1442,6 +1475,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1683,6 +1717,7 @@ k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= k8s.io/api v0.23.0-alpha.0/go.mod h1:n6hBqldEs3Cd+49SZRIlaaq4LM1hzfsX0ysmGeIS0bE= +k8s.io/api v0.23.1/go.mod h1:WfXnOnwSqNtG62Y1CdjoMxh7r7u9QXGCkA1u0na2jgo= k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/api v0.23.6 h1:yOK34wbYECH4RsJbQ9sfkFK3O7f/DUHRlzFehkqZyVw= @@ -1693,6 +1728,7 @@ k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MA k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= k8s.io/apimachinery v0.23.0-alpha.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/apimachinery v0.23.1/go.mod h1:SADt2Kl8/sttJ62RRsi9MIV4o8f5S3coArm0Iu3fBno= k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.6 h1:RH1UweWJkWNTlFx0D8uxOpaU1tjIOvVVWV/bu5b3/NQ= @@ -1702,18 +1738,21 @@ k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= k8s.io/cli-runtime v0.23.0-alpha.0/go.mod h1:fBuMiBaV5dq3w580DiNINcrlPV5oMSlYHy0CmaI7AWo= +k8s.io/cli-runtime v0.23.1/go.mod h1:r9r8H/qfXo9w+69vwUL7LokKlLRKW5D6A8vUKCx+YL0= k8s.io/cli-runtime v0.23.4/go.mod h1:7KywUNTUibmHPqmpDFuRO1kc9RhsufHv2lkjCm2YZyM= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= k8s.io/client-go v0.23.0-alpha.0/go.mod h1:Ys3VXCtIsVMlVnHA9PV0l6M9dsO5IKEFj39X3pUxLg4= +k8s.io/client-go v0.23.1/go.mod h1:6QSI8fEuqD4zgFK0xbdwfB/PthBsIxCJMa3s17WlcO0= k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= k8s.io/client-go v0.23.6 h1:7h4SctDVQAQbkHQnR4Kzi7EyUyvla5G1pFWf4+Od7hQ= k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= k8s.io/code-generator v0.23.0-alpha.0/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= +k8s.io/code-generator v0.23.1/go.mod h1:V7yn6VNTCWW8GqodYCESVo95fuiEg713S8B7WacWZDA= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= @@ -1745,6 +1784,7 @@ k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lV k8s.io/kubectl v0.23.0-alpha.0/go.mod h1:Uu2nTabrTjyuPffcnrhskUMIG/iFpiiCulHZJ6kACyk= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/metrics v0.23.0-alpha.0/go.mod h1:fsRlJ79zQvsl+JvDEtPhOCY46TrfOtWRB8bSkxXKZxo= +k8s.io/metrics v0.23.1/go.mod h1:qXvsM1KANrc+ZZeFwj6Phvf0NLiC+d3RwcsLcdGc+xs= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/config/config.go b/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/config/config.go index 35fff147..64962732 100644 --- a/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/config/config.go +++ b/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/config/config.go @@ -27,6 +27,7 @@ var DefaultConfig = Config{ ConnectTimeout: 20, FullRetryCount: 10, UseCgroups: true, + CgroupsV2: false, PhaseRetry: 3, CPULimit: 40, // percentage LoopInterval: constants.DefaultLoopInterval, // seconds @@ -44,6 +45,11 @@ var DefaultConfig = Config{ GRPCRetryTimeoutSeconds: 5, NumCmdOutputLinesToLog: 10, // 0 indicates no command lines to be logged UserImagesDir: constants.UserImagesDir, + CoreDNSHostsFile: constants.CoreDNSHostsFile, + K8sPrivateRegistry: constants.K8sRegistry, + ServicesCIDR: constants.ServicesCIDR, + ServicesCIDRv6: constants.ServicesCIDRv6, + Dualstack: false, } // Config a struct to load the values from viper for future use. @@ -57,6 +63,7 @@ type Config struct { KubeServiceState string `mapstructure:"KUBE_SERVICE_STATE"` FullRetryCount int `mapstructure:"FULL_RETRY_COUNT"` UseCgroups bool `mapstructure:"USE_CGROUPS"` + CgroupsV2 bool `mapstructure:"CGROUPS_V2"` PhaseRetry int `mapstructure:"PHASE_RETRY"` CPULimit float64 `mapstructure:"CPU_LIMIT"` PF9StatusThresholdSeconds int `mapstructure:"PF9_STATUS_THRESHOLD_SECONDS"` @@ -77,11 +84,21 @@ type Config struct { GRPCRetryTimeoutSeconds int `mapstructure:"GRPC_RETRY_TIMEOUT_SECONDS"` NumCmdOutputLinesToLog int `mapstructure:"NUM_CMD_OP_LINES_TO_LOG"` CloudProviderType string `mapstructure:"CLOUD_PROVIDER_TYPE"` - UseHostname string `mapstructure:"USE_HOSTNAME"` + UseHostname bool `mapstructure:"USE_HOSTNAME"` MasterIp string `mapstructure:"MASTER_IP"` + MasterIPv6 string `mapstructure:"MASTER_IPV6"` K8sApiPort string `mapstructure:"K8S_API_PORT"` MasterSchedulable bool `mapstructure:"ALLOW_WORKLOADS_ON_MASTER"` UserImagesDir string `mapstructure:"USER_IMAGES_DIR"` + K8sPrivateRegistry string `mapstructure:"K8S_PRIVATE_REGISTRY"` + ServicesCIDR string `mapstructure:"SERVICES_CIDR"` + AppCatalogEnabled bool `mapstructure:"APP_CATALOG_ENABLED"` + KubeletCloudConfig string `mapstructure:"KUBELET_CLOUD_CONFIG"` + CoreDNSHostsFile string `mapstructure:"COREDNS_HOSTS_FILE"` + IPv6Enabled bool `mapstructure:"IPV6_ENABLED"` + IPv4Enabled bool `mapstructure:"IPV4_ENABLED"` + Dualstack bool `mapstructure:"DUALSTACK"` + ServicesCIDRv6 string `mapstructure:"SERVICES_CIDR_V6"` } // ToStringMap converts the Config struct to a map of strings @@ -123,7 +140,8 @@ func getDefaultConfig() *Config { /* GetConfigFromDir : Tries to load YAML config files from configDir i.e. /etc/pf9/nodelet directory. - This function returns an error if the directory is inaccessible or if no config files could be loaded + + This function returns an error if the directory is inaccessible or if no config files could be loaded */ func GetConfigFromDir(configDir string) (*Config, error) { pf9File := fileio.New() diff --git a/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/constants/constants.go b/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/constants/constants.go index 1125fd2c..81803821 100644 --- a/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/constants/constants.go +++ b/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/constants/constants.go @@ -1,6 +1,8 @@ package constants -import "fmt" +import ( + "fmt" +) const ( // ConfigDir : Directory for nodelet config files @@ -31,6 +33,8 @@ const ( CgroupName = "pf9-kube-status" // CgroupQuotaParam : Cgroup param to set to limit CPU quotas CgroupQuotaParam = "cpu.cfs_quota_us=%v" + // CgroupV2QuotaParam : Cgroup param to set to limit CPU quotas, for cgroup v2 + CgroupV2QuotaParam = "CPUQuota=%v%%" // NotStartedState Phase state when no operation has been performed NotStartedState = "not-started" // RunningState Phase state when start operation was successful @@ -72,12 +76,20 @@ const ( DefaultSunpikeConfigPath = "/etc/pf9/nodelet/config_sunpike.yaml" // TrueString represents true as a string in nodeletd TrueString = "true" - //LoopBackIpString represents loopback IP string also known as localhost + // LoopBackIpString represents loopback IP string also known as localhost LoopBackIpString = "127.0.0.1" // LocalHost represents localhost as a string LocalHostString = "localhost" - //LocalCloudProvider represents cloud provider type as local + // LocalCloudProvider represents cloud provider type as local LocalCloudProvider = "local" + // RuntimeContainerd represents containerd service + RuntimeContainerd = "containerd" + + CgroupSystemd = "SystemdCgroup" + + IsActiveOp = "is-active" + + ActiveState = "active" ) var ( @@ -87,6 +99,8 @@ var ( BaseCgroupCommand = []string{"cgexec", "-g", "cpu:pf9-kube-status", "sudo", "/opt/pf9/pf9-kube/setup_env_and_run_script.sh"} // CgroupCreateCmd : Command for creating cgroup CgroupCreateCmd = []string{"sudo", "/usr/bin/cgcreate", "-a", "pf9:pf9group", "-t", "pf9:pf9group", "-g", "cpu:pf9-kube-status"} + //BaseCgroupV2Command: Base command to be used for invoking different phase scripts for cgroups v2 + BaseCgroupV2Command = []string{"sudo", "systemd-run", "--slice=cpu.slice:pf9-kube-status", "--pty", "--quiet", "-p", "CPUAccounting=true", "-p", "CPUQuotaPeriodSec=1000ms", "-p"} // CgroupPeriodCmd : Command for setting cpu.cfs_period_us property to 1s CgroupPeriodCmd = []string{"sudo", "/usr/bin/cgset", "-r", "cpu.cfs_period_us=1000000", CgroupName} // CgroupQuotaCmd : Base command for setting cpu.cfs_quota_us property @@ -107,12 +121,42 @@ var ( ChecksumDir = fmt.Sprintf("%s/checksum", UserImagesDir) // ChecksumFile contains sha256 hash for tar archives of user images ChecksumFile = fmt.Sprintf("%s/sha256sums.txt", ChecksumDir) - // ContainerdAddress is default address for containerd socket - ContainerdAddress = "/run/containerd/containerd.sock" + // ContainerdSocket is default address for containerd socket + ContainerdSocket = "/run/containerd/containerd.sock" // DefaultSnapShotter is default snapshotter for containerd DefaultSnapShotter = "overlayfs" - //K8sNamespace is namespace for kubernetes + // Containerd binary path + ContainerdBinPath = "/usr/local/bin/containerd" + // Nerdctl directory path + NerdctlDir = "/var/lib/nerdctl" + // K8sNamespace is namespace for kubernetes K8sNamespace = "k8s.io" + // MobyNamespace is namespace for docker + MobyNamespace = "moby" + // K8sRegistry represents registry for official images for kubernetes + K8sRegistry = "registry.k8s.io" + + ServicesCIDR = "10.21.0.0/22" + ServicesCIDRv6 = "fd00:102::/116" + + ConfigSrcDir = "/opt/pf9/pf9-kube/conf" + // CoreDNSTemplate is template file for coredns + CoreDNSTemplate = fmt.Sprintf("%s/networkapps/coredns.yaml", ConfigSrcDir) + // CoreDNSFile is applied coredns file + CoreDNSFile = fmt.Sprintf("%s/networkapps/coredns-applied.yaml", ConfigSrcDir) + CoreDNSHostsFile = "/etc/hosts" + + CloudConfigFile = "/etc/pf9/kube.d/cloud-config" + + EtcContainerdDir = "/etc/containerd" + + ContainerdConfigFile = fmt.Sprintf("%s/config.toml", EtcContainerdDir) + + ContainerdCgroup = "systemd" + + Pf9User = "pf9" + + Pf9Group = "pf9group" // Phase orders of all the phases NoRolePhaseOrder = 10 diff --git a/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/fileio/fileio.go b/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/fileio/fileio.go index 10fc9ece..f149d1bb 100644 --- a/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/fileio/fileio.go +++ b/nodeletctl/vendor/github.com/platform9/nodelet/nodelet/pkg/utils/fileio/fileio.go @@ -1,14 +1,19 @@ package fileio import ( + "archive/tar" "bufio" + "compress/gzip" "crypto/sha256" + "encoding/base64" "encoding/hex" "encoding/json" "fmt" + "html/template" "io" "io/ioutil" "os" + "path/filepath" "github.com/pkg/errors" "go.uber.org/zap" @@ -42,6 +47,10 @@ type FileInterface interface { VerifyChecksum(string) (bool, error) GenerateHashForDir(string) ([]string, error) GenerateHashForFile(string) (string, error) + NewYamlFromTemplateYaml(string, string, interface{}) error + ListFilesWithPatterns(string, []string) ([]string, error) + WriteToFileWithBase64Decoding(string, string) error + Extract(string, string) error } // TouchFile creates an empty file @@ -260,7 +269,7 @@ func (f *Pf9FileIO) GenerateChecksum(imageDir string) error { } ChecksumDir := fmt.Sprintf("%s/checksum", imageDir) if _, err := os.Stat(ChecksumDir); os.IsNotExist(err) { - if err := os.Mkdir(ChecksumDir, os.ModePerm); err != nil { + if err := os.MkdirAll(ChecksumDir, os.ModePerm); err != nil { return errors.Wrapf(err, "failed to create directory: %s", ChecksumDir) } } @@ -332,6 +341,51 @@ func (f *Pf9FileIO) GenerateHashForFile(fileName string) (string, error) { return fileData, nil } +// NewYamlFromTemplateYaml creates new yaml from template yaml file by replacing the value in provided data +func (f *Pf9FileIO) NewYamlFromTemplateYaml(templFile string, outFile string, data interface{}) error { + + fw, err := os.Create(outFile) + if err != nil { + return err + } + defer fw.Close() + t, err := template.ParseFiles(templFile) + if err != nil { + return err + } + err = t.Execute(fw, data) + if err != nil { + return fmt.Errorf("error executing template: %s", err) + } + return nil +} + +// ListfilesWithPattern returns list of filenames with given patterns from given directory *recursively* +func (f *Pf9FileIO) ListFilesWithPatterns(root string, patterns []string) ([]string, error) { + var matches []string + err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { + return nil + } + for _, p := range patterns { + + if matched, err := filepath.Match(p, filepath.Base(path)); err != nil { + return err + } else if matched { + matches = append(matches, path) + } + } + return nil + }) + if err != nil { + return nil, err + } + return matches, nil +} + // stringSlicesEqual states whether two string slices are equal or not func stringSlicesEqual(a, b []string) bool { if len(a) != len(b) { @@ -344,3 +398,83 @@ func stringSlicesEqual(a, b []string) bool { } return true } + +// WriteToFileWithBase64Decoding writes base64 decoded data of source file to dest file +func (f *Pf9FileIO) WriteToFileWithBase64Decoding(destFile string, srcFile string) error { + src, err := f.ReadFile(srcFile) + if err != nil { + return err + } + dst := make([]byte, base64.StdEncoding.DecodedLen(len(src))) + _, err = base64.StdEncoding.Decode(dst, src) + if err != nil { + return errors.Wrapf(err, "decode error") + } + err = f.WriteToFile(destFile, dst, false) + if err != nil { + return err + } + return nil +} + +// extract the targz file to the destination directory +func (f *Pf9FileIO) Extract(tgzFile string, destDir string) error { + + fl, err := os.Open(tgzFile) + if err != nil { + return fmt.Errorf("error opening tgz file: %v", err) + } + defer fl.Close() + + gzf, err := gzip.NewReader(fl) + if err != nil { + return fmt.Errorf("error creating gzip reader: %v", err) + } + + defer gzf.Close() + tarReader := tar.NewReader(gzf) + + for { + f, err := tarReader.Next() + if err == io.EOF { + break + } + + if err != nil { + return fmt.Errorf("error reading tar file: %v", err) + } + fpath := filepath.Join(destDir, f.Name) + fi := f.FileInfo() + mode := fi.Mode() + switch { + case mode.IsDir(): + err = os.MkdirAll(fpath, 0770) + if err != nil { + return fmt.Errorf("error creating directory: %s %v", fpath, err) + } + case mode.IsRegular(): + // this is redundant + err = os.MkdirAll(filepath.Dir(fpath), 0770) + if err != nil { + return fmt.Errorf("error creating directory: %s %v", filepath.Dir(fpath), err) + } + destFile, err := os.OpenFile(fpath, os.O_CREATE|os.O_RDWR, 0770) + defer destFile.Close() + if err != nil { + return fmt.Errorf("error creating file: %s %v", fpath, err) + } + n, err := io.Copy(destFile, tarReader) + + if err != nil { + return fmt.Errorf("error copying file: %s %v", fpath, err) + } + + if n != f.Size { + return fmt.Errorf("error copying file size written not equal: expected %d, got %d, %s %v", f.Size, n, fpath, err) + } + + } + } + + return nil +} diff --git a/nodeletctl/vendor/modules.txt b/nodeletctl/vendor/modules.txt index 595e5238..b22406a8 100644 --- a/nodeletctl/vendor/modules.txt +++ b/nodeletctl/vendor/modules.txt @@ -80,7 +80,7 @@ github.com/pelletier/go-toml/v2/internal/tracker github.com/pkg/errors # github.com/pkg/sftp v1.13.1 github.com/pkg/sftp -# github.com/platform9/nodelet/nodelet v0.0.0-20220420170655-9ece5c5b1f61 +# github.com/platform9/nodelet/nodelet v0.0.0-20230628163937-b77acde2bc89 ## explicit github.com/platform9/nodelet/nodelet/pkg/utils/config github.com/platform9/nodelet/nodelet/pkg/utils/constants diff --git a/pf9-kube.spec b/pf9-kube.spec index dbf8b4f4..e78331ae 100644 --- a/pf9-kube.spec +++ b/pf9-kube.spec @@ -9,8 +9,7 @@ Provides: pf9app Requires: curl Requires: gzip Requires: net-tools -Requires: libcgroup-tools -Requires: iptables-services +Requires: iptables-services, openssl AutoReqProv: no %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') @@ -72,6 +71,24 @@ rm -rf $RPM_BUILD_ROOT mkdir -p /opt/pf9/home groupadd pf9group || true useradd -d /opt/pf9/home -G pf9group pf9 || true +# Set a flag indicating whether the package check should be performed +perform_package_check=true + +if [[ $(grep "rocky" /etc/os-release) ]]; then + if grep -qE "VERSION_ID=\"9\.[12]\"" /etc/os-release; then + perform_package_check=false + echo "It is Rocky Linux 9, Libcgroup-tools package is not needed" + fi +fi + +# Check if the package check should be performed +if [[ "$perform_package_check" == "true" ]]; then + # Check if libcgroup-tools is installed + if ! rpm -q libcgroup-tools > /dev/null; then + echo "Libcgroup-tools package is not installed. Aborting installation." + exit 1 + fi +fi %post ## Adding ownership tweak (PMK-4129) to %post section instead of %files section since it's not sure if this file exists or not.