This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add odh-model-controller as an independent component (#912)
* add odh-model-controller as an independent component * manifests update for operator 2.0 * Create v1.14.0 incubation release * Add dashboard incubation tag --------- Co-authored-by: Lucas Fernandez <lferrnan@redhat.com>
- Loading branch information
1 parent
59d87c2
commit 80132c2
Showing
22 changed files
with
534 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../prometheus | ||
- ../overlays/odh | ||
|
||
namespace: opendatahub | ||
configMapGenerator: | ||
- envs: | ||
- params.env | ||
name: odh-model-controller-parameters | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
vars: | ||
- fieldref: | ||
fieldPath: metadata.namespace | ||
name: mesh-namespace | ||
objref: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
name: odh-model-controller-parameters | ||
- fieldref: | ||
fieldPath: data.odh-model-controller | ||
name: odh-model-controller | ||
objref: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
name: odh-model-controller-parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
odh-model-controller=quay.io/opendatahub/odh-model-controller:v0.11.0-alpha | ||
kserve-enabled=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bases: | ||
- ../rbac | ||
- ../manager |
11 changes: 11 additions & 0 deletions
11
odh-model-controller/manager/controller_manager_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 | ||
kind: ControllerManagerConfig | ||
health: | ||
healthProbeBindAddress: :8081 | ||
metrics: | ||
bindAddress: 127.0.0.1:8080 | ||
webhook: | ||
port: 9443 | ||
leaderElection: | ||
leaderElect: true | ||
resourceName: odh-model-controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resources: | ||
- manager.yaml | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
configMapGenerator: | ||
- files: | ||
- controller_manager_config.yaml | ||
name: manager-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: odh-model-controller | ||
labels: | ||
control-plane: odh-model-controller | ||
app: odh-model-controller | ||
spec: | ||
selector: | ||
matchLabels: | ||
control-plane: odh-model-controller | ||
replicas: 3 | ||
template: | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/default-container: manager | ||
labels: | ||
control-plane: odh-model-controller | ||
app: odh-model-controller | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 100 | ||
podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: control-plane | ||
operator: In | ||
values: | ||
- odh-model-controller | ||
topologyKey: kubernetes.io/hostname | ||
securityContext: | ||
runAsNonRoot: true | ||
containers: | ||
- command: | ||
- /manager | ||
args: | ||
- --leader-elect | ||
image: controller:latest | ||
name: manager | ||
imagePullPolicy: Always | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
# TODO(user): Configure the resources accordingly based on the project requirements. | ||
# More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 2Gi | ||
requests: | ||
cpu: 10m | ||
memory: 64Mi | ||
serviceAccountName: odh-model-controller | ||
terminationGracePeriodSeconds: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../default | ||
|
||
patchesStrategicMerge: | ||
- odh_model_controller_manager_patch.yaml | ||
|
||
configurations: | ||
- params.yaml |
19 changes: 19 additions & 0 deletions
19
odh-model-controller/overlays/odh/odh_model_controller_manager_patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: odh-model-controller | ||
spec: | ||
replicas: 3 | ||
template: | ||
spec: | ||
containers: | ||
- args: | ||
- --leader-elect | ||
- "--monitoring-namespace" | ||
- "$(MONITORING_NS)" | ||
- --kserve-enabled | ||
image: $(odh-model-controller) | ||
env: | ||
- name: MONITORING_NS | ||
value: kserve | ||
name: manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
varReference: | ||
- path: metadata/name | ||
kind: ClusterRoleBinding | ||
apiGroup: authorization.openshift.io | ||
- path: spec/template/spec/containers[]/image | ||
kind: Deployment | ||
apiVersion: apps/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resources: | ||
- monitor.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Prometheus Monitor Service (Metrics) | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
labels: | ||
control-plane: odh-model-controller | ||
name: odh-model-controller-metrics-monitor | ||
spec: | ||
endpoints: | ||
- path: /metrics | ||
port: https | ||
scheme: https | ||
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
tlsConfig: | ||
insecureSkipVerify: false | ||
selector: | ||
matchLabels: | ||
control-plane: odh-model-controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: metrics-reader | ||
rules: | ||
- nonResourceURLs: | ||
- "/metrics" | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: proxy-role | ||
rules: | ||
- apiGroups: | ||
- authentication.k8s.io | ||
resources: | ||
- tokenreviews | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- authorization.k8s.io | ||
resources: | ||
- subjectaccessreviews | ||
verbs: | ||
- create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: proxy-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: proxy-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: odh-model-controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
control-plane: odh-model-controller | ||
name: odh-model-controller-metrics-service | ||
namespace: system | ||
spec: | ||
ports: | ||
- name: metrics | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
control-plane: odh-model-controller |
15 changes: 15 additions & 0 deletions
15
odh-model-controller/rbac/kserve_prometheus_clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kserve-prometheus-k8s | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
- endpoints | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
resources: | ||
# All RBAC will be applied under this service account in | ||
# the deployment namespace. You may comment out this resource | ||
# if your manager will use a service account that exists at | ||
# runtime. Be sure to update RoleBinding and ClusterRoleBinding | ||
# subjects if changing service account names. | ||
- service_account.yaml | ||
- role.yaml | ||
- role_binding.yaml | ||
- leader_election_role.yaml | ||
- leader_election_role_binding.yaml | ||
# Comment the following 4 lines if you want to disable | ||
# the auth proxy (https://github.com/brancz/kube-rbac-proxy) | ||
# which protects your /metrics endpoint. | ||
- auth_proxy_service.yaml | ||
- auth_proxy_role.yaml | ||
- auth_proxy_role_binding.yaml | ||
- auth_proxy_client_clusterrole.yaml | ||
- kserve_prometheus_clusterrole.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# permissions to do leader election. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: leader-election-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch | ||
- delete | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch |
11 changes: 11 additions & 0 deletions
11
odh-model-controller/rbac/leader_election_role_binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: leader-election-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: leader-election-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: odh-model-controller |
Oops, something went wrong.