Added k8s configs
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-12-13 04:17:24 +01:00
parent 8f6328eb98
commit dba71002b4
2 changed files with 197 additions and 0 deletions

140
k8s/schedulee.yml Normal file
View File

@ -0,0 +1,140 @@
---
apiVersion: types.kubefed.io/v1beta1
kind: FederatedIngress
metadata:
name: filter-ingress
namespace: birbnetes
spec:
placement:
clusters:
- name: cloud
- name: edge-1
- name: edge-2
template:
metadata:
annotations:
ingressclass.kubernetes.io/is-default-class: ""
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /filter
pathType: Prefix
backend:
service:
name: svm-prefilter-service-service
port:
number: 80
---
apiVersion: types.kubefed.io/v1beta1
kind: FederatedService
metadata:
name: svm-prefilter-service-service
namespace: birbnetes
labels:
app: svm-prefilter-service
spec:
template:
spec:
selector:
app: svm-prefilter-service
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8000
protocol: TCP
placement:
clusters:
- name: cloud
- name: edge-1
- name: edge-2
---
apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
name: svm-prefilter-service
namespace: birbnetes
spec:
template:
metadata:
labels:
app: svm-prefilter-service
spec:
replicas: 0
selector:
matchLabels:
app: svm-prefilter-service
strategy:
type: Recreate
template:
metadata:
labels:
app: svm-prefilter-service
spec:
containers:
- image: registry.kmlabz.com/birbnetes/svm-prefilter-service
name: testpoint
imagePullPolicy: Always
envFrom:
- configMapRef:
name: svm-prefilter-service-config
ports:
- containerPort: 8000
imagePullSecrets:
- name: regcred
placement:
clusters:
- name: cloud
- name: edge-1
- name: edge-2
overrides:
- clusterName: cloud
clusterOverrides:
- path: "/spec/replicas"
value: 0
- clusterName: edge-1
clusterOverrides:
- path: "/spec/replicas"
value: 0
- clusterName: edge-2
clusterOverrides:
- path: "/spec/replicas"
value: 0
---
apiVersion: types.kubefed.io/v1beta1
kind: FederatedConfigMap
metadata:
name: svm-prefilter-service-config
namespace: birbnetes
spec:
template:
data:
MODEL_INFO_URL: "http://192.168.110.100:30420/model/svm/$default"
INPUT_SERVICE_URL: "http://192.168.110.100:30420/input"
REPORT_ALIAS: ""
REPORT_URL: "http://192.168.110.100:30420/report/site"
placement:
clusters:
- name: cloud
- name: edge-1
- name: edge-2
overrides:
- clusterName: cloud
clusterOverrides:
- path: /data/MODEL_INFO_URL
value: "http://model-service/model/svm/$default"
- path: /data/INPUT_SERVICE_URL
value: "http://input-service/input"
- path: /data/REPORT_ALIAS
value: cloud
- clusterName: edge-1
clusterOverrides:
- path: /data/REPORT_ALIAS
value: edge-1
- clusterName: edge-2
clusterOverrides:
- path: /data/REPORT_ALIAS
value: edge-2

57
k8s/scheduler.yml Normal file
View File

@ -0,0 +1,57 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: birb-scheduler
spec:
replicas: 1
template:
metadata:
labels:
app: birb-scheduler
spec:
serviceAccountName: birb-scheduler-account
automountServiceAccountToken: true
containers:
- name: birb-scheduler
image: registry.kmlabz.com/birbnetes/birb-scheduler
envFrom:
- configMapRef:
name: birb-scheduler-config
imagePullSecrets:
- name: regcred
selector:
matchLabels:
app: birb-scheduler
---
apiVersion: v1
kind: ConfigMap
metadata:
name: birb-scheduler-config
data:
SENTRY_DSN: ""
SITES: "edge-1;http://192.168.111.100:30420/ edge-2;http://192.168.112.100:30420/ cloud;http://192.168.110.100:30420/"
DEBUG: "yes"
REDIS_URL: "redis://birb-scheduler-redis:6379/0"
COLLECTOR_URL: "http://192.168.110.100:30420/report"
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: birb-scheduler-role
rules:
- apiGroups: ["types.kubefed.io"]
resources: ["federateddeployments"]
verbs: ["get", "list", "watch", "update", "patch"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: birb-scheduler-role-binding
subjects:
- kind: ServiceAccount
name: birb-scheduler-account
roleRef:
kind: Role
name: birb-scheduler-role
apiGroup: rbac.authorization.k8s.io