diff --git a/charts/spiderpool/README.md b/charts/spiderpool/README.md index 174fb0ab51..a0f4258fe1 100644 --- a/charts/spiderpool/README.md +++ b/charts/spiderpool/README.md @@ -200,7 +200,7 @@ helm install spiderpool spiderpool/spiderpool --wait --namespace kube-system \ | `multus.multusCNI.image.repository` | the multus-CNI image repository | `k8snetworkplumbingwg/multus-cni` | | `multus.multusCNI.image.pullPolicy` | the multus-CNI image pullPolicy | `IfNotPresent` | | `multus.multusCNI.image.digest` | the multus-CNI image digest | `""` | -| `multus.multusCNI.image.tag` | the multus-CNI image tag | `v3.9.3` | +| `multus.multusCNI.image.tag` | the multus-CNI image tag | `v4.1.4` | | `multus.multusCNI.image.imagePullSecrets` | the multus-CNI image imagePullSecrets | `[]` | | `multus.multusCNI.defaultCniCRName` | if this value is empty, multus will automatically get default CNI according to the existed CNI conf file in /etc/cni/net.d/, if no cni files found in /etc/cni/net.d, A Spidermultusconfig CR named default will be created, please update the related SpiderMultusConfig for default CNI after installation. The namespace of defaultCniCRName follows with the release namespace of spdierpool | `""` | | `multus.multusCNI.securityContext.privileged` | the securityContext privileged of multus-CNI daemonset pod | `true` | diff --git a/charts/spiderpool/templates/configmap.yaml b/charts/spiderpool/templates/configmap.yaml index 4e47fb0549..ff3cd269ec 100644 --- a/charts/spiderpool/templates/configmap.yaml +++ b/charts/spiderpool/templates/configmap.yaml @@ -13,6 +13,7 @@ metadata: {{- include "tplvalues.render" ( dict "value" .Values.global.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} data: + clusterNetwork: {{ .Values.multus.multusCNI.defaultCniCRName | quote }} conf.yml: | ipamUnixSocketPath: {{ .Values.global.ipamUNIXSocketHostPath }} enableIPv4: {{ .Values.ipam.enableIPv4 }} @@ -31,7 +32,7 @@ data: kind: ConfigMap apiVersion: v1 metadata: - name: {{ .Values.multus.multusCNI.name | trunc 63 | trimSuffix "-" }} + name: {{ .Values.multus.multusCNI.name | trunc 63 | trimSuffix "-" }}-entrypoint namespace: {{ .Release.Namespace | quote }} labels: {{- include "spiderpool.multus.labels" . | nindent 4 }} @@ -39,23 +40,160 @@ metadata: {{- include "tplvalues.render" ( dict "value" .Values.global.commonLabels "context" $ ) | nindent 4 }} {{- end }} data: - cni-conf.json: | + entrypoint.sh: | + #!/bin/bash + set -e + + function log(){ + echo "INFO: $(date --iso-8601=seconds) ${1}" + } + function error(){ + log "ERR: {$1}" + } + function warn(){ + log "WARN: {$1}" + } + + function generateKubeConfig { + # Check if we're running as a k8s pod. + if [ -f "$SERVICE_ACCOUNT_TOKEN_PATH" ]; then + # We're running as a k8d pod - expect some variables. + if [ -z ${KUBERNETES_SERVICE_HOST} ]; then + error "KUBERNETES_SERVICE_HOST not set"; exit 1; + fi + if [ -z ${KUBERNETES_SERVICE_PORT} ]; then + error "KUBERNETES_SERVICE_PORT not set"; exit 1; + fi + + if [ "$SKIP_TLS_VERIFY" == "true" ]; then + TLS_CFG="insecure-skip-tls-verify: true" + elif [ -f "$KUBE_CA_FILE" ]; then + TLS_CFG="certificate-authority-data: $(cat $KUBE_CA_FILE | base64 | tr -d '\n')" + fi + + # Get the contents of service account token. + SERVICEACCOUNT_TOKEN=$(cat $SERVICE_ACCOUNT_TOKEN_PATH) + + SKIP_TLS_VERIFY=${SKIP_TLS_VERIFY:-false} + + # Write a kubeconfig file for the CNI plugin. Do this + # to skip TLS verification for now. We should eventually support + # writing more complete kubeconfig files. This is only used + # if the provided CNI network config references it. + touch $MULTUS_TEMP_KUBECONFIG + chmod ${KUBECONFIG_MODE:-600} $MULTUS_TEMP_KUBECONFIG + # Write the kubeconfig to a temp file first. + timenow=$(date) + cat > $MULTUS_TEMP_KUBECONFIG < $MULTUS_TEMP_CONFIG << EOF { "cniVersion": "0.3.1", "name": "multus-cni-network", "type": "multus", "confDir": "/etc/cni/net.d/" , - "logLevel": "{{ .Values.multus.multusCNI.log.logLevel }}", - "logFile": "{{ .Values.multus.multusCNI.log.logFile }}", + "logLevel": "debug", + "logFile": "/var/log/multus.log", "capabilities": { "portMappings": true, "bandwidth": true }, "namespaceIsolation": false, - "clusterNetwork": "{{ .Values.multus.multusCNI.defaultCniCRName }}", + "clusterNetwork": "$MULTUS_CLUSTER_NETWORK", "defaultNetworks": [], - "multusNamespace": "{{ .Release.Namespace }}", + "multusNamespace": "$MULTUS_NAMESPACE", "systemNamespaces": [], "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig" } -{{- end }} + EOF + + if [ -z "${MULTUS_CLUSTER_NETWORK}" ]; then + log "ENV MULTUS_CLUSTER_NETWORK is empty, Detecting default cni in the ${CNI_CONF_DIR}" + DEFAULT_CNI_FILEPATH=$(ls -l ${CNI_CONF_DIR} | grep ^- | grep -v -i multus | awk '{print $9}' | grep -E '(*\.conf|*\.conflist|*\.json)' | head -n 1) + if [ -z "$DEFAULT_CNI_FILEPATH" ] ; then + error "No default cni file found in ${CNI_CONF_DIR}, please install your default cni in the cluster first" && exit 1 + fi + + log "Found the default-cni file: ${DEFAULT_CNI_FILEPATH}" + log "cat /host/etc/cni/net.d/${DEFAULT_CNI_FILEPATH}:" + cat /host/etc/cni/net.d/${DEFAULT_CNI_FILEPATH} + + echo "" + DEFAULT_CNI_NAME=$(grep '"name":' ${CNI_CONF_DIR}/${DEFAULT_CNI_FILEPATH} | awk '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | tr -d ',' | tr -d '"') + if [ -z "$DEFAULT_CNI_NAME" ] ; then + error "The name fleid shouldn't be empty, please check the default cni: ${DEFAULT_CNI_FILEPATH}" && exit 1 + fi + + log "Updating the clusterNetwork of the multus-cni config to $DEFAULT_CNI_NAME" + sed -i "s?\"clusterNetwork\": \"\"?\"clusterNetwork\": \"${DEFAULT_CNI_NAME}\"?g" /tmp/00-multus.conf + else + log "User set multus ClusterNetwork: $MULTUS_CLUSTER_NETWORK" + fi + + generateKubeConfig + log "multus kubeconfig is generated." + + cp $MULTUS_TEMP_CONFIG /host/etc/cni/net.d + log "multus config file ${MULTUS_TEMP_CONFIG} is copied to ${CNI_CONF_DIR}." + log "cat ${CNI_CONF_DIR}/00-multus.conf" + cat ${CNI_CONF_DIR}/00-multus.conf + + log "Entering watch loop..." + while true; do + + # Check the md5sum of the service account token and ca. + svcaccountsum=$(md5sum $SERVICE_ACCOUNT_TOKEN_PATH | awk '{print $1}') + casum=$(md5sum $KUBE_CA_FILE | awk '{print $1}') + if [ "$svcaccountsum" != "$LAST_SERVICEACCOUNT_MD5SUM" ] || [ "$casum" != "$LAST_KUBE_CA_FILE_MD5SUM" ]; then + log "Detected service account or CA file change, regenerating kubeconfig..." + generateKubeConfig + fi + + # todo: watch the default cni file is changed. + sleep 10 + done +{{- end }} \ No newline at end of file diff --git a/charts/spiderpool/templates/daemonset.yaml b/charts/spiderpool/templates/daemonset.yaml index 7268a15c6e..b34911e1f4 100644 --- a/charts/spiderpool/templates/daemonset.yaml +++ b/charts/spiderpool/templates/daemonset.yaml @@ -100,6 +100,22 @@ spec: - name: cni-bin-path mountPath: /host/opt/cni/bin {{- end }} + {{- if .Values.multus.multusCNI.install }} + - name: install-multus-binary + image: {{ include "spiderpool.multus.image" . | quote }} + imagePullPolicy: IfNotPresent + command: + - /install_multus + args: + - --type + - thin + securityContext: + privileged: true + volumeMounts: + - mountPath: /host/opt/cni/bin + mountPropagation: Bidirectional + name: cni-bin-path + {{- end }} containers: - name: {{ .Values.spiderpoolAgent.name | trunc 63 | trimSuffix "-" }} image: {{ include "spiderpool.spiderpoolAgent.image" . | quote }} @@ -223,47 +239,53 @@ spec: {{- end }} {{- if .Values.multus.multusCNI.install }} - name: multus-cni - imagePullPolicy: {{ .Values.multus.multusCNI.image.pullPolicy }} - image: {{ include "spiderpool.multus.image" . | quote }} + image: {{ include "spiderpool.spiderpoolAgent.image" . | quote }} + imagePullPolicy: {{ .Values.spiderpoolAgent.image.pullPolicy }} command: - - "/bin/sh" - - "-c" - - | - ITEM="multus" - rm -f /host/opt/cni/bin/${ITEM}.old || true - ( [ -f "/host/opt/cni/bin/${ITEM}" ] && mv /host/opt/cni/bin/${ITEM} /host/opt/cni/bin/${ITEM}.old ) || true - cp /usr/src/multus-cni/bin/${ITEM} /host/opt/cni/bin/${ITEM} - rm -f /host/opt/cni/bin/${ITEM}.old &>/dev/null || true - ./entrypoint.sh --multus-conf-file=/tmp/multus-conf/00-multus.conf \ - --cni-version=0.3.1 + - "/home/entrypoint.sh" securityContext: privileged: true - {{- if .Values.multus.multusCNI.uninstall }} + env: + - name: MULTUS_CLUSTER_NETWORK + valueFrom: + configMapKeyRef: + key: clusterNetwork + name: spiderpool-conf + - name: MULTUS_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + resources: + limits: + cpu: 100m + memory: 50Mi + requests: + cpu: 100m + memory: 50Mi + {{- if .Values.multus.multusCNI.uninstall }} lifecycle: preStop: exec: command: - - "/bin/sh" - - "-c" - - | - rm -f /host/opt/cni/bin/multus || true - rm -rf /host/etc/cni/net.d/multus.d || true - rm -f /host/etc/cni/net.d/00-multus.conf || true + - "/bin/sh" + - "-c" + - | + rm -f /host/opt/cni/bin/multus || true + rm -rf /host/etc/cni/net.d/multus.d || true + rm -f /host/etc/cni/net.d/00-multus.conf || true {{- end }} volumeMounts: - name: cni mountPath: /host/etc/cni/net.d - - name: cni-bin-path - mountPath: /host/opt/cni/bin - mountPropagation: Bidirectional - - name: multus-cfg - mountPath: /tmp/multus-conf - {{- if .Values.multus.multusCNI.extraVolumes }} - {{- include "tplvalues.render" ( dict "value" .Values.multus.multusCNI.extraVolumeMounts "context" $ ) | nindent 12 }} - {{- end }} + - mountPath: /home + name: multus-entrypoint + {{- if .Values.multus.multusCNI.extraVolumes }} + {{- include "tplvalues.render" ( dict "value" .Values.multus.multusCNI.extraVolumeMounts "context" $ ) | nindent 10 }} + {{- end }} {{- end }} volumes: - # To read the configuration from the config map + # To read the configuration from the config map - name: config-path configMap: defaultMode: 0400 @@ -282,16 +304,17 @@ spec: - name: cni hostPath: path: /etc/cni/net.d - - name: multus-cfg + - name: multus-entrypoint configMap: - name: {{ .Values.multus.multusCNI.name | trunc 63 | trimSuffix "-" }} + name: {{ .Values.multus.multusCNI.name | trunc 63 | trimSuffix "-" }}-entrypoint + defaultMode: 511 items: - - key: cni-conf.json - path: 00-multus.conf - {{- end }} - {{- if .Values.spiderpoolAgent.extraVolumeMounts }} - {{- include "tplvalues.render" ( dict "value" .Values.spiderpoolAgent.extraVolumeMounts "context" $ ) | nindent 6 }} - {{- end }} - {{- if .Values.multus.multusCNI.extraVolumeMounts }} - {{- include "tplvalues.render" ( dict "value" .Values.multus.multusCNI.extraVolumeMounts "context" $ ) | nindent 8 }} + - key: entrypoint.sh + path: entrypoint.sh {{- end }} + {{- if .Values.spiderpoolAgent.extraVolumeMounts }} + {{- include "tplvalues.render" ( dict "value" .Values.spiderpoolAgent.extraVolumeMounts "context" $ ) | nindent 6 }} + {{- end }} + {{- if .Values.multus.multusCNI.extraVolumeMounts }} + {{- include "tplvalues.render" ( dict "value" .Values.multus.multusCNI.extraVolumeMounts "context" $ ) | nindent 6 }} + {{- end }} diff --git a/charts/spiderpool/templates/pod.yaml b/charts/spiderpool/templates/pod.yaml index 048b1c6ef6..d46b8ea091 100644 --- a/charts/spiderpool/templates/pod.yaml +++ b/charts/spiderpool/templates/pod.yaml @@ -80,19 +80,13 @@ spec: {{- end }} - name: SPIDERPOOL_INIT_ENABLE_MULTUS_CONFIG value: {{ .Values.multus.enableMultusConfig | quote }} - - name: SPIDERPOOL_INIT_INSTALL_MULTUS - value: {{ .Values.multus.multusCNI.install | quote }} - name: SPIDERPOOL_INIT_DEFAULT_CNI_NAME value: {{ .Values.multus.multusCNI.defaultCniCRName | quote }} - name: SPIDERPOOL_INIT_DEFAULT_CNI_NAMESPACE value: {{ .Release.Namespace | quote }} - - name: SPIDERPOOL_INIT_MULTUS_CONFIGMAP - value: {{ .Values.multus.multusCNI.name | trunc 63 | trimSuffix "-" | quote }} {{- if eq .Values.multus.multusCNI.defaultCniCRName "" }} - name: SPIDERPOOL_INIT_DEFAULT_CNI_DIR value: {{ .Values.global.cniConfHostPath | quote }} - - name: SPIDERPOOL_INIT_READINESS_FILE - value: "/etc/spiderpool/ready" volumeMounts: - name: cni mountPath: {{ .Values.global.cniConfHostPath }} diff --git a/charts/spiderpool/values.yaml b/charts/spiderpool/values.yaml index 51c7c502b9..f961fd97cf 100644 --- a/charts/spiderpool/values.yaml +++ b/charts/spiderpool/values.yaml @@ -227,8 +227,7 @@ multus: digest: "" ## @param multus.multusCNI.image.tag the multus-CNI image tag - tag: v3.9.3 - # tag: v4.0.2-thick + tag: v4.1.4 ## @param multus.multusCNI.image.imagePullSecrets the multus-CNI image imagePullSecrets imagePullSecrets: [] diff --git a/cmd/spiderpool-controller/cmd/crd_manager.go b/cmd/spiderpool-controller/cmd/crd_manager.go index 8ed13e8e9d..14fd8a71ca 100644 --- a/cmd/spiderpool-controller/cmd/crd_manager.go +++ b/cmd/spiderpool-controller/cmd/crd_manager.go @@ -94,7 +94,7 @@ type _webhookHealthCheck struct{} func (*_webhookHealthCheck) ServeHTTP(writer http.ResponseWriter, request *http.Request) { if request.Method == http.MethodGet { writer.WriteHeader(http.StatusOK) - logger.Info("Webhook health check successful") + logger.Debug("Webhook health check successful") } } diff --git a/cmd/spiderpool-init/cmd/config.go b/cmd/spiderpool-init/cmd/config.go index 1907b2da23..bdde2fe5f0 100644 --- a/cmd/spiderpool-init/cmd/config.go +++ b/cmd/spiderpool-init/cmd/config.go @@ -91,7 +91,6 @@ type InitDefaultConfig struct { // multuscniconfig enableMultusConfig bool - installMultusCNI bool DefaultCNIDir string DefaultCNIName string DefaultCNINamespace string @@ -281,12 +280,6 @@ func parseENVAsDefault() InitDefaultConfig { logger.Sugar().Fatalf("ENV %s: %s invalid: %v", ENVEnableMultusConfig, enableMultusConfig, err) } - installMultusCNI := strings.ReplaceAll(os.Getenv(ENVInstallMultusCNI), "\"", "") - config.installMultusCNI, err = strconv.ParseBool(installMultusCNI) - if err != nil { - logger.Sugar().Fatalf("ENV %s: %s invalid: %v", ENVInstallMultusCNI, installMultusCNI, err) - } - config.DefaultCNIDir = strings.ReplaceAll(os.Getenv(ENVDefaultCNIDir), "\"", "") if config.DefaultCNIDir != "" { _, err = os.ReadDir(config.DefaultCNIDir) diff --git a/cmd/spiderpool-init/cmd/multus.go b/cmd/spiderpool-init/cmd/multus.go index f3d996769e..ecc7664d51 100644 --- a/cmd/spiderpool-init/cmd/multus.go +++ b/cmd/spiderpool-init/cmd/multus.go @@ -4,41 +4,13 @@ package cmd import ( "context" - "encoding/json" "fmt" - "os" - "path" "github.com/spidernet-io/spiderpool/pkg/multuscniconfig" + "github.com/spidernet-io/spiderpool/pkg/utils" - v1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - apitypes "k8s.io/apimachinery/pkg/types" - controller_client "sigs.k8s.io/controller-runtime/pkg/client" ) -// MultusNetConf for cni config file written in json -// Note: please keep this fields be consistent with multus configMap -// in charts/spiderpool/templates/multus/multus-daemonset.yaml -type MultusNetConf struct { - CNIVersion string `json:"cniVersion,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - ConfDir string `json:"confDir"` - LogLevel string `json:"logLevel"` - LogFile string `json:"logFile"` - Capabilities map[string]bool `json:"capabilities,omitempty"` - // Option to isolate the usage of CR's to the namespace in which a pod resides. - NamespaceIsolation bool `json:"namespaceIsolation"` - ClusterNetwork string `json:"clusterNetwork"` - DefaultNetworks []string `json:"defaultNetworks"` - // Option to set the namespace that multus-cni uses (clusterNetwork/defaultNetworks) - MultusNamespace string `json:"multusNamespace"` - // Option to set system namespaces (to avoid to add defaultNetworks) - SystemNamespaces []string `json:"systemNamespaces"` - Kubeconfig string `json:"kubeconfig"` -} - func InitMultusDefaultCR(ctx context.Context, config *InitDefaultConfig, client *CoreClient) error { defaultCNIName, defaultCNIType, err := fetchDefaultCNIName(config.DefaultCNIName, config.DefaultCNIDir) if err != nil { @@ -49,64 +21,6 @@ func InitMultusDefaultCR(ctx context.Context, config *InitDefaultConfig, client return err } - if !config.installMultusCNI { - logger.Sugar().Infof("No install MultusCNI, Ignore update clusterNetwork for multus configMap") - return nil - } - - // get multus configMap - cm, err := getConfigMap(ctx, client, config.DefaultCNINamespace, config.MultusConfigMap) - if err != nil { - logger.Sugar().Errorf("get configMap: %v", err) - return err - } - - var multusConfig MultusNetConf - cniConfig := cm.Data["cni-conf.json"] - if err := json.Unmarshal([]byte(cniConfig), &multusConfig); err != nil { - return fmt.Errorf("failed to unmarshal multus config: %v", err) - } - - if multusConfig.ClusterNetwork == defaultCNIName { - // if clusterNetwork is expected, just return - logger.Sugar().Infof("multus clusterNetwork is %s, don't need to update multus configMap", defaultCNIName) - return nil - } - - oldConfigMap := cm.DeepCopy() - multusConfig.ClusterNetwork = defaultCNIName - configDatas, err := json.Marshal(multusConfig) - if err != nil { - return fmt.Errorf("failed to marshal multus config: %v", err) - } - cm.Data["cni-conf.json"] = string(configDatas) - - logger.Sugar().Infof("Try to patch multus configMap %s: %s", config.MultusConfigMap, configDatas) - if err = client.Patch(ctx, cm, controller_client.MergeFrom(oldConfigMap)); err != nil { - return fmt.Errorf("failed to patch multus configMap: %v", err) - } - - // we need restart spideragent-pod after we patch the configmap, make sure these changes works immediately - if err = restartSpiderAgent(ctx, client, config.AgentName, config.DefaultCNINamespace); err != nil { - return err - } - - logger.Sugar().Infof("successfully restart spiderpool-agent") - return nil -} - -func makeReadinessReady(config *InitDefaultConfig) error { - // tell readness by writing to the file that the spiderpool is ready - readinessDir := path.Dir(config.ReadinessFile) - err := os.MkdirAll(readinessDir, 0644) - if err != nil { - return err - } - - if err = os.WriteFile(config.ReadinessFile, []byte("ready"), 0777); err != nil { - return err - } - logger.Sugar().Infof("success to make spiderpool-init pod's readiness to ready") return nil } @@ -122,31 +36,3 @@ func fetchDefaultCNIName(defaultCNIName, cniDir string) (cniName, cniType string } return parseCNIFromConfig(defaultCNIConfPath) } - -func getConfigMap(ctx context.Context, client *CoreClient, namespace, name string) (*corev1.ConfigMap, error) { - var cm corev1.ConfigMap - if err := client.Get(ctx, apitypes.NamespacedName{Name: name, Namespace: namespace}, &cm); err != nil { - return nil, err - } - - return &cm, nil -} - -func restartSpiderAgent(ctx context.Context, client *CoreClient, name, ns string) error { - logger.Sugar().Infof("Try to restart spiderpoo-agent daemonSet: %s/%s", ns, name) - - var spiderAgent v1.DaemonSet - var err error - if err = client.Get(ctx, apitypes.NamespacedName{Name: name, Namespace: ns}, &spiderAgent); err != nil { - return err - } - - if err = client.DeleteAllOf(ctx, &corev1.Pod{}, controller_client.InNamespace(ns), controller_client.MatchingLabels(spiderAgent.Spec.Template.Labels)); err != nil { - return err - } - - if err = client.WaitPodListReady(ctx, ns, spiderAgent.Spec.Template.Labels); err != nil { - return err - } - return nil -} diff --git a/cmd/spiderpool-init/cmd/root.go b/cmd/spiderpool-init/cmd/root.go index 26d8478f3d..69ebd869a2 100644 --- a/cmd/spiderpool-init/cmd/root.go +++ b/cmd/spiderpool-init/cmd/root.go @@ -152,9 +152,5 @@ func Execute() { } } - if err = makeReadinessReady(&config); err != nil { - logger.Fatal(err.Error()) - } - logger.Info("Finish init") } diff --git a/test/Makefile b/test/Makefile index b2167fa3f7..a95fa8c134 100644 --- a/test/Makefile +++ b/test/Makefile @@ -419,7 +419,8 @@ helm_upgrade_spiderpool: --set spiderpoolInit.image.registry="" \ --set spiderpoolInit.image.repository=$(SPIDERPOOL_CONTROLLER_IMAGE_NAME) \ --set spiderpoolInit.image.tag=$(E2E_SPIDERPOOL_TAG) \ - --set multus.multusCNI.uninstall=false " ; \ + --set multus.multusCNI.uninstall=false \ + --set multus.multusCNI.image.tag=$(E2E_MULTUS_TAG) " ; \ if [ "$(E2E_SPIDERPOOL_ENABLE_SUBNET)" == "true" ] ; then \ HELM_OPTION+=" --set ipam.spiderSubnet.enable=true " ; \ HELM_OPTION+=" --set ipam.spiderSubnet.autoPool.enable=true " ; \ @@ -441,9 +442,9 @@ helm_upgrade_spiderpool: echo "upgrade spiderpool with image $(SPIDERPOOL_AGENT_IMAGE_NAME):$(E2E_SPIDERPOOL_TAG) and $(SPIDERPOOL_CONTROLLER_IMAGE_NAME):$(E2E_SPIDERPOOL_TAG) " ; \ set -x ; \ helm --kubeconfig $(E2E_KUBECONFIG) upgrade $(RELEASE_NAME) $(ROOT_DIR)/charts/spiderpool \ - $${HELM_OPTION} \ + $${HELM_OPTION} \ -n $(RELEASE_NAMESPACE) --debug --reuse-values ; \ - cd $(ROOT_DIR)/charts/spiderpool/crds ; \ + cd $(ROOT_DIR)/charts/spiderpool/crds ; \ ls | grep '\.yaml$$' | xargs -I {} kubectl apply -f {} --kubeconfig $(E2E_KUBECONFIG) ; \ kubectl wait --for=condition=ready -l app.kubernetes.io/instance=spiderpool --timeout=300s pod -n kube-system --kubeconfig $(E2E_KUBECONFIG) || true; \ diff --git a/test/Makefile.defs b/test/Makefile.defs index af2fc851f2..44d76636d3 100644 --- a/test/Makefile.defs +++ b/test/Makefile.defs @@ -123,6 +123,7 @@ MULTUS_DEFAULT_CNI_VLAN100 := macvlan-vlan100 MULTUS_DEFAULT_CNI_VLAN200 := macvlan-vlan200 MULTUS_OVS_CNI_VLAN30 := ovs-vlan30 MULTUS_OVS_CNI_VLAN40 := ovs-vlan40 +E2E_MULTUS_TAG ?= v4.1.4 ifeq ($(E2E_CHINA_IMAGE_REGISTRY),true) E2E_MULTUS_IMAGE_REGISTER ?= ghcr.m.daocloud.io diff --git a/test/e2e/common/constant.go b/test/e2e/common/constant.go index 5bdd5726fc..30b6505c34 100644 --- a/test/e2e/common/constant.go +++ b/test/e2e/common/constant.go @@ -57,7 +57,7 @@ var ( // multus CNI MultusDefaultNetwork = "v1.multus-cni.io/default-network" MultusNetworks = "k8s.v1.cni.cncf.io/networks" - PodMultusNetworksStatus = "k8s.v1.cni.cncf.io/networks-status" + PodMultusNetworksStatus = "k8s.v1.cni.cncf.io/network-status" CalicoCNIName string = "k8s-pod-network" CiliumCNIName string = "cilium"