From 5c593abf8aa2d2bef44ee56a9673899c848be8bd Mon Sep 17 00:00:00 2001 From: rcarrata Date: Tue, 5 Sep 2023 20:56:21 +0200 Subject: [PATCH 1/2] added nvidia operator --- nfd/instance/README.md | 6 +-- nvidia-gpu-operator/README.md | 42 +++++++++++++++++++ .../operator/base/kustomization.yaml | 7 ++++ .../operator/base/namespace.yaml | 8 ++++ .../operator/base/operator-group.yaml | 8 ++++ .../operator/base/subscription.yaml | 11 +++++ .../overlays/default/kustomization.yaml | 11 +++++ .../overlays/default/patch-channel.yaml | 3 ++ 8 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 nvidia-gpu-operator/README.md create mode 100644 nvidia-gpu-operator/operator/base/kustomization.yaml create mode 100644 nvidia-gpu-operator/operator/base/namespace.yaml create mode 100644 nvidia-gpu-operator/operator/base/operator-group.yaml create mode 100644 nvidia-gpu-operator/operator/base/subscription.yaml create mode 100644 nvidia-gpu-operator/operator/overlays/default/kustomization.yaml create mode 100644 nvidia-gpu-operator/operator/overlays/default/patch-channel.yaml diff --git a/nfd/instance/README.md b/nfd/instance/README.md index af250a83..61c6c968 100644 --- a/nfd/instance/README.md +++ b/nfd/instance/README.md @@ -22,13 +22,13 @@ The options for this operator are the following *overlays*: If you have cloned the `gitops-catalog` repository, you can install the Storage System by running from the root `gitops-catalog` directory ``` -oc apply -k openshift-nfd-operator/instance/overlays/default +oc apply -k nfd/instance/overlays/default ``` Or, without cloning: ``` -oc apply -k https://github.com/redhat-cop/gitops-catalog/openshift-nfd-operator/instance/overlays/default +oc apply -k https://github.com/redhat-cop/gitops-catalog/nfd/instance/overlays/default ``` As part of a different overlay in your own GitOps repo: @@ -38,5 +38,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - github.com/redhat-cop/gitops-catalog/openshift-nfd-operator/instance/overlays/default?ref=main + - github.com/redhat-cop/gitops-catalog/nfd/instance/overlays/default?ref=main ``` diff --git a/nvidia-gpu-operator/README.md b/nvidia-gpu-operator/README.md new file mode 100644 index 00000000..0f21b90f --- /dev/null +++ b/nvidia-gpu-operator/README.md @@ -0,0 +1,42 @@ +# NVIDIA GPU Operator + +Installs the NVIDIA GPU Operator. + +## Prerequisites + +First, install the [NVIDIA GPU Operator](../operator) in your cluster. + +Do not use the `base` directory directly, as you will need to patch the `channel` based on the version of OpenShift you are using, or the version of the operator you want to use. + +## Overlays + +The options for this operator are the following *overlays*: +* [default](overlays/default) + +### Default + +[default](overlays/default) configures the NVIDIA GPU Operator. + +## Usage + +If you have cloned the `gitops-catalog` repository, you can install the Storage System by running from the root `gitops-catalog` directory + +``` +oc apply -k nvidia-gpu-operator/operator/overlays/default +``` + +Or, without cloning: + +``` +oc apply -k https://github.com/redhat-cop/gitops-catalog/nvidia-gpu-operator/instance/overlays/default +``` + +As part of a different overlay in your own GitOps repo: + +``` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - github.com/redhat-cop/gitops-catalog/nvidia-gpu-operator/instance/overlays/default?ref=main +``` \ No newline at end of file diff --git a/nvidia-gpu-operator/operator/base/kustomization.yaml b/nvidia-gpu-operator/operator/base/kustomization.yaml new file mode 100644 index 00000000..1e66bd5f --- /dev/null +++ b/nvidia-gpu-operator/operator/base/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - operator-group.yaml + - subscription.yaml diff --git a/nvidia-gpu-operator/operator/base/namespace.yaml b/nvidia-gpu-operator/operator/base/namespace.yaml new file mode 100644 index 00000000..9f802932 --- /dev/null +++ b/nvidia-gpu-operator/operator/base/namespace.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Namespace +metadata: + annotations: + openshift.io/display-name: "NVIDIA GPU Operator" + labels: + openshift.io/cluster-monitoring: "true" + name: nvidia-gpu-operator diff --git a/nvidia-gpu-operator/operator/base/operator-group.yaml b/nvidia-gpu-operator/operator/base/operator-group.yaml new file mode 100644 index 00000000..53acfaaf --- /dev/null +++ b/nvidia-gpu-operator/operator/base/operator-group.yaml @@ -0,0 +1,8 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: nvidia-gpu-operator-group + namespace: nvidia-gpu-operator +spec: + targetNamespaces: + - nvidia-gpu-operator diff --git a/nvidia-gpu-operator/operator/base/subscription.yaml b/nvidia-gpu-operator/operator/base/subscription.yaml new file mode 100644 index 00000000..e4300788 --- /dev/null +++ b/nvidia-gpu-operator/operator/base/subscription.yaml @@ -0,0 +1,11 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: gpu-operator-certified + namespace: nvidia-gpu-operator +spec: + channel: patch-me-see-overlays-dir + installPlanApproval: Automatic + name: gpu-operator-certified + source: certified-operators + sourceNamespace: openshift-marketplace \ No newline at end of file diff --git a/nvidia-gpu-operator/operator/overlays/default/kustomization.yaml b/nvidia-gpu-operator/operator/overlays/default/kustomization.yaml new file mode 100644 index 00000000..c771cd2a --- /dev/null +++ b/nvidia-gpu-operator/operator/overlays/default/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: gpu-operator-certified + path: patch-channel.yaml diff --git a/nvidia-gpu-operator/operator/overlays/default/patch-channel.yaml b/nvidia-gpu-operator/operator/overlays/default/patch-channel.yaml new file mode 100644 index 00000000..6642eb17 --- /dev/null +++ b/nvidia-gpu-operator/operator/overlays/default/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: stable From 11142c3755c292951531aa65383267b31f227ef6 Mon Sep 17 00:00:00 2001 From: rcarrata Date: Tue, 19 Sep 2023 10:43:27 +0200 Subject: [PATCH 2/2] fix linting --- nvidia-gpu-operator/operator/base/subscription.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvidia-gpu-operator/operator/base/subscription.yaml b/nvidia-gpu-operator/operator/base/subscription.yaml index e4300788..322840eb 100644 --- a/nvidia-gpu-operator/operator/base/subscription.yaml +++ b/nvidia-gpu-operator/operator/base/subscription.yaml @@ -8,4 +8,4 @@ spec: installPlanApproval: Automatic name: gpu-operator-certified source: certified-operators - sourceNamespace: openshift-marketplace \ No newline at end of file + sourceNamespace: openshift-marketplace