Skip to content

Commit

Permalink
Remove classic-dra
Browse files Browse the repository at this point in the history
Signed-off-by: cyclinder <qifeng.guo@daocloud.io>
  • Loading branch information
cyclinder committed Oct 28, 2024
1 parent a810abd commit ed991b4
Show file tree
Hide file tree
Showing 239 changed files with 73 additions and 51,900 deletions.
8 changes: 0 additions & 8 deletions charts/spiderpool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,6 @@ helm install spiderpool spiderpool/spiderpool --wait --namespace kube-system \
| `multus.multusCNI.log.logLevel` | the multus-CNI daemonset pod log level | `debug` |
| `multus.multusCNI.log.logFile` | the multus-CNI daemonset pod log file | `/var/log/multus.log` |

### dra parameters

| Name | Description | Value |
| -------------------- | -------------------------- | -------------- |
| `dra.enabled` | to enable dra feature | `false` |
| `dra.cdiRootPath` | the dir of cdi root | `/var/run/cdi` |
| `dra.hostDevicePath` | the dir path of the device | `""` |

### plugins parameters

| Name | Description | Value |
Expand Down
4 changes: 0 additions & 4 deletions charts/spiderpool/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ data:
{{- else}}
clusterSubnetDefaultFlexibleIPNumber: 0
{{- end }}
dra:
enabled: {{ .Values.dra.enabled }}
cdiRootPath: {{ .Values.dra.cdiRootPath }}
hostDevicePath: {{ .Values.dra.hostDevicePath }}
tuneSysctlConfig: {{ .Values.spiderpoolAgent.tuneSysctlConfig }}
{{- if .Values.multus.multusCNI.install }}
---
Expand Down
31 changes: 1 addition & 30 deletions charts/spiderpool/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ spec:
{{- with .Values.spiderpoolAgent.extraEnv }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.dra.enabled .Values.spiderpoolAgent.tuneSysctlConfig .Values.spiderpoolAgent.securityContext }}
{{- if or .Values.spiderpoolAgent.tuneSysctlConfig .Values.spiderpoolAgent.securityContext }}
securityContext:
privileged: true
{{- with .Values.spiderpoolAgent.securityContext }}
Expand All @@ -222,19 +222,6 @@ spec:
- name: cni
mountPath: /host/etc/cni/net.d
{{- end }}
{{- if .Values.dra.enabled }}
- name: plugins-registry
mountPath: /var/lib/kubelet/plugins_registry
- name: plugins
mountPath: /var/lib/kubelet/plugins
mountPropagation: Bidirectional
- name: cdi
mountPath: /var/run/cdi
{{- if .Values.dra.hostDevicePath }}
- name: library
mountPath: {{ .Values.dra.hostDevicePath }}
{{- end }}
{{- end }}
{{- if .Values.spiderpoolAgent.extraVolumes }}
{{- include "tplvalues.render" ( dict "value" .Values.spiderpoolAgent.extraVolumeMounts "context" $ ) | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -306,22 +293,6 @@ spec:
- key: cni-conf.json
path: 00-multus.conf
{{- end }}
{{- if .Values.dra.enabled }}
- name: plugins-registry
hostPath:
path: /var/lib/kubelet/plugins_registry
- name: plugins
hostPath:
path: /var/lib/kubelet/plugins
- name: cdi
hostPath:
path: /var/run/cdi
{{- if .Values.dra.hostDevicePath }}
- name: library
hostPath:
path: {{ .Values.dra.hostDevicePath }}
{{- end }}
{{- end }}
{{- if .Values.spiderpoolAgent.extraVolumeMounts }}
{{- include "tplvalues.render" ( dict "value" .Values.spiderpoolAgent.extraVolumeMounts "context" $ ) | nindent 6 }}
{{- end }}
Expand Down
7 changes: 0 additions & 7 deletions charts/spiderpool/templates/resourceclass.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions charts/spiderpool/templates/tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,35 +289,6 @@ webhooks:
- spidermultusconfigs
sideEffects: None
{{- end }}
{{- if .Values.dra.enabled }}
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ .Values.spiderpoolController.name | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace }}
path: /validate-spiderpool-spidernet-io-v2beta1-spiderclaimparameter
port: {{ .Values.spiderpoolController.webhookPort }}
{{- if (eq .Values.spiderpoolController.tls.method "provided") }}
caBundle: {{ .Values.spiderpoolController.tls.provided.tlsCa | required "missing spiderpoolController.tls.provided.tlsCa" }}
{{- else if (eq .Values.spiderpoolController.tls.method "auto") }}
caBundle: {{ .ca.Cert | b64enc }}
{{- end }}
failurePolicy: Fail
name: spiderclaimparameter.spiderpool.spidernet.io
rules:
- apiGroups:
- spiderpool.spidernet.io
apiVersions:
- v2beta1
operations:
- CREATE
- UPDATE
resources:
- spiderclaimparameters
sideEffects: None
{{- end }}

{{- if eq .Values.spiderpoolController.tls.method "certmanager" -}}
---
apiVersion: cert-manager.io/v1
Expand Down
10 changes: 0 additions & 10 deletions charts/spiderpool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,6 @@ multus:
## @param multus.multusCNI.log.logFile the multus-CNI daemonset pod log file
logFile: "/var/log/multus.log"

## @section dra parameters
##
dra:
## @param dra.enabled to enable dra feature
enabled: false
## @param dra.cdiRootPath the dir of cdi root
cdiRootPath: "/var/run/cdi"
## @param dra.hostDevicePath the dir path of the device
hostDevicePath: ""

## @section plugins parameters
##
plugins:
Expand Down
4 changes: 0 additions & 4 deletions cmd/spiderpool-agent/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/spidernet-io/spiderpool/pkg/subnetmanager"
spiderpooltypes "github.com/spidernet-io/spiderpool/pkg/types"
"github.com/spidernet-io/spiderpool/pkg/workloadendpointmanager"
"k8s.io/dynamic-resource-allocation/kubeletplugin"
)

var agentContext = new(AgentContext)
Expand Down Expand Up @@ -125,9 +124,6 @@ type AgentContext struct {
UnixServer *server.Server
MetricsHttpServer *http.Server

// dra
DraPlugin kubeletplugin.DRAPlugin

// client
unixClient *client.SpiderpoolAgentAPI

Expand Down
17 changes: 0 additions & 17 deletions cmd/spiderpool-agent/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"

draplugin "github.com/spidernet-io/spiderpool/pkg/dra/dra-plugin"
"github.com/spidernet-io/spiderpool/pkg/ipam"
"github.com/spidernet-io/spiderpool/pkg/ippoolmanager"
"github.com/spidernet-io/spiderpool/pkg/kubevirtmanager"
Expand Down Expand Up @@ -248,16 +247,6 @@ func DaemonMain() {
}
agentContext.unixClient = spiderpoolAgentAPI

if agentContext.Cfg.DraEnabled {
logger.Info("Begin to start dra-plugin Server")
agentContext.DraPlugin, err = draplugin.StartDRAPlugin(logger, agentContext.Cfg.DraCdiRootPath, agentContext.Cfg.DraHostDevicePath)
if err != nil {
logger.Fatal("failed to start dra-plugin server", zap.Error(err))
}
} else {
logger.Info("Dra feature is disable.")
}

logger.Info("Set spiderpool-agent startup probe ready")
agentContext.IsStartupProbe.Store(true)

Expand Down Expand Up @@ -290,12 +279,6 @@ func WatchSignal(sigCh chan os.Signal) {
logger.Sugar().Errorf("Failed to shut down spiderpool-agent UNIX server: %v", err)
}
}

if agentContext.DraPlugin != nil {
logger.Debug("Stopping the dra-plugin server")
agentContext.DraPlugin.Stop()
}

// others...

}
Expand Down
24 changes: 0 additions & 24 deletions cmd/spiderpool-controller/cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@ import (
"github.com/grafana/pyroscope-go"
"go.uber.org/automaxprocs/maxprocs"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/spidernet-io/spiderpool/pkg/applicationcontroller"
"github.com/spidernet-io/spiderpool/pkg/applicationcontroller/applicationinformers"
"github.com/spidernet-io/spiderpool/pkg/constant"
"github.com/spidernet-io/spiderpool/pkg/coordinatormanager"
dracontroller "github.com/spidernet-io/spiderpool/pkg/dra/dra-controller"
"github.com/spidernet-io/spiderpool/pkg/election"
"github.com/spidernet-io/spiderpool/pkg/event"
"github.com/spidernet-io/spiderpool/pkg/gcmanager"
"github.com/spidernet-io/spiderpool/pkg/ippoolmanager"
crdclientset "github.com/spidernet-io/spiderpool/pkg/k8s/client/clientset/versioned"
"github.com/spidernet-io/spiderpool/pkg/kubevirtmanager"
"github.com/spidernet-io/spiderpool/pkg/logutils"
"github.com/spidernet-io/spiderpool/pkg/manager/spidercliamparameter"
"github.com/spidernet-io/spiderpool/pkg/multuscniconfig"
"github.com/spidernet-io/spiderpool/pkg/namespacemanager"
"github.com/spidernet-io/spiderpool/pkg/nodemanager"
Expand Down Expand Up @@ -348,14 +345,6 @@ func initControllerServiceManagers(ctx context.Context) {
}
}

if controllerContext.Cfg.DraEnabled {
logger.Debug("Begin to setup SpiderClaimParameter webhook")
if err = spidercliamparameter.New(controllerContext.CRDManager.GetClient(),
controllerContext.CRDManager.GetAPIReader(), controllerContext.CRDManager); err != nil {
logger.Fatal(err.Error())
}
}

if controllerContext.Cfg.EnableSpiderSubnet {
logger.Debug("Begin to initialize Subnet manager")
subnetManager, err := subnetmanager.NewSubnetManager(
Expand Down Expand Up @@ -577,19 +566,6 @@ func setupInformers(k8sClient *kubernetes.Clientset) {
logger.Fatal(err.Error())
}
}

if controllerContext.Cfg.DraEnabled {
logger.Info("Begin to start DRA-Controller")
informerFactory := informers.NewSharedInformerFactory(k8sClient, 0 /* resync period */)
if err = dracontroller.StartController(controllerContext.InnerCtx,
time.Duration(controllerContext.Cfg.LeaseRetryGap)*time.Second,
crdClient, k8sClient, informerFactory,
controllerContext.Leader); err != nil {
logger.Fatal(err.Error())
}
} else {
logger.Info("the dra feature is disabled.")
}
}

func checkWebhookReady() {
Expand Down
1 change: 0 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ nav:
- Route Support: usage/route.md
- Node-based Topology: usage/network-topology.md
- IPoIB For Infiniband: usage/ipoib.md
- Dynamic-Resource-Allocation: usage/dra.md
- Multi-Cluster Networking: usage/submariner.md
- Access Service for Underlay CNI: usage/underlay_cni_service.md
- Bandwidth Manage for IPVlan CNI: usage/ipvlan_bandwidth.md
Expand Down
Loading

0 comments on commit ed991b4

Please sign in to comment.