Skip to content

Commit

Permalink
fix merging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Devinwong committed May 3, 2024
1 parent a4c6a51 commit 05f2f0c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 208 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
github.com/Azure/skewer v0.0.19
github.com/Pallinder/go-randomdata v1.2.0
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
github.com/blang/semver v3.5.1+incompatible
github.com/go-logr/logr v1.4.1
github.com/go-logr/zapr v1.3.0
github.com/go-playground/validator/v10 v10.19.0
Expand Down Expand Up @@ -65,10 +64,11 @@ require (
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
Expand Down Expand Up @@ -130,6 +130,7 @@ require (
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.7.0 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0=
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0=
github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df/go.mod h1:hiVxq5OP2bUGBRNS3Z/bt/reCLFNbdcST6gISi1fiOM=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -352,6 +354,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/onsi/ginkgo v1.12.2 h1:Ke9m3h2Hu0wsZ45yewCqhYr3Z+emcNTuLY2nMWCkrSI=
github.com/onsi/ginkgo v1.12.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g=
github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE=
Expand Down
16 changes: 6 additions & 10 deletions pkg/providers/imagefamily/azlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,13 @@ func (u AzureLinux) DefaultImages() []DefaultImageOutput {
func (u AzureLinux) UserData(kubeletConfig *corev1beta1.KubeletConfiguration, taints []v1.Taint, labels map[string]string, caBundle *string, _ *cloudprovider.InstanceType) bootstrap.Bootstrapper {
return bootstrap.AKS{
Options: bootstrap.Options{
ClusterName: u.Options.ClusterName,
ClusterEndpoint: u.Options.ClusterEndpoint,
KubeletConfig: kubeletConfig,
Taints: taints,
Labels: labels,
CABundle: caBundle,
GPUNode: u.Options.GPUNode,
GPUDriverVersion: u.Options.GPUDriverVersion,
// GPUImageSHA: u.Options.GPUImageSHA - GPU image SHA only applies to Ubuntu
ClusterName: u.Options.ClusterName,
ClusterEndpoint: u.Options.ClusterEndpoint,
KubeletConfig: kubeletConfig,
Taints: taints,
Labels: labels,
CABundle: caBundle,
// See: https://github.com/Azure/AgentBaker/blob/f393d6e4d689d9204d6000c85623ad9b764e2a29/vhdbuilder/packer/install-dependencies.sh#L201
SubnetID: u.Options.SubnetID,
},
Arch: u.Options.Arch,
TenantID: u.Options.TenantID,
Expand Down
30 changes: 24 additions & 6 deletions pkg/providers/imagefamily/bootstrap/aksbootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
_ "embed"
"encoding/base64"
"fmt"
"os"
"strings"
"text/template"

"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/karpenter-provider-azure/pkg/utils"
"github.com/samber/lo"
v1 "k8s.io/api/core/v1"
"knative.dev/pkg/ptr"
Expand Down Expand Up @@ -173,8 +173,17 @@ var (
}
)

// Node Labels for Vnet
const (
globalAKSMirror = "https://acs-mirror.azureedge.net"
vnetDataPlaneLabel = "kubernetes.azure.com/ebpf-dataplane"
vnetNetworkNameLabel = "kubernetes.azure.com/network-name"
vnetSubnetNameLabel = "kubernetes.azure.com/network-subnet"
vnetSubscriptionIDLabel = "kubernetes.azure.com/network-subscription"
vnetGUIDLabel = "kubernetes.azure.com/nodenetwork-vnetguid"
vnetPodNetworkTypeLabel = "kubernetes.azure.com/podnetwork-type"
ciliumDataPlane = "cilium"
overlayNetworkType = "overlay"
globalAKSMirror = "https://acs-mirror.azureedge.net"
)

func (a AKS) aksBootstrapScript() (string, error) {
Expand Down Expand Up @@ -239,10 +248,19 @@ func (a AKS) applyOptions(v *nbcontractv1.Configuration) (*nbcontractv1.Configur
kubeletLabels := lo.Assign(kubeletNodeLabelsBase, a.Labels)
getAgentbakerGeneratedLabels(a.ResourceGroup, kubeletLabels)

subnetParts, _ := utils.GetVnetSubnetIDComponents(a.SubnetID)
nbv.Subnet = subnetParts.SubnetName
nbv.VirtualNetworkResourceGroup = subnetParts.ResourceGroupName
nbv.VirtualNetwork = subnetParts.VNetName
//Adding vnet-related labels to the nodeLabels.
azureVnetGUID := os.Getenv("AZURE_VNET_GUID")
azureVnetName := os.Getenv("AZURE_VNET_NAME")
azureSubnetName := os.Getenv("AZURE_SUBNET_NAME")

vnetLabels := map[string]string{
vnetDataPlaneLabel: ciliumDataPlane,
vnetNetworkNameLabel: azureVnetName,
vnetSubnetNameLabel: azureSubnetName,
vnetSubscriptionIDLabel: a.SubscriptionID,
vnetGUIDLabel: azureVnetGUID,
vnetPodNetworkTypeLabel: overlayNetworkType,
}

kubeletLabels = lo.Assign(kubeletLabels, vnetLabels)
nBCB.GetNodeBootstrapConfig().KubeletConfig.KubeletNodeLabels = kubeletLabels
Expand Down
44 changes: 0 additions & 44 deletions pkg/providers/imagefamily/bootstrap/containerd.toml.gtpl

This file was deleted.

146 changes: 0 additions & 146 deletions pkg/providers/imagefamily/bootstrap/cse_cmd.sh.gtpl

This file was deleted.

0 comments on commit 05f2f0c

Please sign in to comment.