diff --git a/deploy/kustomize/single-cluster-native/bases/cdn/cdn.yaml b/deploy/kustomize/single-cluster-native/bases/cdn/cdn.yaml deleted file mode 100644 index c4da86123..000000000 --- a/deploy/kustomize/single-cluster-native/bases/cdn/cdn.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# This file is the template of cdn system configuration file. -# You can configure your cdn system by change the parameter according your requirement. ---- -base: - # listenPort is the port cdn server listens on. - # default: 8003 - listenPort: 8003 - - # DownloadPort is the port for download files from cdn. - # And you should start a file server firstly which listens on the download port. - # default: 8001 - downloadPort: 8001 - - # SystemReservedBandwidth is the network bandwidth reserved for system software. - # default: 20 MB, in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will also be parsed as Byte. - systemReservedBandwidth: 20M - - # MaxBandwidth is the network bandwidth that cdn can use. - # default: 200 MB, in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will also be parsed as Byte. - maxBandwidth: 1024M - - # Whether to enable profiler - # default: false - enableProfiler: false - - # FailAccessInterval is the interval time after failed to access the URL. - # If a task failed to be downloaded from the source, it will not be retried in the time since the last failure. - # default: 3m - failAccessInterval: 3m - - # GCInitialDelay is the delay time from the start to the first GC execution. - # default: 6s - gcInitialDelay: 6s - - # GCMetaInterval is the interval time to execute GC meta. - # default: 2m0s - gcMetaInterval: 2m - - # gcStorageInterval is the interval time to execute GC storage. - # default: 15s - gcStorageInterval: 15s - - # TaskExpireTime when a task is not accessed within the taskExpireTime, - # and it will be treated to be expired. - # default: 3m0s - taskExpireTime: 3m - - # StoragePattern is the pattern of storage policy, [disk/hybrid] - storagePattern: disk - - # Console shows log on console - console: false - -plugins: - storageDriver: - - name: disk - enable: true - config: - baseDir: /tmp/cdn - storageManager: - - name: disk - enable: true - config: - gcInitialDelay: 5s - gcInterval: 15s - driverConfigs: - disk: - gcConfig: - youngGCThreshold: 100G - fullGCThreshold: 5G - cleanRatio: 1 - intervalThreshold: 2h diff --git a/deploy/kustomize/single-cluster-native/bases/cdn/nginx.conf b/deploy/kustomize/single-cluster-native/bases/cdn/nginx.conf deleted file mode 100644 index 26e672f12..000000000 --- a/deploy/kustomize/single-cluster-native/bases/cdn/nginx.conf +++ /dev/null @@ -1,51 +0,0 @@ -worker_rlimit_nofile 100000; - -events { - use epoll; - worker_connections 20480; -} - -http { - include mime.types; - default_type application/octet-stream; - root /home/admin/cai/htdocs; - sendfile on; - tcp_nopush on; - - server_tokens off; - keepalive_timeout 5; - - client_header_timeout 1m; - send_timeout 1m; - client_max_body_size 3m; - - index index.html index.htm; - access_log off; - log_not_found off; - - gzip on; - gzip_http_version 1.0; - gzip_comp_level 6; - gzip_min_length 1024; - gzip_proxied any; - gzip_vary on; - gzip_disable msie6; - gzip_buffers 96 8k; - gzip_types text/xml text/plain text/css application/javascript application/x-javascript application/rss+xml application/json; - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Web-Server-Type nginx; - proxy_set_header WL-Proxy-Client-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_redirect off; - proxy_buffers 128 8k; - proxy_intercept_errors on; - - server { - listen 8001; - location / { - root /tmp/cdn; - } - } -} diff --git a/deploy/kustomize/single-cluster-native/bases/cdn/rabc.yaml b/deploy/kustomize/single-cluster-native/bases/cdn/rabc.yaml deleted file mode 100644 index 42fff4c53..000000000 --- a/deploy/kustomize/single-cluster-native/bases/cdn/rabc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: cdn-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - update - - patch - ---- - -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: cdn-role-binding -roleRef: - kind: Role - name: cdn-role - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: cdn diff --git a/deploy/kustomize/single-cluster-native/bases/cdn/serviceaccount.yaml b/deploy/kustomize/single-cluster-native/bases/cdn/serviceaccount.yaml deleted file mode 100644 index 278d2e89e..000000000 --- a/deploy/kustomize/single-cluster-native/bases/cdn/serviceaccount.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: cdn diff --git a/deploy/kustomize/single-cluster-native/bases/cdn/statefulset.yaml b/deploy/kustomize/single-cluster-native/bases/cdn/statefulset.yaml deleted file mode 100644 index 4b46590d4..000000000 --- a/deploy/kustomize/single-cluster-native/bases/cdn/statefulset.yaml +++ /dev/null @@ -1,87 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: cdn - labels: - app: dragonfly - component: cdn -spec: - selector: - matchLabels: - app: dragonfly - component: cdn - replicas: 3 - serviceName: cdn - template: - metadata: - labels: - app: dragonfly - component: cdn - spec: - serviceAccountName: cdn - initContainers: - - name: update-configmap - image: bitnami/kubectl - command: - - /bin/bash - - -xc - - | - HOSTNAME=$(cat /etc/hostname) - cat < /tmp/patch.json - { - "data": { - "$POD_NAME.json": "{\"host_name\": \"$HOSTNAME\",\"ip\":\"$POD_IP\",\"port\": 8003,\"download_port\": 8001,\"status\": \"active\"}" - } - } - EOF - echo data to patch: - cat /tmp/patch.json - for i in `seq 1 10`; do - kubectl -n $POD_NAMESPACE \ - patch configmap scheduler-static-cdn --type=merge \ - --patch-file /tmp/patch.json - if [[ "$?" -eq 0 ]]; then - echo updated configmap: - kubectl -n $POD_NAMESPACE get configmap scheduler-static-cdn -oyaml - break - fi - done - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - imagePullPolicy: "Always" - containers: - - name: cdn - command: - - /bin/sh - - -c - - | - cp /etc/dragonfly/nginx.conf /etc/nginx/nginx.conf - nginx - exec /opt/dragonfly/bin/cdn - image: dragonflyoss/cdn - imagePullPolicy: "Always" - ports: - - containerPort: 8001 - - containerPort: 8003 - volumeMounts: - - name: config - mountPath: /etc/dragonfly - volumes: - - name: config - configMap: - name: cdn diff --git a/deploy/kustomize/single-cluster-native/bases/dfdaemon/daemonset.yaml b/deploy/kustomize/single-cluster-native/bases/dfdaemon/daemonset.yaml deleted file mode 100644 index a525447c0..000000000 --- a/deploy/kustomize/single-cluster-native/bases/dfdaemon/daemonset.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: dfdaemon - labels: - app: dragonfly - component: dfdaemon -spec: - selector: - matchLabels: - app: dragonfly - component: dfdaemon - updateStrategy: - rollingUpdate: - maxUnavailable: 10 - type: RollingUpdate - template: - metadata: - labels: - app: dragonfly - component: dfdaemon - spec: - serviceAccountName: dfdaemon - containers: - - name: dfdaemon - image: dragonflyoss/dfdaemon - imagePullPolicy: "Always" - ports: # 65001 is in host network, no need here - - containerPort: 65000 - - containerPort: 65002 - volumeMounts: - - name: config - mountPath: /etc/dragonfly - - name: netns # the mountPath is setting in proxy.tcpListen.namespace - mountPath: /host/ns - securityContext: - # FIXME dfget daemon only need /proc/1/ns/net and CAP_SYS_ADMIN - # but containerd resolves the symbolic of /proc/1/ns/net from v1.5.0 - # due to /proc/1/ns/net is not a regular symbolic link, it always failed. - # https://github.com/containerd/containerd/blob/v1.5.0/pkg/cri/opts/spec_linux.go#L171 - privileged: true - #capabilities: - # add: - # - SYS_ADMIN - volumes: - - name: config - configMap: - name: dfdaemon - - name: netns - hostPath: - path: /proc/1/ns # bind mount host net ns to pod, dfdaemon can listen 65001 in host network diff --git a/deploy/kustomize/single-cluster-native/bases/dfdaemon/dfget.yaml b/deploy/kustomize/single-cluster-native/bases/dfdaemon/dfget.yaml deleted file mode 100644 index ff9d6e8ab..000000000 --- a/deploy/kustomize/single-cluster-native/bases/dfdaemon/dfget.yaml +++ /dev/null @@ -1,146 +0,0 @@ -# daemon alive time, when sets 0s, daemon will not auto exit -aliveTime: 0s - -# daemon gc task running interval -gcInterval: 1m0s - -# when daemon exit, keep peer task data or not -# it is usefully when upgrade daemon service, all local cache will be saved -keepStorage: true - -# all addresses of all schedulers -# the schedulers of all daemons should be same in one region or zone. -# daemon will send tasks to a fixed scheduler by hashing the task url and meta data -# caution: only tcp is supported -scheduler: - # below example is a stand address - netAddrs: - - type: tcp - addr: scheduler-0.dragonfly-system.svc:8002 - - type: tcp - addr: scheduler-1.dragonfly-system.svc:8002 - - type: tcp - addr: scheduler-2.dragonfly-system.svc:8002 - # schedule timeout - scheduleTimeout: 10s - -# when enable, pprof will be enabled, -verbose: true -console: false - -# current host info used for scheduler -host: - # tcp service listen address - # port should be set by other options - listenIP: 0.0.0.0 - # access ip for other peers - # when local ip is different with access ip, advertiseIP should be set - advertiseIP: 0.0.0.0 - # geographical location and network topology - location: "" - idc: "" - securityDomain: "" - netTopology: "" - -# download service option -download: - # download limit per second - totalRateLimit: 1024Mi - perPeerRateLimit: 1024Mi - # download grpc option - downloadGRPC: - # security option - security: - insecure: true - cacert: "" - cert: "" - key: "" - tlsConfig: null - # download service listen address - # current, only support unix domain socket - unixListen: - socket: /var/run/dfdaemon.sock - # peer grpc option - # peer grpc service send pieces info to other peers - peerGRPC: - security: - insecure: true - cacert: "" - cert: "" - key: "" - tcpListen: - # listen address - listen: 0.0.0.0 - # listen port, daemon will try to listen - # when this port is not available, daemon will try next port - port: 65000 - # if want to limit upper port, please use blow format -# port: -# start: 65000 -# end: 65009 - -# proxy config file location or detail config -# proxy: "" - -# upload service option -upload: - defaultFilter: "Expires&Signature" - # upload limit per second - rateLimit: 200Mi - security: - insecure: true - cacert: "" - cert: "" - key: "" - tcpListen: - # listen address - listen: 0.0.0.0 - # listen port, daemon will try to listen - # when this port is not available, daemon will try next port - port: 65002 - # if want to limit upper port, please use blow format -# port: -# start: 65020 -# end: 65029 - -# peer task storage option -storage: - # task data expire time - # when there is no access to a task data, this task will be gc. - taskExpireTime: 3m0s - multiplex: true - -# proxy service option -proxy: - security: - insecure: true - cacert: "" - cert: "" - key: "" - tcpListen: - # Namespace stands the linux net namespace, like /proc/1/ns/net - # It's useful for running daemon in pod with ip allocated and listen in host - # Linux only - namespace: /host/ns/net - # listen address - listen: 0.0.0.0 - # listen port, daemon will try to listen - # when this port is not available, daemon will try next port - port: 65001 - # if want to limit upper port, please use blow format - # port: - # start: 65020 - # end: 65029 - registryMirror: - # url for the registry mirror - url: https://index.docker.io - # whether to ignore https certificate errors - insecure: true - # optional certificates if the remote server uses self-signed certificates - certs: [ ] - # whether to request the remote registry directly - direct: false - - proxies: - # proxy all http image layer download requests with dfget - - regx: (blobs|manifests|config)/sha256.* diff --git a/deploy/kustomize/single-cluster-native/bases/dfdaemon/seviceaccount.yaml b/deploy/kustomize/single-cluster-native/bases/dfdaemon/seviceaccount.yaml deleted file mode 100644 index c0aaed289..000000000 --- a/deploy/kustomize/single-cluster-native/bases/dfdaemon/seviceaccount.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: dfdaemon diff --git a/deploy/kustomize/single-cluster-native/bases/kustomization.yaml b/deploy/kustomize/single-cluster-native/bases/kustomization.yaml deleted file mode 100644 index 32474839b..000000000 --- a/deploy/kustomize/single-cluster-native/bases/kustomization.yaml +++ /dev/null @@ -1,35 +0,0 @@ -namespace: dragonfly-system -resources: -- namespace.yaml -- cdn/rabc.yaml -- cdn/serviceaccount.yaml -- cdn/statefulset.yaml -- dfdaemon/seviceaccount.yaml -- dfdaemon/daemonset.yaml -- scheduler/configmap.yaml -- scheduler/service.yaml -- scheduler/statefulset.yaml -generatorOptions: - disableNameSuffixHash: true - labels: - kustomize.resource.generated.by: dragonfly -configMapGenerator: -- name: dfdaemon - files: - - dfdaemon/dfget.yaml -- name: scheduler - files: - - scheduler/scheduler.yaml -- name: cdn - files: - - cdn/nginx.conf - - cdn/cdn.yaml -images: -- name: dragonflyoss/cdn - newTag: v0.1.0-beta -- name: dragonflyoss/dfdaemon - newTag: v0.1.0-beta -- name: dragonflyoss/scheduler - newTag: v0.1.0-beta -- name: bitnami/kubectl - newTag: "1.20" diff --git a/deploy/kustomize/single-cluster-native/bases/namespace.yaml b/deploy/kustomize/single-cluster-native/bases/namespace.yaml deleted file mode 100644 index 3023653fa..000000000 --- a/deploy/kustomize/single-cluster-native/bases/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: dragonfly-system \ No newline at end of file diff --git a/deploy/kustomize/single-cluster-native/bases/scheduler/configmap.yaml b/deploy/kustomize/single-cluster-native/bases/scheduler/configmap.yaml deleted file mode 100644 index 060f6d016..000000000 --- a/deploy/kustomize/single-cluster-native/bases/scheduler/configmap.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: scheduler-static-cdn \ No newline at end of file diff --git a/deploy/kustomize/single-cluster-native/bases/scheduler/scheduler.yaml b/deploy/kustomize/single-cluster-native/bases/scheduler/scheduler.yaml deleted file mode 100644 index 08bc1a299..000000000 --- a/deploy/kustomize/single-cluster-native/bases/scheduler/scheduler.yaml +++ /dev/null @@ -1,13 +0,0 @@ -verbose: true - -server: - port: 8002 - -worker: - workerNum: 4 - workerJobPoolSize: 10000 - senderNum: 10 - senderJobPoolSize: 10000 - -dynconfig: - cdnDirPath: /opt/dragonfly/scheduler-cdn diff --git a/deploy/kustomize/single-cluster-native/bases/scheduler/service.yaml b/deploy/kustomize/single-cluster-native/bases/scheduler/service.yaml deleted file mode 100644 index 22d59cc6d..000000000 --- a/deploy/kustomize/single-cluster-native/bases/scheduler/service.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: scheduler-0 -spec: - selector: - app: dragonfly - component: scheduler - statefulset.kubernetes.io/pod-name: scheduler-0 - type: ClusterIP - clusterIP: None - ports: - - name: grpc - port: 8002 - protocol: TCP - targetPort: 8002 - ---- - -apiVersion: v1 -kind: Service -metadata: - name: scheduler-1 -spec: - selector: - app: dragonfly - component: scheduler - statefulset.kubernetes.io/pod-name: scheduler-1 - type: ClusterIP - clusterIP: None - ports: - - name: grpc - port: 8002 - protocol: TCP - targetPort: 8002 - ---- - -apiVersion: v1 -kind: Service -metadata: - name: scheduler-2 -spec: - selector: - app: dragonfly - component: scheduler - statefulset.kubernetes.io/pod-name: scheduler-2 - type: ClusterIP - clusterIP: None - ports: - - name: grpc - port: 8002 - protocol: TCP - targetPort: 8002 diff --git a/deploy/kustomize/single-cluster-native/bases/scheduler/statefulset.yaml b/deploy/kustomize/single-cluster-native/bases/scheduler/statefulset.yaml deleted file mode 100644 index 4236063e3..000000000 --- a/deploy/kustomize/single-cluster-native/bases/scheduler/statefulset.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: scheduler - labels: - app: dragonfly - component: scheduler -spec: - serviceName: scheduler - selector: - matchLabels: - app: dragonfly - component: scheduler - replicas: 3 - template: - metadata: - labels: - app: dragonfly - component: scheduler - spec: - containers: - - name: scheduler - image: dragonflyoss/scheduler - imagePullPolicy: "Always" - ports: - - containerPort: 8002 - volumeMounts: - - name: config - mountPath: /etc/dragonfly - - name: cdn-config - mountPath: /opt/dragonfly/scheduler-cdn - volumes: - - name: config - configMap: - name: scheduler - - name: cdn-config - configMap: - name: scheduler-static-cdn \ No newline at end of file diff --git a/deploy/kustomize/single-cluster-native/overlays/sample/kustomization.yaml b/deploy/kustomize/single-cluster-native/overlays/sample/kustomization.yaml deleted file mode 100644 index 0651d8d16..000000000 --- a/deploy/kustomize/single-cluster-native/overlays/sample/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ -namespace: dragonfly-system -resources: -- ../../bases -images: -- name: dragonflyoss/cdn - newTag: v0.1.0-beta -- name: dragonflyoss/dfdaemon - newTag: v0.1.0-beta -- name: dragonflyoss/scheduler - newTag: v0.1.0-beta diff --git a/deploy/kustomize/single-cluster-openkruise/bases/cdn/cdn.yaml b/deploy/kustomize/single-cluster-openkruise/bases/cdn/cdn.yaml deleted file mode 100644 index c4da86123..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/cdn/cdn.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# This file is the template of cdn system configuration file. -# You can configure your cdn system by change the parameter according your requirement. ---- -base: - # listenPort is the port cdn server listens on. - # default: 8003 - listenPort: 8003 - - # DownloadPort is the port for download files from cdn. - # And you should start a file server firstly which listens on the download port. - # default: 8001 - downloadPort: 8001 - - # SystemReservedBandwidth is the network bandwidth reserved for system software. - # default: 20 MB, in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will also be parsed as Byte. - systemReservedBandwidth: 20M - - # MaxBandwidth is the network bandwidth that cdn can use. - # default: 200 MB, in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will also be parsed as Byte. - maxBandwidth: 1024M - - # Whether to enable profiler - # default: false - enableProfiler: false - - # FailAccessInterval is the interval time after failed to access the URL. - # If a task failed to be downloaded from the source, it will not be retried in the time since the last failure. - # default: 3m - failAccessInterval: 3m - - # GCInitialDelay is the delay time from the start to the first GC execution. - # default: 6s - gcInitialDelay: 6s - - # GCMetaInterval is the interval time to execute GC meta. - # default: 2m0s - gcMetaInterval: 2m - - # gcStorageInterval is the interval time to execute GC storage. - # default: 15s - gcStorageInterval: 15s - - # TaskExpireTime when a task is not accessed within the taskExpireTime, - # and it will be treated to be expired. - # default: 3m0s - taskExpireTime: 3m - - # StoragePattern is the pattern of storage policy, [disk/hybrid] - storagePattern: disk - - # Console shows log on console - console: false - -plugins: - storageDriver: - - name: disk - enable: true - config: - baseDir: /tmp/cdn - storageManager: - - name: disk - enable: true - config: - gcInitialDelay: 5s - gcInterval: 15s - driverConfigs: - disk: - gcConfig: - youngGCThreshold: 100G - fullGCThreshold: 5G - cleanRatio: 1 - intervalThreshold: 2h diff --git a/deploy/kustomize/single-cluster-openkruise/bases/cdn/nginx.conf b/deploy/kustomize/single-cluster-openkruise/bases/cdn/nginx.conf deleted file mode 100644 index 26e672f12..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/cdn/nginx.conf +++ /dev/null @@ -1,51 +0,0 @@ -worker_rlimit_nofile 100000; - -events { - use epoll; - worker_connections 20480; -} - -http { - include mime.types; - default_type application/octet-stream; - root /home/admin/cai/htdocs; - sendfile on; - tcp_nopush on; - - server_tokens off; - keepalive_timeout 5; - - client_header_timeout 1m; - send_timeout 1m; - client_max_body_size 3m; - - index index.html index.htm; - access_log off; - log_not_found off; - - gzip on; - gzip_http_version 1.0; - gzip_comp_level 6; - gzip_min_length 1024; - gzip_proxied any; - gzip_vary on; - gzip_disable msie6; - gzip_buffers 96 8k; - gzip_types text/xml text/plain text/css application/javascript application/x-javascript application/rss+xml application/json; - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Web-Server-Type nginx; - proxy_set_header WL-Proxy-Client-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_redirect off; - proxy_buffers 128 8k; - proxy_intercept_errors on; - - server { - listen 8001; - location / { - root /tmp/cdn; - } - } -} diff --git a/deploy/kustomize/single-cluster-openkruise/bases/cdn/rabc.yaml b/deploy/kustomize/single-cluster-openkruise/bases/cdn/rabc.yaml deleted file mode 100644 index 42fff4c53..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/cdn/rabc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: cdn-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - update - - patch - ---- - -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: cdn-role-binding -roleRef: - kind: Role - name: cdn-role - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: cdn diff --git a/deploy/kustomize/single-cluster-openkruise/bases/cdn/serviceaccount.yaml b/deploy/kustomize/single-cluster-openkruise/bases/cdn/serviceaccount.yaml deleted file mode 100644 index 278d2e89e..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/cdn/serviceaccount.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: cdn diff --git a/deploy/kustomize/single-cluster-openkruise/bases/cdn/statefulset.yaml b/deploy/kustomize/single-cluster-openkruise/bases/cdn/statefulset.yaml deleted file mode 100644 index 4f43cdf88..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/cdn/statefulset.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# uncomment the follow line, if your k8s is not with openkruise -#apiVersion: apps/v1 -apiVersion: apps.kruise.io/v1alpha1 -kind: StatefulSet -metadata: - name: cdn - labels: - app: dragonfly - component: cdn -spec: - selector: - matchLabels: - app: dragonfly - component: cdn - replicas: 3 - serviceName: cdn - template: - metadata: - labels: - app: dragonfly - component: cdn - spec: - serviceAccountName: cdn - initContainers: - - name: update-configmap - image: bitnami/kubectl - command: - - /bin/bash - - -xc - - | - HOSTNAME=$(cat /etc/hostname) - cat < /tmp/patch.json - { - "data": { - "$POD_NAME.json": "{\"host_name\": \"$HOSTNAME\",\"ip\":\"$POD_IP\",\"port\": 8003,\"download_port\": 8001,\"status\": \"active\"}" - } - } - EOF - echo data to patch: - cat /tmp/patch.json - for i in `seq 1 10`; do - kubectl -n $POD_NAMESPACE \ - patch configmap scheduler-static-cdn --type=merge \ - --patch-file /tmp/patch.json - if [[ "$?" -eq 0 ]]; then - echo updated configmap: - kubectl -n $POD_NAMESPACE get configmap scheduler-static-cdn -oyaml - break - fi - done - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - imagePullPolicy: "Always" - containers: - - name: cdn - command: - - /bin/sh - - -c - - | - cp /etc/dragonfly/nginx.conf /etc/nginx/nginx.conf - nginx - exec /opt/dragonfly/bin/cdn - image: dragonflyoss/cdn - imagePullPolicy: "Always" - ports: - - containerPort: 8001 - - containerPort: 8003 - volumeMounts: - - name: config - mountPath: /etc/dragonfly - volumes: - - name: config - configMap: - name: cdn diff --git a/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/daemonset.yaml b/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/daemonset.yaml deleted file mode 100644 index c6ab87cb1..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/daemonset.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# uncomment the follow line, if your k8s is not with openkruise -#apiVersion: apps/v1 -apiVersion: apps.kruise.io/v1alpha1 -kind: DaemonSet -metadata: - name: dfdaemon - labels: - app: dragonfly - component: dfdaemon -spec: - selector: - matchLabels: - app: dragonfly - component: dfdaemon - updateStrategy: - rollingUpdate: - maxUnavailable: 10 - type: RollingUpdate - template: - metadata: - labels: - app: dragonfly - component: dfdaemon - spec: - serviceAccountName: dfdaemon - containers: - - name: dfdaemon - image: dragonflyoss/dfdaemon - imagePullPolicy: "Always" - ports: # 65001 is in host network, no need here - - containerPort: 65000 - - containerPort: 65002 - volumeMounts: - - name: config - mountPath: /etc/dragonfly - - name: netns # the mountPath is setting in proxy.tcpListen.namespace - mountPath: /host/ns - securityContext: - # FIXME dfget daemon only need /proc/1/ns/net and CAP_SYS_ADMIN - # but containerd resolves the symbolic of /proc/1/ns/net from v1.5.0 - # due to /proc/1/ns/net is not a regular symbolic link, it always failed. - # https://github.com/containerd/containerd/blob/v1.5.0/pkg/cri/opts/spec_linux.go#L171 - privileged: true - #capabilities: - # add: - # - SYS_ADMIN - volumes: - - name: config - configMap: - name: dfdaemon - - name: netns - hostPath: - path: /proc/1/ns # bind mount host net ns to pod, dfdaemon can listen 65001 in host network diff --git a/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/dfget.yaml b/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/dfget.yaml deleted file mode 100644 index ff9d6e8ab..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/dfget.yaml +++ /dev/null @@ -1,146 +0,0 @@ -# daemon alive time, when sets 0s, daemon will not auto exit -aliveTime: 0s - -# daemon gc task running interval -gcInterval: 1m0s - -# when daemon exit, keep peer task data or not -# it is usefully when upgrade daemon service, all local cache will be saved -keepStorage: true - -# all addresses of all schedulers -# the schedulers of all daemons should be same in one region or zone. -# daemon will send tasks to a fixed scheduler by hashing the task url and meta data -# caution: only tcp is supported -scheduler: - # below example is a stand address - netAddrs: - - type: tcp - addr: scheduler-0.dragonfly-system.svc:8002 - - type: tcp - addr: scheduler-1.dragonfly-system.svc:8002 - - type: tcp - addr: scheduler-2.dragonfly-system.svc:8002 - # schedule timeout - scheduleTimeout: 10s - -# when enable, pprof will be enabled, -verbose: true -console: false - -# current host info used for scheduler -host: - # tcp service listen address - # port should be set by other options - listenIP: 0.0.0.0 - # access ip for other peers - # when local ip is different with access ip, advertiseIP should be set - advertiseIP: 0.0.0.0 - # geographical location and network topology - location: "" - idc: "" - securityDomain: "" - netTopology: "" - -# download service option -download: - # download limit per second - totalRateLimit: 1024Mi - perPeerRateLimit: 1024Mi - # download grpc option - downloadGRPC: - # security option - security: - insecure: true - cacert: "" - cert: "" - key: "" - tlsConfig: null - # download service listen address - # current, only support unix domain socket - unixListen: - socket: /var/run/dfdaemon.sock - # peer grpc option - # peer grpc service send pieces info to other peers - peerGRPC: - security: - insecure: true - cacert: "" - cert: "" - key: "" - tcpListen: - # listen address - listen: 0.0.0.0 - # listen port, daemon will try to listen - # when this port is not available, daemon will try next port - port: 65000 - # if want to limit upper port, please use blow format -# port: -# start: 65000 -# end: 65009 - -# proxy config file location or detail config -# proxy: "" - -# upload service option -upload: - defaultFilter: "Expires&Signature" - # upload limit per second - rateLimit: 200Mi - security: - insecure: true - cacert: "" - cert: "" - key: "" - tcpListen: - # listen address - listen: 0.0.0.0 - # listen port, daemon will try to listen - # when this port is not available, daemon will try next port - port: 65002 - # if want to limit upper port, please use blow format -# port: -# start: 65020 -# end: 65029 - -# peer task storage option -storage: - # task data expire time - # when there is no access to a task data, this task will be gc. - taskExpireTime: 3m0s - multiplex: true - -# proxy service option -proxy: - security: - insecure: true - cacert: "" - cert: "" - key: "" - tcpListen: - # Namespace stands the linux net namespace, like /proc/1/ns/net - # It's useful for running daemon in pod with ip allocated and listen in host - # Linux only - namespace: /host/ns/net - # listen address - listen: 0.0.0.0 - # listen port, daemon will try to listen - # when this port is not available, daemon will try next port - port: 65001 - # if want to limit upper port, please use blow format - # port: - # start: 65020 - # end: 65029 - registryMirror: - # url for the registry mirror - url: https://index.docker.io - # whether to ignore https certificate errors - insecure: true - # optional certificates if the remote server uses self-signed certificates - certs: [ ] - # whether to request the remote registry directly - direct: false - - proxies: - # proxy all http image layer download requests with dfget - - regx: (blobs|manifests|config)/sha256.* diff --git a/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/seviceaccount.yaml b/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/seviceaccount.yaml deleted file mode 100644 index c0aaed289..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/dfdaemon/seviceaccount.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: dfdaemon diff --git a/deploy/kustomize/single-cluster-openkruise/bases/kustomization.yaml b/deploy/kustomize/single-cluster-openkruise/bases/kustomization.yaml deleted file mode 100644 index 32474839b..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/kustomization.yaml +++ /dev/null @@ -1,35 +0,0 @@ -namespace: dragonfly-system -resources: -- namespace.yaml -- cdn/rabc.yaml -- cdn/serviceaccount.yaml -- cdn/statefulset.yaml -- dfdaemon/seviceaccount.yaml -- dfdaemon/daemonset.yaml -- scheduler/configmap.yaml -- scheduler/service.yaml -- scheduler/statefulset.yaml -generatorOptions: - disableNameSuffixHash: true - labels: - kustomize.resource.generated.by: dragonfly -configMapGenerator: -- name: dfdaemon - files: - - dfdaemon/dfget.yaml -- name: scheduler - files: - - scheduler/scheduler.yaml -- name: cdn - files: - - cdn/nginx.conf - - cdn/cdn.yaml -images: -- name: dragonflyoss/cdn - newTag: v0.1.0-beta -- name: dragonflyoss/dfdaemon - newTag: v0.1.0-beta -- name: dragonflyoss/scheduler - newTag: v0.1.0-beta -- name: bitnami/kubectl - newTag: "1.20" diff --git a/deploy/kustomize/single-cluster-openkruise/bases/namespace.yaml b/deploy/kustomize/single-cluster-openkruise/bases/namespace.yaml deleted file mode 100644 index 3023653fa..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: dragonfly-system \ No newline at end of file diff --git a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/configmap.yaml b/deploy/kustomize/single-cluster-openkruise/bases/scheduler/configmap.yaml deleted file mode 100644 index 060f6d016..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/configmap.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: scheduler-static-cdn \ No newline at end of file diff --git a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/scheduler.yaml b/deploy/kustomize/single-cluster-openkruise/bases/scheduler/scheduler.yaml deleted file mode 100644 index 08bc1a299..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/scheduler.yaml +++ /dev/null @@ -1,13 +0,0 @@ -verbose: true - -server: - port: 8002 - -worker: - workerNum: 4 - workerJobPoolSize: 10000 - senderNum: 10 - senderJobPoolSize: 10000 - -dynconfig: - cdnDirPath: /opt/dragonfly/scheduler-cdn diff --git a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/service.yaml b/deploy/kustomize/single-cluster-openkruise/bases/scheduler/service.yaml deleted file mode 100644 index 22d59cc6d..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/service.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: scheduler-0 -spec: - selector: - app: dragonfly - component: scheduler - statefulset.kubernetes.io/pod-name: scheduler-0 - type: ClusterIP - clusterIP: None - ports: - - name: grpc - port: 8002 - protocol: TCP - targetPort: 8002 - ---- - -apiVersion: v1 -kind: Service -metadata: - name: scheduler-1 -spec: - selector: - app: dragonfly - component: scheduler - statefulset.kubernetes.io/pod-name: scheduler-1 - type: ClusterIP - clusterIP: None - ports: - - name: grpc - port: 8002 - protocol: TCP - targetPort: 8002 - ---- - -apiVersion: v1 -kind: Service -metadata: - name: scheduler-2 -spec: - selector: - app: dragonfly - component: scheduler - statefulset.kubernetes.io/pod-name: scheduler-2 - type: ClusterIP - clusterIP: None - ports: - - name: grpc - port: 8002 - protocol: TCP - targetPort: 8002 diff --git a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/statefulset.yaml b/deploy/kustomize/single-cluster-openkruise/bases/scheduler/statefulset.yaml deleted file mode 100644 index 715fe41ee..000000000 --- a/deploy/kustomize/single-cluster-openkruise/bases/scheduler/statefulset.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# uncomment the follow line, if your k8s is not with openkruise -#apiVersion: apps/v1 -apiVersion: apps.kruise.io/v1alpha1 -kind: StatefulSet -metadata: - name: scheduler - labels: - app: dragonfly - component: scheduler -spec: - serviceName: scheduler - selector: - matchLabels: - app: dragonfly - component: scheduler - replicas: 3 - template: - metadata: - labels: - app: dragonfly - component: scheduler - spec: - containers: - - name: scheduler - image: dragonflyoss/scheduler - imagePullPolicy: "Always" - ports: - - containerPort: 8002 - volumeMounts: - - name: config - mountPath: /etc/dragonfly - - name: cdn-config - mountPath: /opt/dragonfly/scheduler-cdn - volumes: - - name: config - configMap: - name: scheduler - - name: cdn-config - configMap: - name: scheduler-static-cdn \ No newline at end of file diff --git a/deploy/kustomize/single-cluster-openkruise/overlays/sample/kustomization.yaml b/deploy/kustomize/single-cluster-openkruise/overlays/sample/kustomization.yaml deleted file mode 100644 index 0651d8d16..000000000 --- a/deploy/kustomize/single-cluster-openkruise/overlays/sample/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ -namespace: dragonfly-system -resources: -- ../../bases -images: -- name: dragonflyoss/cdn - newTag: v0.1.0-beta -- name: dragonflyoss/dfdaemon - newTag: v0.1.0-beta -- name: dragonflyoss/scheduler - newTag: v0.1.0-beta diff --git a/scheduler/scheduler/evaluator/evaluator_base.go b/scheduler/scheduler/evaluator/evaluator_base.go index 4909b22a8..d771bdcdb 100644 --- a/scheduler/scheduler/evaluator/evaluator_base.go +++ b/scheduler/scheduler/evaluator/evaluator_base.go @@ -34,7 +34,7 @@ const ( // Free load weight freeLoadWeight = 0.2 - // host type affinity weight + // Host type affinity weight hostTypeAffinityWeight = 0.2 // IDC affinity weight