feat: remove kustomize template (#1216)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
76eff082cb
commit
6744624e70
|
|
@ -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
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: cdn
|
|
||||||
|
|
@ -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 <<EOF > /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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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.*
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: dfdaemon
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: dragonfly-system
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: scheduler-static-cdn
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
verbose: true
|
|
||||||
|
|
||||||
server:
|
|
||||||
port: 8002
|
|
||||||
|
|
||||||
worker:
|
|
||||||
workerNum: 4
|
|
||||||
workerJobPoolSize: 10000
|
|
||||||
senderNum: 10
|
|
||||||
senderJobPoolSize: 10000
|
|
||||||
|
|
||||||
dynconfig:
|
|
||||||
cdnDirPath: /opt/dragonfly/scheduler-cdn
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: cdn
|
|
||||||
|
|
@ -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 <<EOF > /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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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.*
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: dfdaemon
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: dragonfly-system
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: scheduler-static-cdn
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
verbose: true
|
|
||||||
|
|
||||||
server:
|
|
||||||
port: 8002
|
|
||||||
|
|
||||||
worker:
|
|
||||||
workerNum: 4
|
|
||||||
workerJobPoolSize: 10000
|
|
||||||
senderNum: 10
|
|
||||||
senderJobPoolSize: 10000
|
|
||||||
|
|
||||||
dynconfig:
|
|
||||||
cdnDirPath: /opt/dragonfly/scheduler-cdn
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -34,7 +34,7 @@ const (
|
||||||
// Free load weight
|
// Free load weight
|
||||||
freeLoadWeight = 0.2
|
freeLoadWeight = 0.2
|
||||||
|
|
||||||
// host type affinity weight
|
// Host type affinity weight
|
||||||
hostTypeAffinityWeight = 0.2
|
hostTypeAffinityWeight = 0.2
|
||||||
|
|
||||||
// IDC affinity weight
|
// IDC affinity weight
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue