Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove containerd proxy config #1

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions controllers/cluster_scripts/cloud_init.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,7 @@ write_files:
systemctl enable --now metering
vmtoolsd --cmd "info-set guestinfo.metering.status successful"

vmtoolsd --cmd "info-set guestinfo.postcustomization.proxy.setting.status in_progress"
export HTTP_PROXY="{{.HTTPProxy}}"
export HTTPS_PROXY="{{.HTTPSProxy}}"
export http_proxy="{{.HTTPProxy}}"
export https_proxy="{{.HTTPSProxy}}"
export NO_PROXY="{{.NoProxy}}"
export no_proxy="{{.NoProxy}}"
cat <<END > /etc/systemd/system/containerd.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY={{.HTTPProxy}}"
Environment="HTTPS_PROXY={{.HTTPSProxy}}"
Environment="http_proxy={{.HTTPProxy}}"
Environment="https_proxy={{.HTTPSProxy}}"
Environment="no_proxy={{.NoProxy}}"
Environment="NO_PROXY={{.NoProxy}}"
END
systemctl daemon-reload
systemctl restart containerd
vmtoolsd --cmd "info-set guestinfo.postcustomization.proxy.setting.status successful" {{- if .NvidiaGPU }}

{{- if .NvidiaGPU }}
vmtoolsd --cmd "info-set guestinfo.postcustomization.nvidia.runtime.install.status in_progress"
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | sudo apt-key add -
Expand Down
20 changes: 10 additions & 10 deletions controllers/vcdmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import (
_ "embed" // this needs go 1.16+
b64 "encoding/base64"
"fmt"
"math"
"strconv"
"strings"
"text/template"
"time"

"github.com/pkg/errors"
cpiutil "github.com/vmware/cloud-provider-for-cloud-director/pkg/util"
"github.com/vmware/cloud-provider-for-cloud-director/pkg/vcdsdk"
Expand All @@ -23,7 +29,6 @@ import (
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/klog"
"math"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/util"
"sigs.k8s.io/cluster-api/util/annotations"
Expand All @@ -36,10 +41,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/source"
"strconv"
"strings"
"text/template"
"time"
)

type CloudInitScriptInput struct {
Expand Down Expand Up @@ -67,6 +68,7 @@ const Mebibyte = 1048576

// The following `embed` directives read the file in the mentioned path and copy the content into the declared variable.
// These variables need to be global within the package.
//
//go:embed cluster_scripts/cloud_init.tmpl
var cloudInitScriptTemplate string

Expand All @@ -75,9 +77,9 @@ type VCDMachineReconciler struct {
client.Client
}

//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines/finalizers,verbs=update
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vcdmachines/finalizers,verbs=update
func (r *VCDMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, rerr error) {
log := ctrl.LoggerFrom(ctx)

Expand Down Expand Up @@ -198,7 +200,6 @@ func patchVCDMachine(ctx context.Context, patchHelper *patch.Helper, vcdMachine

const (
NetworkConfiguration = "guestinfo.postcustomization.networkconfiguration.status"
ProxyConfiguration = "guestinfo.postcustomization.proxy.setting.status"
MeteringConfiguration = "guestinfo.metering.status"
KubeadmInit = "guestinfo.postcustomization.kubeinit.status"
KubeadmNodeJoin = "guestinfo.postcustomization.kubeadm.node.join.status"
Expand All @@ -210,7 +211,6 @@ const (
var controlPlanePostCustPhases = []string{
NetworkConfiguration,
MeteringConfiguration,
ProxyConfiguration,
KubeadmInit,
}

Expand Down