Skip to content

Commit 2a90961

Browse files
anishasthanaopenshift-merge-robot
authored andcommitted
Allow operator to create mcad deployments
Signed-off-by: Anish Asthana <anishasthana1@gmail.com>
1 parent d3a41e8 commit 2a90961

File tree

3 files changed

+62
-87
lines changed

3 files changed

+62
-87
lines changed

config/internal/mcad/deployment.yaml

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
kind: Deployment
2+
apiVersion: apps/v1
3+
metadata:
4+
name: mcad-controller-{{.Name}}
5+
namespace: {{.Namespace}}
6+
labels:
7+
app: mcad-{{.Name}}
8+
component: multi-cluster-application-dispatcher
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
app: mcad-{{.Name}}
14+
template:
15+
metadata:
16+
labels:
17+
app: mcad-{{.Name}}
18+
component: multi-cluster-application-dispatcher
19+
spec:
20+
containers:
21+
- name: mcad-controller
22+
args: [ "--v", "4", "--logtostderr"]
23+
command:
24+
- mcad-controller
25+
envFrom:
26+
- configMapRef:
27+
name: mcad-{{.Name}}-config
28+
image: 'quay.io/project-codeflare/mcad-controller:release-v1.29.52'
29+
imagePullPolicy: Always
30+
ports:
31+
- name: https
32+
containerPort: 6443
33+
protocol: TCP
34+
- name: http
35+
containerPort: 8080
36+
protocol: TCP
37+
resources:
38+
limits:
39+
cpu: '2'
40+
memory: 2Gi
41+
requests:
42+
cpu: '2'
43+
memory: 2Gi
44+
terminationMessagePath: /dev/termination-log
45+
terminationMessagePolicy: File
46+
volumeMounts:
47+
- name: temp-vol
48+
mountPath: /tmp
49+
serviceAccountName: mcad-controller-{{.Name}}
50+
volumes:
51+
- name: temp-vol
52+
emptyDir: {}

controllers/multi_cluster_app_dispatcher.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@ var multiClusterAppDispatcherTemplates = []string{
1010
"mcad/configmap.yaml.tmpl",
1111
"mcad/service.yaml.tmpl",
1212
"mcad/serviceaccount.yaml.tmpl",
13+
"mcad/deployment.yaml.tmpl",
1314
}
1415
var ownerLessmultiClusterAppDispatcherTemplates = []string{
1516
"mcad/rolebinding_custom-metrics-auth-reader.yaml.tmpl",
17+
"mcad/clusterrole_custom-metrics-server-admin.yaml.tmpl",
18+
"mcad/clusterrole_mcad-controller.yaml.tmpl",
19+
"mcad/clusterrole_metrics-resource-reader.yaml.tmpl",
20+
"mcad/clusterrolebinding_hpa-controller-custom-metrics.yaml.tmpl",
21+
"mcad/clusterrolebinding_mcad-controller.yaml.tmpl",
22+
"mcad/clusterrolebinding_mcad-controller-kube-scheduler.yaml.tmpl",
23+
"mcad/clusterrolebinding_mcad-edit.yaml.tmpl",
24+
"mcad/clusterrolebinding_mcad-system-auth-delegator.yaml.tmpl",
25+
"mcad/clusterrolebinding_metrics-resource-reader.yaml.tmpl",
1626
}
1727

1828
func (r *MCADReconciler) ReconcileMCAD(ctx context.Context, mcad *codeflarev1alpha1.MCAD, req ctrl.Request, params *MCADParams) error {

0 commit comments

Comments
 (0)