Skip to content

Commit

Permalink
downgrade k3d node version, remove k3d hack
Browse files Browse the repository at this point in the history
  • Loading branch information
edude03 committed Dec 17, 2024
1 parent 6f865bd commit b523fdc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,8 @@ k3d-load: k3d # Push docker images to the k3d cluster.
.PHONE: e2e-tools
e2e-tools: k3d kind kubectl kuttl python-init ## Donwnload tools for e2e tests locally if necessary.

.PHONE: k3d-hack
k3d-hack: ## Apply k3d hack to the k3d cluster
$(KUBECTL) -n neonvm-system set env deployment/neonvm-controller K3D_HACK=true
$(KUBECTL) -n neonvm-system rollout status deployment neonvm-controller

.PHONE: e2e
e2e: check-local-context e2e-tools k3d-hack ## Run e2e kuttl tests
e2e: check-local-context e2e-tools ## Run e2e kuttl tests
$(KUTTL) test --config tests/e2e/kuttl-test.yaml $(if $(CI),--skip-delete)
rm -f kubeconfig

Expand Down
2 changes: 1 addition & 1 deletion k3d/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: k3d.io/v1alpha5
kind: Simple
servers: 1
agents: 2
image: rancher/k3s:v1.30.7-k3s1
image: rancher/k3s:v1.30.6-k3s1

options:
k3d: # k3d runtime settings
Expand Down
15 changes: 1 addition & 14 deletions pkg/neonvm/controllers/vm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"os"
"reflect"
"strconv"
"strings"
"time"

nadapiv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
Expand Down Expand Up @@ -1340,7 +1339,7 @@ func podSpec(
// Ensure restrictive context for the container
// More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
SecurityContext: &corev1.SecurityContext{
Privileged: lo.ToPtr(isK3D()),
Privileged: lo.ToPtr(false),
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{
"NET_ADMIN",
Expand Down Expand Up @@ -1673,18 +1672,6 @@ func (r *VMReconciler) tryUpdateVM(ctx context.Context, vm *vmv1.VirtualMachine)
return r.Update(ctx, vm)
}

// K3D has a problem where we can't configure TUN on 1.30, so if the hack is enabled, we enable
// privileged mode for the runner pod.
func isK3D() bool {
switch strings.ToLower(os.Getenv("K3D_HACK")) {
case "true", "1", "y", "yes", "on", "enable", "enabled":
fmt.Println("K3D_HACK is enabled, enabling privileged mode for the runner pod")
return true
default:
return false
}
}

// return Network Attachment Definition name with IPAM settings
func nadIpamName() (string, error) {
return getEnvVarValue("NAD_IPAM_NAME")
Expand Down

0 comments on commit b523fdc

Please sign in to comment.