dashboard/deployment/volcano-dashboard.yaml

151 lines
3.1 KiB
YAML

# volcano dashboard deployment
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: volcano-dashboard
name: volcano-dashboard
namespace: volcano-system
spec:
replicas: 1
selector:
matchLabels:
app: volcano-dashboard
template:
metadata:
labels:
app: volcano-dashboard
spec:
securityContext:
seLinuxOptions:
level: s0:c123,c456
seccompProfile:
type: RuntimeDefault
serviceAccountName: volcano-dashboard
containers:
- image: volcanosh/vc-dashboard-frontend:latest
imagePullPolicy: Always
name: frontend
ports:
- containerPort: 8080
name: frontend
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
runAsUser: 1000
volumeMounts:
- mountPath: /var/cache/nginx
name: nginx-cache
- mountPath: /run
name: nginx-run
- image: volcanosh/vc-dashboard-backend:latest
imagePullPolicy: Always
name: backend
ports:
- containerPort: 3001
name: backend
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
runAsUser: 1000
volumes:
- name: nginx-cache
emptyDir: {}
- name: nginx-run
emptyDir: {}
---
# volcano dashboard serviceAccount
apiVersion: v1
kind: ServiceAccount
metadata:
name: volcano-dashboard
namespace: volcano-system
---
# volcano dashboard cluster role binding
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: volcano-dashboard-role
namespace: volcano-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: volcano-dashboard
subjects:
- kind: ServiceAccount
name: volcano-dashboard
namespace: volcano-system
---
# volcano dashboard cluster role
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: volcano-dashboard
namespace: volcano-system
rules:
- apiGroups:
- batch.volcano.sh
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- scheduling.incubator.k8s.io
- scheduling.volcano.sh
resources:
- queues
verbs:
- get
- list
- watch
- delete
---
# volcano dashboard service
apiVersion: v1
kind: Service
metadata:
name: volcano-dashboard
namespace: volcano-system
spec:
ports:
- name: backend
port: 3001
protocol: TCP
targetPort: 3001
- name: frontend
port: 80
protocol: TCP
targetPort: 8080
selector:
app: volcano-dashboard