diff --git a/Dockerfile b/Dockerfile index f9614a70f..4aaf99095 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 WORKDIR / COPY --from=builder /workspace/manager . -COPY config/internal config/internal USER 65532:65532 ENTRYPOINT ["/manager"] diff --git a/config/internal/instascale/clusterrole.yaml.tmpl b/config/internal/instascale/clusterrole.yaml.tmpl deleted file mode 100644 index 8f27f57f0..000000000 --- a/config/internal/instascale/clusterrole.yaml.tmpl +++ /dev/null @@ -1,73 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: instascale-{{.Name}}-cr - labels: - app.kubernetes.io/managed-by: InstaScale - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -rules: -- apiGroups: - - "" - resources: - - nodes - - configmaps - verbs: - - list - - watch - - get - - create - - update - - delete - - patch - -- apiGroups: - - "" - resourceNames: - - instascale-ocm-secret - resources: - - secrets - verbs: - - get - -- apiGroups: - - config.openshift.io - resources: - - clusterversions - verbs: - - get - - list - -- apiGroups: - - apps - resources: - - deployments - verbs: - - list - - watch - - get -- apiGroups: - - machine.openshift.io - resources: - - "*" - verbs: - - list - - watch - - get - - create - - update - - delete - - patch - -- apiGroups: - - mcad.ibm.com - resources: - - appwrappers - verbs: - - list - - watch - - get - - create - - update - - delete - - patch diff --git a/config/internal/instascale/clusterrolebinding.yaml.tmpl b/config/internal/instascale/clusterrolebinding.yaml.tmpl deleted file mode 100644 index ef775b42b..000000000 --- a/config/internal/instascale/clusterrolebinding.yaml.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: instascale-{{.Name}}-crb - labels: - app.kubernetes.io/managed-by: InstaScale - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: instascale-{{.Name}}-cr -subjects: -- kind: ServiceAccount - name: instascale-{{.Name}}-sa - namespace: {{.Namespace}} diff --git a/config/internal/instascale/configmap.yaml.tmpl b/config/internal/instascale/configmap.yaml.tmpl deleted file mode 100644 index 8e665ecca..000000000 --- a/config/internal/instascale/configmap.yaml.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: instascale-config - namespace: {{.Namespace}} - labels: - app: instascale-{{.Name}} - component: instascale -data: - maxScaleoutAllowed: "{{.MaxScaleoutAllowed}}" - useMachinePools: "{{.UseMachinePools}}" diff --git a/config/internal/instascale/deployment.yaml.tmpl b/config/internal/instascale/deployment.yaml.tmpl deleted file mode 100644 index fe21ade62..000000000 --- a/config/internal/instascale/deployment.yaml.tmpl +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: instascale-{{.Name}} - name: instascale-{{.Name}} - namespace: {{.Namespace}} -spec: - replicas: 1 - selector: - matchLabels: - app: instascale-{{.Name}} - template: - metadata: - labels: - app: instascale-{{.Name}} - spec: - containers: - - args: - - "--configs-namespace={{.Namespace}}" - image: {{.ControllerImage}} - name: instascale - resources: {{.ControllerResources}} - livenessProbe: - httpGet: - path: /healthz - port: 8081 - periodSeconds: 5 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - periodSeconds: 10 - serviceAccountName: instascale-{{.Name}}-sa diff --git a/config/internal/instascale/sa.yaml.tmpl b/config/internal/instascale/sa.yaml.tmpl deleted file mode 100644 index 562265acb..000000000 --- a/config/internal/instascale/sa.yaml.tmpl +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: instascale-{{.Name}}-sa - namespace: {{.Namespace}} diff --git a/config/internal/mcad/apiservice_custom-metrics.yaml b/config/internal/mcad/apiservice_custom-metrics.yaml deleted file mode 100644 index b054fee11..000000000 --- a/config/internal/mcad/apiservice_custom-metrics.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# {{ if (eq .Values.configMap.multiCluster true) }} -apiVersion: apiregistration.k8s.io/v1beta1 -kind: APIService -metadata: - name: v1beta1.custom.metrics.k8s.io - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -spec: - service: - name: mcad-{{.Name}}-metrics - namespace: {{.Namespace}} - group: custom.metrics.k8s.io - version: v1beta1 - insecureSkipTLSVerify: true - groupPriorityMinimum: 100 - versionPriority: 100 diff --git a/config/internal/mcad/apiservice_external-metrics.yaml b/config/internal/mcad/apiservice_external-metrics.yaml deleted file mode 100644 index 0c242c111..000000000 --- a/config/internal/mcad/apiservice_external-metrics.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# {{ if (eq .Values.configMap.multiCluster true) }} -apiVersion: apiregistration.k8s.io/v1beta1 -kind: APIService -metadata: - name: v1beta1.external.metrics.k8s.io - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -spec: - service: - name: mcad-{{.Name}}-metrics - namespace: {{.Namespace}} - group: external.metrics.k8s.io - version: v1beta1 - insecureSkipTLSVerify: true - groupPriorityMinimum: 100 - versionPriority: 100 diff --git a/config/internal/mcad/clusterrole_custom-metrics-server-admin.yaml.tmpl b/config/internal/mcad/clusterrole_custom-metrics-server-admin.yaml.tmpl deleted file mode 100644 index e75007950..000000000 --- a/config/internal/mcad/clusterrole_custom-metrics-server-admin.yaml.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{.Name}}-mcad-custom-metrics-server-admin-role - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -rules: - - apiGroups: - - custom.metrics.k8s.io - resources: ["*"] - verbs: ["*"] diff --git a/config/internal/mcad/clusterrole_mcad-controller.yaml.tmpl b/config/internal/mcad/clusterrole_mcad-controller.yaml.tmpl deleted file mode 100644 index 7d49f5fee..000000000 --- a/config/internal/mcad/clusterrole_mcad-controller.yaml.tmpl +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - annotations: - rbac.authorization.kubernetes.io/autoupdate: "true" - name: {{.Name}}-mcad-controller-role - labels: - kubernetes.io/bootstrapping: rbac-defaults - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -rules: - - apiGroups: - - mcad.ibm.com - resources: - - queuejobs - - schedulingspecs - - appwrappers - - appwrappers/finalizers - - appwrappers/status - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch - - apiGroups: - - "" - resources: - - persistentvolumes - - namespaces - - lists - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch - - apiGroups: - - scheduling.sigs.k8s.io - resources: - - podgroups - verbs: - - get - - list - - watch - - create - - update - - patch - - delete diff --git a/config/internal/mcad/clusterrole_metrics-resource-reader.yaml.tmpl b/config/internal/mcad/clusterrole_metrics-resource-reader.yaml.tmpl deleted file mode 100644 index 99f12b694..000000000 --- a/config/internal/mcad/clusterrole_metrics-resource-reader.yaml.tmpl +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{.Name}}-mcad-metrics-resource-reader-role - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -rules: - - apiGroups: - - "" - resources: - - namespaces - - pods - - services - verbs: - - get - - list diff --git a/config/internal/mcad/clusterrolebinding_hpa-controller-custom-metrics.yaml.tmpl b/config/internal/mcad/clusterrolebinding_hpa-controller-custom-metrics.yaml.tmpl deleted file mode 100644 index e4a482fee..000000000 --- a/config/internal/mcad/clusterrolebinding_hpa-controller-custom-metrics.yaml.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: hpa-controller-custom-metrics -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{.Name}}-mcad-custom-metrics-server-admin-role - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -subjects: - - kind: ServiceAccount - name: horizontal-pod-autoscaler - namespace: kube-system diff --git a/config/internal/mcad/clusterrolebinding_mcad-controller-kube-scheduler.yaml.tmpl b/config/internal/mcad/clusterrolebinding_mcad-controller-kube-scheduler.yaml.tmpl deleted file mode 100644 index f01636b13..000000000 --- a/config/internal/mcad/clusterrolebinding_mcad-controller-kube-scheduler.yaml.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - annotations: - rbac.authorization.kubernetes.io/autoupdate: "true" - labels: - kubernetes.io/bootstrapping: rbac-defaults - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} - name: {{.Name}}-mcad-controller-kube-scheduler-crb -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:kube-scheduler -subjects: - - kind: ServiceAccount - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/config/internal/mcad/clusterrolebinding_mcad-controller.yaml.tmpl b/config/internal/mcad/clusterrolebinding_mcad-controller.yaml.tmpl deleted file mode 100644 index 6ef7ff52e..000000000 --- a/config/internal/mcad/clusterrolebinding_mcad-controller.yaml.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - annotations: - rbac.authorization.kubernetes.io/autoupdate: "true" - labels: - kubernetes.io/bootstrapping: rbac-defaults - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} - name: {{.Name}}-mcad-controller-crb -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{.Name}}-mcad-controller-role -subjects: - - kind: ServiceAccount - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/config/internal/mcad/clusterrolebinding_mcad-edit.yaml.tmpl b/config/internal/mcad/clusterrolebinding_mcad-edit.yaml.tmpl deleted file mode 100644 index 06b0f12da..000000000 --- a/config/internal/mcad/clusterrolebinding_mcad-edit.yaml.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - annotations: - rbac.authorization.kubernetes.io/autoupdate: "true" - labels: - kubernetes.io/bootstrapping: rbac-defaults - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} - name: {{.Name}}-mcad-edit-crb -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: edit -subjects: - - kind: ServiceAccount - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/config/internal/mcad/clusterrolebinding_mcad-system-auth-delegator.yaml.tmpl b/config/internal/mcad/clusterrolebinding_mcad-system-auth-delegator.yaml.tmpl deleted file mode 100644 index fc66e5881..000000000 --- a/config/internal/mcad/clusterrolebinding_mcad-system-auth-delegator.yaml.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{.Name}}-mcad-system:auth-delegator - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:auth-delegator -subjects: - - kind: ServiceAccount - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/config/internal/mcad/clusterrolebinding_metrics-resource-reader.yaml.tmpl b/config/internal/mcad/clusterrolebinding_metrics-resource-reader.yaml.tmpl deleted file mode 100644 index 9d4327e4d..000000000 --- a/config/internal/mcad/clusterrolebinding_metrics-resource-reader.yaml.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{.Name}}-mcad-metrics-resource-reader-crb - labels: - app.kubernetes.io/managed-by: MCAD - codeflare.codeflare.dev/cr-name: {{.Name}} - codeflare.codeflare.dev/cr-namespace: {{.Namespace}} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{.Name}}-mcad-metrics-resource-reader-role -subjects: - - kind: ServiceAccount - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/config/internal/mcad/configmap.yaml.tmpl b/config/internal/mcad/configmap.yaml.tmpl deleted file mode 100644 index c99b4a70f..000000000 --- a/config/internal/mcad/configmap.yaml.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -data: - DISPATCHER_MODE: "{{.DispatcherMode}}" - PREEMPTION: "{{.PreemptionEnabled}}" - {{if ne .AgentConfigs ""}}DISPATCHER_AGENT_CONFIGS: "{{.AgentConfigs}}"{{end}} - {{if ne .QuotaRestURL ""}}QUOTA_REST_URL: "{{.QuotaRestURL}}"{{end}} - {{if ne .PodCreationTimeout -1}}DISPATCH_RESOURCE_RESERVATION_TIMEOUT: "{{.PodCreationTimeout}}"{{end}} -kind: ConfigMap -metadata: - name: mcad-{{.Name}}-config - namespace: {{.Namespace}} - labels: - app: mcad-{{.Name}} - component: multi-cluster-app-dispatcher diff --git a/config/internal/mcad/deployment.yaml.tmpl b/config/internal/mcad/deployment.yaml.tmpl deleted file mode 100644 index 4620c1dc7..000000000 --- a/config/internal/mcad/deployment.yaml.tmpl +++ /dev/null @@ -1,58 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} - labels: - app: mcad-{{.Name}} - component: multi-cluster-application-dispatcher -spec: - replicas: 1 - selector: - matchLabels: - app: mcad-{{.Name}} - template: - metadata: - labels: - app: mcad-{{.Name}} - component: multi-cluster-application-dispatcher - spec: - containers: - - name: mcad-controller - args: ["--v", "4", "--logtostderr"] - command: - - mcad-controller - envFrom: - - configMapRef: - name: mcad-{{.Name}}-config - image: {{.ControllerImage}} - imagePullPolicy: Always - ports: - - name: https - containerPort: 6443 - protocol: TCP - - name: http - containerPort: 8080 - protocol: TCP - resources: {{.ControllerResources}} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - name: temp-vol - mountPath: /tmp - livenessProbe: - httpGet: - path: /healthz - port: 8081 - timeoutSeconds: 5 - periodSeconds: 5 - readinessProbe: - httpGet: - path: /healthz - port: 8081 - timeoutSeconds: 5 - periodSeconds: 5 - serviceAccountName: mcad-controller-{{.Name}} - volumes: - - name: temp-vol - emptyDir: {} diff --git a/config/internal/mcad/image_secret.yaml b/config/internal/mcad/image_secret.yaml deleted file mode 100644 index 840c50694..000000000 --- a/config/internal/mcad/image_secret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# {{ if .Values.imagePullSecret.name }} -apiVersion: v1 -kind: Secret -metadata: - name: {{.Values.imagePullSecret.name}} - namespace: kube-system -type: kubernetes.io/dockerconfigjson -data: - .dockerconfigjson: {{template "imagePullSecret" .}} -# {{ end }} diff --git a/config/internal/mcad/rolebinding_custom-metrics-auth-reader.yaml.tmpl b/config/internal/mcad/rolebinding_custom-metrics-auth-reader.yaml.tmpl deleted file mode 100644 index f8794545f..000000000 --- a/config/internal/mcad/rolebinding_custom-metrics-auth-reader.yaml.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{.Name}}-custom-metrics-auth-reader - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: extension-apiserver-authentication-reader -subjects: - - kind: ServiceAccount - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/config/internal/mcad/service.yaml.tmpl b/config/internal/mcad/service.yaml.tmpl deleted file mode 100644 index 3bdd1555f..000000000 --- a/config/internal/mcad/service.yaml.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mcad-{{.Name}}-metrics - namespace: {{.Namespace}} -spec: - ports: - - name: https - port: 443 - targetPort: 6443 - - name: http - port: 80 - targetPort: 8080 - selector: - app: mcad-{{.Name}} diff --git a/config/internal/mcad/service_nodeport.yaml b/config/internal/mcad/service_nodeport.yaml deleted file mode 100644 index f474e840f..000000000 --- a/config/internal/mcad/service_nodeport.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# {{ if .Values.configMap.quotaRestUrl }} -apiVersion: v1 -kind: Service -metadata: - name: mcad-{{.Name}}-quota-http-server -spec: - type: NodePort - selector: - app: mcad-{{.Name}} - ports: - # By default and for convenience, the `targetPort` is set to the same value as the `port` field. - - port: 8082 - targetPort: 80 - # Optional field - # By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767) - nodePort: 30082 -# {{ end }} diff --git a/config/internal/mcad/serviceaccount.yaml.tmpl b/config/internal/mcad/serviceaccount.yaml.tmpl deleted file mode 100644 index c0418d246..000000000 --- a/config/internal/mcad/serviceaccount.yaml.tmpl +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: mcad-controller-{{.Name}} - namespace: {{.Namespace}} diff --git a/main.go b/main.go index b8c0415e5..fab53da08 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,6 @@ import ( var ( scheme = runtime.NewScheme() setupLog = ctrl.Log.WithName("setup") - // templatesPath = "config/internal/" ) func init() {