From 5308f47b8e0660859643d0b6ece5874fbec8741a Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Wed, 31 Jan 2024 13:55:39 +0100 Subject: [PATCH] NO-JIRA: perfprof: render: make ownerReference optional (#907) * perfprof: render: make ownerReference optional When we set OwnerReference for dependant object, we must use the object UID the apiserver set. Apiserver owns this field (obviously) so setting it when missing, like the code did in the past, is wrong and will cause conflicts on updates. I the pre-render flow we can't wait for the apiserver to set a UID, so the only possible option is to not set any OwnerReference at all. Signed-off-by: Francesco Romani * perfprof: render: add weak owner reference support There are cases on which we can't use the real owner reference in the render flow, because: - we don't own the performanceprofile uid - we can't wait to learn back the apiserver-decided uid because we need to render all the manifest at once. so, to group objects together and enable to safely and easily rebuild the ownerReference graph later, we add an annotation which serves as weaker owner reference, using the profile name and adding it to all the related objects. Note this form of weak reference is meant to serve to a placeholder for the real ownerReference which should be added by the relevant controller later on, when the cluster is started and is running. Signed-off-by: Francesco Romani --------- Signed-off-by: Francesco Romani (cherry picked from commit 0e319439e65a4defc93134ee9849e5b84a5836fe) --- pkg/performanceprofile/cmd/render/cmd.go | 16 +- pkg/performanceprofile/cmd/render/render.go | 111 ++++++++--- .../1_render_command/render_test.go | 44 +++- .../openshift-bootstrap-master_annotated.yaml | 16 ++ ...nshift-bootstrap-master_kubeletconfig.yaml | 7 +- ...nshift-bootstrap-master_machineconfig.yaml | 6 +- .../openshift-bootstrap-master_node.yaml | 7 +- ...enshift-bootstrap-master_runtimeclass.yaml | 7 +- .../openshift-bootstrap-master_tuned.yaml | 7 +- .../openshift-bootstrap-worker_annotated.yaml | 16 ++ ...nshift-bootstrap-worker_kubeletconfig.yaml | 7 +- ...nshift-bootstrap-worker_machineconfig.yaml | 6 +- .../openshift-bootstrap-worker_node.yaml | 7 +- ...enshift-bootstrap-worker_runtimeclass.yaml | 7 +- .../openshift-bootstrap-worker_tuned.yaml | 7 +- .../openshift-bootstrap-master_annotated.yaml | 16 ++ ...nshift-bootstrap-master_kubeletconfig.yaml | 7 +- ...nshift-bootstrap-master_machineconfig.yaml | 6 +- .../openshift-bootstrap-master_node.yaml | 7 +- ...enshift-bootstrap-master_runtimeclass.yaml | 7 +- .../openshift-bootstrap-master_tuned.yaml | 7 +- .../openshift-bootstrap-worker_annotated.yaml | 16 ++ ...nshift-bootstrap-worker_kubeletconfig.yaml | 7 +- ...nshift-bootstrap-worker_machineconfig.yaml | 6 +- .../openshift-bootstrap-worker_node.yaml | 7 +- ...enshift-bootstrap-worker_runtimeclass.yaml | 7 +- .../openshift-bootstrap-worker_tuned.yaml | 7 +- .../default/manual_annotated.yaml | 31 +++ .../default/manual_kubeletconfig.yaml | 7 +- .../default/manual_machineconfig.yaml | 6 +- .../default/manual_node.yaml | 7 +- .../default/manual_runtimeclass.yaml | 7 +- .../default/manual_tuned.yaml | 7 +- .../no-ref/manual_annotated.yaml | 29 +++ .../no-ref/manual_kubeletconfig.yaml | 63 ++++++ .../no-ref/manual_machineconfig.yaml | 188 ++++++++++++++++++ .../no-ref/manual_node.yaml | 8 + .../no-ref/manual_runtimeclass.yaml | 9 + .../no-ref/manual_tuned.yaml | 62 ++++++ 39 files changed, 638 insertions(+), 157 deletions(-) create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_annotated.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_annotated.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_annotated.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_annotated.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/default/manual_annotated.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_annotated.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_kubeletconfig.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_node.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_runtimeclass.yaml create mode 100644 test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_tuned.yaml diff --git a/pkg/performanceprofile/cmd/render/cmd.go b/pkg/performanceprofile/cmd/render/cmd.go index 1582f0f31..16303b15f 100644 --- a/pkg/performanceprofile/cmd/render/cmd.go +++ b/pkg/performanceprofile/cmd/render/cmd.go @@ -31,6 +31,7 @@ import ( type renderOpts struct { assetsInDir string assetsOutDir string + ownerRefMode string } // NewRenderCommand creates a render command. @@ -39,6 +40,7 @@ type renderOpts struct { // needed to generate the machine configs. func NewRenderCommand() *cobra.Command { renderOpts := renderOpts{} + renderOpts.SetDefaults() cmd := &cobra.Command{ Use: "render", @@ -59,9 +61,14 @@ func NewRenderCommand() *cobra.Command { return cmd } +func (r *renderOpts) SetDefaults() { + r.ownerRefMode = ownerRefModeLabelName +} + func (r *renderOpts) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&r.assetsInDir, "asset-input-dir", components.AssetsDir, "Input path for the assets directory. (Can be a comma separated list of directories.)") fs.StringVar(&r.assetsOutDir, "asset-output-dir", r.assetsOutDir, "Output path for the rendered manifests.") + fs.StringVar(&r.ownerRefMode, "owner-ref", r.ownerRefMode, "Add Owner Reference to rendered manifests. Accepted values: 'none' to disable; 'k8s' for proper owner reference; 'label-name' to use just a label.") // environment variables has precedence over standard input r.readFlagsFromEnv() } @@ -74,18 +81,23 @@ func (r *renderOpts) readFlagsFromEnv() { if assetsOutDir := os.Getenv("ASSET_OUTPUT_DIR"); len(assetsOutDir) > 0 { r.assetsOutDir = assetsOutDir } + if ownerRefMode, ok := os.LookupEnv("OWNER_REF"); ok { + r.ownerRefMode = ownerRefMode + } } func (r *renderOpts) Validate() error { + if !isValidOwnerRefMode(r.ownerRefMode) { + return fmt.Errorf("unsupported owner reference: %q", r.ownerRefMode) + } if len(r.assetsOutDir) == 0 { return fmt.Errorf("asset-output-dir must be specified") } - return nil } func (r *renderOpts) Run() error { - return render(r.assetsInDir, r.assetsOutDir) + return render(r.ownerRefMode, r.assetsInDir, r.assetsOutDir) } func addKlogFlags(cmd *cobra.Command) { diff --git a/pkg/performanceprofile/cmd/render/render.go b/pkg/performanceprofile/cmd/render/render.go index 6b8ca3435..54da7444c 100644 --- a/pkg/performanceprofile/cmd/render/render.go +++ b/pkg/performanceprofile/cmd/render/render.go @@ -40,7 +40,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/klog" ) @@ -49,6 +48,16 @@ const ( clusterConfigResourceName = "cluster" ) +const ( + ownerRefModeNone = "none" + ownerRefModeK8S = "k8s" + ownerRefModeLabelName = "label-name" +) + +const ( + weakOwnerReferenceNameLabel = "performance.openshift.io/weak-owner-reference-name" +) + var ( manifestScheme = runtime.NewScheme() codecFactory serializer.CodecFactory @@ -70,8 +79,8 @@ func init() { // Render will traverse the input directory and generate the proper performance profile files // in to the output dir based on PerformanceProfile manifests contained in the input directory. -func render(inputDir, outputDir string) error { - klog.Info("Rendering files into: ", outputDir) +func render(ownerRefMode, inputDir, outputDir string) error { + klog.Infof("Rendering files into: %s (ownerRefMode=%v)", outputDir, ownerRefMode) // Read asset directory fileInfo filePaths, err := util.ListFiles(inputDir) @@ -191,45 +200,91 @@ func render(inputDir, outputDir string) error { return err } - uid := pp.UID - if uid == types.UID("") { - uid = uuid.NewUUID() - } - - or := []v1.OwnerReference{ - { - Kind: pp.Kind, - Name: pp.Name, - APIVersion: pp.APIVersion, - UID: uid, - }, - } - - for _, componentObj := range components.ToObjects() { - componentObj.SetOwnerReferences(or) + if ownerRefMode == ownerRefModeK8S { + err = addOwnerReference(components, pp) + if err != nil { + return err + } + } else if ownerRefMode == ownerRefModeLabelName { + err = addWeakOwnerReferenceLabel(components, pp) + if err != nil { + return err + } + err = writeObject(outputDir, fmt.Sprintf("%s_%s.yaml", pp.Name, "annotated"), pp) + if err != nil { + return err + } } for kind, manifest := range components.ToManifestTable() { - b, err := yaml.Marshal(manifest) + err = writeObject(outputDir, fmt.Sprintf("%s_%s.yaml", pp.Name, strings.ToLower(kind)), manifest) if err != nil { return err } + } + } - fileName := fmt.Sprintf("%s_%s.yaml", pp.Name, strings.ToLower(kind)) - fullFilePath := filepath.Join(outputDir, fileName) - klog.Info("Writing file: ", fullFilePath) + return nil +} - err = os.WriteFile(fullFilePath, b, 0644) - if err != nil { - return err - } - klog.Info(fileName) +func writeObject(outputDir, fileName string, manifest interface{}) error { + fullFilePath := filepath.Join(outputDir, fileName) + klog.Infof("Writing file: %s -> %s", fileName, fullFilePath) + + b, err := yaml.Marshal(manifest) + if err != nil { + return err + } + + return os.WriteFile(fullFilePath, b, 0644) +} + +func addOwnerReference(components *manifestset.ManifestResultSet, pp *performancev2.PerformanceProfile) error { + if pp == nil || pp.UID == types.UID("") { + return fmt.Errorf("Missing UID from performance profile") + } + + or := []v1.OwnerReference{ + { + Kind: pp.Kind, + Name: pp.Name, + APIVersion: pp.APIVersion, + UID: pp.UID, + }, + } + + for _, componentObj := range components.ToObjects() { + componentObj.SetOwnerReferences(or) + } + + return nil +} + +func addWeakOwnerReferenceLabel(components *manifestset.ManifestResultSet, pp *performancev2.PerformanceProfile) error { + lab := weakOwnerReferenceNameLabel // shortcut + val := pp.Name // shortcut + + if pp.Labels == nil { + pp.Labels = make(map[string]string) + } + pp.Labels[lab] = val + + for _, componentObj := range components.ToObjects() { + labels := componentObj.GetLabels() + if labels == nil { + labels = make(map[string]string) } + labels[lab] = val + componentObj.SetLabels(labels) } return nil } +func isValidOwnerRefMode(val string) bool { + return val == ownerRefModeNone || val == ownerRefModeK8S || val == ownerRefModeLabelName +} + // isLegacySNOWorkloadPinningMethod provides a check for situations where the user is creating an SNO cluster with the // legacy method for CPU Partitioning. In order to make sure the bootstrap and running cluster MCs are synced up we check the MCs // provided by the user, if any one of them contain the file addition to `/etc/kubernetes/openshift-workload-pinning` and have not set diff --git a/test/e2e/performanceprofile/functests-render-command/1_render_command/render_test.go b/test/e2e/performanceprofile/functests-render-command/1_render_command/render_test.go index 3253bd5a6..183b4220e 100644 --- a/test/e2e/performanceprofile/functests-render-command/1_render_command/render_test.go +++ b/test/e2e/performanceprofile/functests-render-command/1_render_command/render_test.go @@ -16,6 +16,7 @@ const ( defaultExpectedDir = "default" pinnedExpectedDir = "pinned" bootstrapExpectedDir = "bootstrap" + noRefExpectedDir = "no-ref" ) var ( @@ -73,6 +74,39 @@ var _ = Describe("render command e2e test", func() { ) runAndCompare(cmd, defaultExpectedDir) }) + + It("Must fail to restore legacy and wrong legacy owner reference if uid is missing", func() { + cmdline := []string{ + filepath.Join(binPath, "cluster-node-tuning-operator"), + "render", + "--asset-input-dir", strings.Join(assetsInDirs, ","), + "--asset-output-dir", assetsOutDir, + "--owner-ref", "k8s", + } + fmt.Fprintf(GinkgoWriter, "running: %v\n", cmdline) + + cmd := exec.Command(cmdline[0], cmdline[1:]...) + _, err := cmd.Output() + Expect(err).To(HaveOccurred(), logStderr(err)) + }) + + It("Must not set any owner reference if disabled explicitely", func() { + cmdline := []string{ + filepath.Join(binPath, "cluster-node-tuning-operator"), + "render", + "--asset-input-dir", strings.Join(assetsInDirs, ","), + "--asset-output-dir", assetsOutDir, + "--owner-ref", "none", + } + fmt.Fprintf(GinkgoWriter, "running: %v\n", cmdline) + + cmd := exec.Command(cmdline[0], cmdline[1:]...) + cmd.Env = append(cmd.Env, + fmt.Sprintf("ASSET_INPUT_DIR=%s", strings.Join(assetsInDirs, ",")), + fmt.Sprintf("ASSET_OUTPUT_DIR=%s", assetsOutDir), + ) + runAndCompare(cmd, noRefExpectedDir) + }) }) Context("With pinned cluster resources", func() { @@ -88,7 +122,6 @@ var _ = Describe("render command e2e test", func() { cmd := exec.Command(cmdline[0], cmdline[1:]...) runAndCompare(cmd, pinnedExpectedDir) - }) It("Given legacy SNO pinned infrastructure status, should render cpu partitioning configs", func() { @@ -164,7 +197,7 @@ func cleanArtifacts() { func runAndCompare(cmd *exec.Cmd, dir string) { _, err := cmd.Output() - Expect(err).ToNot(HaveOccurred()) + Expect(err).ToNot(HaveOccurred(), logStderr(err)) outputAssetsFiles, err := os.ReadDir(assetsOutDir) Expect(err).ToNot(HaveOccurred()) @@ -186,3 +219,10 @@ func runAndCompare(cmd *exec.Cmd, dir string) { diff) } } + +func logStderr(err error) string { + if exitErr, ok := err.(*exec.ExitError); ok { + return fmt.Sprintf("error running the command: [[%s]]", exitErr.Stderr) + } + return fmt.Sprintf("error running the command: [[%s]]", err) +} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_annotated.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_annotated.yaml new file mode 100644 index 000000000..55d79a752 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_annotated.yaml @@ -0,0 +1,16 @@ +apiVersion: performance.openshift.io/v2 +kind: PerformanceProfile +metadata: + creationTimestamp: null + name: openshift-bootstrap-master + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" +spec: + cpu: + isolated: 0-1 + reserved: 2-7 + machineConfigPoolSelector: + pools.operator.machineconfiguration.openshift.io/master: "" + nodeSelector: + node-role.kubernetes.io/master: "" +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_kubeletconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_kubeletconfig.yaml index 40758dc69..b0ae2d7cd 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_kubeletconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_kubeletconfig.yaml @@ -3,11 +3,8 @@ kind: KubeletConfig metadata: creationTimestamp: null name: performance-openshift-bootstrap-master - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" spec: kubeletConfig: apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml index 40cdb043c..4ef3fcd7e 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_machineconfig.yaml @@ -4,12 +4,8 @@ metadata: creationTimestamp: null labels: machineconfiguration.openshift.io/role: master + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" name: 50-performance-openshift-bootstrap-master - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" spec: baseOSExtensionsContainerImage: "" config: diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_node.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_node.yaml index a34dfd519..67665bc59 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_node.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_node.yaml @@ -3,11 +3,8 @@ kind: Node metadata: creationTimestamp: null name: cluster - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" spec: cgroupMode: v1 status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_runtimeclass.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_runtimeclass.yaml index d2ee3de61..b81856924 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_runtimeclass.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_runtimeclass.yaml @@ -4,11 +4,8 @@ kind: RuntimeClass metadata: creationTimestamp: null name: performance-openshift-bootstrap-master - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" scheduling: nodeSelector: node-role.kubernetes.io/master: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_tuned.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_tuned.yaml index 3696520f2..6da7ad5fe 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_tuned.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-master_tuned.yaml @@ -4,11 +4,8 @@ metadata: creationTimestamp: null name: openshift-node-performance-openshift-bootstrap-master namespace: openshift-cluster-node-tuning-operator - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" spec: profile: - data: "[main]\nsummary=Openshift node optimized for deterministic performance diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_annotated.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_annotated.yaml new file mode 100644 index 000000000..fcef6faa0 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_annotated.yaml @@ -0,0 +1,16 @@ +apiVersion: performance.openshift.io/v2 +kind: PerformanceProfile +metadata: + creationTimestamp: null + name: openshift-bootstrap-worker + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" +spec: + cpu: + isolated: 0-1 + reserved: 2-3 + machineConfigPoolSelector: + pools.operator.machineconfiguration.openshift.io/worker: "" + nodeSelector: + node-role.kubernetes.io/worker: "" +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_kubeletconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_kubeletconfig.yaml index 43a828a64..bbaeae8be 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_kubeletconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_kubeletconfig.yaml @@ -3,11 +3,8 @@ kind: KubeletConfig metadata: creationTimestamp: null name: performance-openshift-bootstrap-worker - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" spec: kubeletConfig: apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml index 20da778f0..b7425bb0b 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_machineconfig.yaml @@ -4,12 +4,8 @@ metadata: creationTimestamp: null labels: machineconfiguration.openshift.io/role: worker + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" name: 50-performance-openshift-bootstrap-worker - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" spec: baseOSExtensionsContainerImage: "" config: diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_node.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_node.yaml index f93a8280d..b9527f5dd 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_node.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_node.yaml @@ -3,11 +3,8 @@ kind: Node metadata: creationTimestamp: null name: cluster - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" spec: cgroupMode: v1 status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_runtimeclass.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_runtimeclass.yaml index 9bf0c7ffc..a58b0c1d9 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_runtimeclass.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_runtimeclass.yaml @@ -4,11 +4,8 @@ kind: RuntimeClass metadata: creationTimestamp: null name: performance-openshift-bootstrap-worker - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" scheduling: nodeSelector: node-role.kubernetes.io/worker: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_tuned.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_tuned.yaml index 1a3037f83..dec6ec1f9 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_tuned.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/extra-mcp/openshift-bootstrap-worker_tuned.yaml @@ -4,11 +4,8 @@ metadata: creationTimestamp: null name: openshift-node-performance-openshift-bootstrap-worker namespace: openshift-cluster-node-tuning-operator - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" spec: profile: - data: "[main]\nsummary=Openshift node optimized for deterministic performance diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_annotated.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_annotated.yaml new file mode 100644 index 000000000..55d79a752 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_annotated.yaml @@ -0,0 +1,16 @@ +apiVersion: performance.openshift.io/v2 +kind: PerformanceProfile +metadata: + creationTimestamp: null + name: openshift-bootstrap-master + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" +spec: + cpu: + isolated: 0-1 + reserved: 2-7 + machineConfigPoolSelector: + pools.operator.machineconfiguration.openshift.io/master: "" + nodeSelector: + node-role.kubernetes.io/master: "" +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_kubeletconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_kubeletconfig.yaml index 40758dc69..b0ae2d7cd 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_kubeletconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_kubeletconfig.yaml @@ -3,11 +3,8 @@ kind: KubeletConfig metadata: creationTimestamp: null name: performance-openshift-bootstrap-master - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" spec: kubeletConfig: apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml index 40cdb043c..4ef3fcd7e 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_machineconfig.yaml @@ -4,12 +4,8 @@ metadata: creationTimestamp: null labels: machineconfiguration.openshift.io/role: master + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" name: 50-performance-openshift-bootstrap-master - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" spec: baseOSExtensionsContainerImage: "" config: diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_node.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_node.yaml index a34dfd519..67665bc59 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_node.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_node.yaml @@ -3,11 +3,8 @@ kind: Node metadata: creationTimestamp: null name: cluster - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" spec: cgroupMode: v1 status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_runtimeclass.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_runtimeclass.yaml index d2ee3de61..b81856924 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_runtimeclass.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_runtimeclass.yaml @@ -4,11 +4,8 @@ kind: RuntimeClass metadata: creationTimestamp: null name: performance-openshift-bootstrap-master - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" scheduling: nodeSelector: node-role.kubernetes.io/master: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_tuned.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_tuned.yaml index 3696520f2..6da7ad5fe 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_tuned.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-master_tuned.yaml @@ -4,11 +4,8 @@ metadata: creationTimestamp: null name: openshift-node-performance-openshift-bootstrap-master namespace: openshift-cluster-node-tuning-operator - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-master - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-master" spec: profile: - data: "[main]\nsummary=Openshift node optimized for deterministic performance diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_annotated.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_annotated.yaml new file mode 100644 index 000000000..fcef6faa0 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_annotated.yaml @@ -0,0 +1,16 @@ +apiVersion: performance.openshift.io/v2 +kind: PerformanceProfile +metadata: + creationTimestamp: null + name: openshift-bootstrap-worker + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" +spec: + cpu: + isolated: 0-1 + reserved: 2-3 + machineConfigPoolSelector: + pools.operator.machineconfiguration.openshift.io/worker: "" + nodeSelector: + node-role.kubernetes.io/worker: "" +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_kubeletconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_kubeletconfig.yaml index 43a828a64..bbaeae8be 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_kubeletconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_kubeletconfig.yaml @@ -3,11 +3,8 @@ kind: KubeletConfig metadata: creationTimestamp: null name: performance-openshift-bootstrap-worker - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" spec: kubeletConfig: apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml index 20da778f0..b7425bb0b 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_machineconfig.yaml @@ -4,12 +4,8 @@ metadata: creationTimestamp: null labels: machineconfiguration.openshift.io/role: worker + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" name: 50-performance-openshift-bootstrap-worker - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" spec: baseOSExtensionsContainerImage: "" config: diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_node.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_node.yaml index f93a8280d..b9527f5dd 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_node.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_node.yaml @@ -3,11 +3,8 @@ kind: Node metadata: creationTimestamp: null name: cluster - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" spec: cgroupMode: v1 status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_runtimeclass.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_runtimeclass.yaml index 9bf0c7ffc..a58b0c1d9 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_runtimeclass.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_runtimeclass.yaml @@ -4,11 +4,8 @@ kind: RuntimeClass metadata: creationTimestamp: null name: performance-openshift-bootstrap-worker - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" scheduling: nodeSelector: node-role.kubernetes.io/worker: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_tuned.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_tuned.yaml index 1a3037f83..dec6ec1f9 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_tuned.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/bootstrap/no-mcp/openshift-bootstrap-worker_tuned.yaml @@ -4,11 +4,8 @@ metadata: creationTimestamp: null name: openshift-node-performance-openshift-bootstrap-worker namespace: openshift-cluster-node-tuning-operator - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: openshift-bootstrap-worker - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "openshift-bootstrap-worker" spec: profile: - data: "[main]\nsummary=Openshift node optimized for deterministic performance diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_annotated.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_annotated.yaml new file mode 100644 index 000000000..9c0618b30 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_annotated.yaml @@ -0,0 +1,31 @@ +apiVersion: performance.openshift.io/v2 +kind: PerformanceProfile +metadata: + name: manual + creationTimestamp: null + labels: + performance.openshift.io/weak-owner-reference-name: "manual" +spec: + cpu: + isolated: "1" + reserved: "0" + offlined: "2,3" + hugepages: + defaultHugepagesSize: "1G" + pages: + - size: "1G" + count: 1 + node: 0 + - size: "2M" + count: 128 + realTimeKernel: + enabled: true + numa: + topologyPolicy: "single-numa-node" + nodeSelector: + node-role.kubernetes.io/worker-cnf: "" + workloadHints: + highPowerConsumption: false + realTime: true + perPodPowerManagement: false +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_kubeletconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_kubeletconfig.yaml index a22e42f02..7c14d539b 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_kubeletconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_kubeletconfig.yaml @@ -3,11 +3,8 @@ kind: KubeletConfig metadata: creationTimestamp: null name: performance-manual - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: manual - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "manual" spec: kubeletConfig: apiVersion: kubelet.config.k8s.io/v1beta1 diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml index ce8f7d815..4e8d3969a 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_machineconfig.yaml @@ -4,12 +4,8 @@ metadata: creationTimestamp: null labels: machineconfiguration.openshift.io/role: worker-cnf + performance.openshift.io/weak-owner-reference-name: "manual" name: 50-performance-manual - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: manual - uid: "" spec: baseOSExtensionsContainerImage: "" config: diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_node.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_node.yaml index 8c8b718bd..b9e43519f 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_node.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_node.yaml @@ -3,11 +3,8 @@ kind: Node metadata: creationTimestamp: null name: cluster - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: manual - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "manual" spec: cgroupMode: v1 status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_runtimeclass.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_runtimeclass.yaml index 0133c1b1b..04afe0c73 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_runtimeclass.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_runtimeclass.yaml @@ -4,11 +4,8 @@ kind: RuntimeClass metadata: creationTimestamp: null name: performance-manual - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: manual - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "manual" scheduling: nodeSelector: node-role.kubernetes.io/worker-cnf: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_tuned.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_tuned.yaml index df6211d0c..bb355971f 100644 --- a/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_tuned.yaml +++ b/test/e2e/performanceprofile/testdata/render-expected-output/default/manual_tuned.yaml @@ -4,11 +4,8 @@ metadata: creationTimestamp: null name: openshift-node-performance-manual namespace: openshift-cluster-node-tuning-operator - ownerReferences: - - apiVersion: performance.openshift.io/v2 - kind: PerformanceProfile - name: manual - uid: "" + labels: + performance.openshift.io/weak-owner-reference-name: "manual" spec: profile: - data: "[main]\nsummary=Openshift node optimized for deterministic performance diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_annotated.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_annotated.yaml new file mode 100644 index 000000000..d5ae2a70f --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_annotated.yaml @@ -0,0 +1,29 @@ +apiVersion: performance.openshift.io/v2 +kind: PerformanceProfile +metadata: + name: manual + creationTimestamp: null +spec: + cpu: + isolated: "1" + reserved: "0" + offlined: "2,3" + hugepages: + defaultHugepagesSize: "1G" + pages: + - size: "1G" + count: 1 + node: 0 + - size: "2M" + count: 128 + realTimeKernel: + enabled: true + numa: + topologyPolicy: "single-numa-node" + nodeSelector: + node-role.kubernetes.io/worker-cnf: "" + workloadHints: + highPowerConsumption: false + realTime: true + perPodPowerManagement: false +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_kubeletconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_kubeletconfig.yaml new file mode 100644 index 000000000..28e52ab9f --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_kubeletconfig.yaml @@ -0,0 +1,63 @@ +apiVersion: machineconfiguration.openshift.io/v1 +kind: KubeletConfig +metadata: + creationTimestamp: null + name: performance-manual +spec: + kubeletConfig: + apiVersion: kubelet.config.k8s.io/v1beta1 + authentication: + anonymous: {} + webhook: + cacheTTL: 0s + x509: {} + authorization: + webhook: + cacheAuthorizedTTL: 0s + cacheUnauthorizedTTL: 0s + containerRuntimeEndpoint: "" + cpuManagerPolicy: static + cpuManagerPolicyOptions: + full-pcpus-only: "true" + cpuManagerReconcilePeriod: 5s + evictionHard: + imagefs.available: 15% + memory.available: 100Mi + nodefs.available: 10% + nodefs.inodesFree: 5% + evictionPressureTransitionPeriod: 0s + fileCheckFrequency: 0s + httpCheckFrequency: 0s + imageMinimumGCAge: 0s + kind: KubeletConfiguration + kubeReserved: + memory: 500Mi + logging: + flushFrequency: 0 + options: + json: + infoBufferSize: "0" + verbosity: 0 + memoryManagerPolicy: Static + memorySwap: {} + nodeStatusReportFrequency: 0s + nodeStatusUpdateFrequency: 0s + reservedMemory: + - limits: + memory: 1100Mi + numaNode: 0 + reservedSystemCPUs: "0" + runtimeRequestTimeout: 0s + shutdownGracePeriod: 0s + shutdownGracePeriodCriticalPods: 0s + streamingConnectionIdleTimeout: 0s + syncFrequency: 0s + systemReserved: + memory: 500Mi + topologyManagerPolicy: single-numa-node + volumeStatsAggPeriod: 0s + machineConfigPoolSelector: + matchLabels: + machineconfiguration.openshift.io/role: worker-cnf +status: + conditions: null diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml new file mode 100644 index 000000000..4aca4ae1d --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_machineconfig.yaml @@ -0,0 +1,188 @@ +apiVersion: machineconfiguration.openshift.io/v1 +kind: MachineConfig +metadata: + creationTimestamp: null + labels: + machineconfiguration.openshift.io/role: worker-cnf + name: 50-performance-manual +spec: + baseOSExtensionsContainerImage: "" + config: + ignition: + config: + replace: + verification: {} + proxy: {} + security: + tls: {} + timeouts: {} + version: 3.2.0 + passwd: {} + storage: + files: + - contents: + source: data:text/plain;charset=utf-8;base64,IyEvdXNyL2Jpbi9lbnYgYmFzaAoKc2V0IC1ldW8gcGlwZWZhaWwKCm5vZGVzX3BhdGg9Ii9zeXMvZGV2aWNlcy9zeXN0ZW0vbm9kZSIKaHVnZXBhZ2VzX2ZpbGU9IiR7bm9kZXNfcGF0aH0vbm9kZSR7TlVNQV9OT0RFfS9odWdlcGFnZXMvaHVnZXBhZ2VzLSR7SFVHRVBBR0VTX1NJWkV9a0IvbnJfaHVnZXBhZ2VzIgoKaWYgWyAhIC1mICIke2h1Z2VwYWdlc19maWxlfSIgXTsgdGhlbgogIGVjaG8gIkVSUk9SOiAke2h1Z2VwYWdlc19maWxlfSBkb2VzIG5vdCBleGlzdCIKICBleGl0IDEKZmkKCnRpbWVvdXQ9NjAKc2FtcGxlPTEKY3VycmVudF90aW1lPTAKd2hpbGUgWyAiJChjYXQgIiR7aHVnZXBhZ2VzX2ZpbGV9IikiIC1uZSAiJHtIVUdFUEFHRVNfQ09VTlR9IiBdOyBkbwogIGVjaG8gIiR7SFVHRVBBR0VTX0NPVU5UfSIgPiIke2h1Z2VwYWdlc19maWxlfSIKCiAgY3VycmVudF90aW1lPSQoKGN1cnJlbnRfdGltZSArIHNhbXBsZSkpCiAgaWYgWyAkY3VycmVudF90aW1lIC1ndCAkdGltZW91dCBdOyB0aGVuCiAgICBlY2hvICJFUlJPUjogJHtodWdlcGFnZXNfZmlsZX0gZG9lcyBub3QgaGF2ZSB0aGUgZXhwZWN0ZWQgbnVtYmVyIG9mIGh1Z2VwYWdlcyAke0hVR0VQQUdFU19DT1VOVH0iCiAgICBleGl0IDEKICBmaQoKICBzbGVlcCAkc2FtcGxlCmRvbmUK + verification: {} + group: {} + mode: 448 + path: /usr/local/bin/hugepages-allocation.sh + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,IyEvdXNyL2Jpbi9lbnYgYmFzaAoKZnVuY3Rpb24gc2V0X3F1ZXVlX3Jwc19tYXNrKCkgewojIHJlcGxhY2UgeDJkIHdpdGggaHlwaGVuICgtKSB3aGljaCBpcyBhbiBlc2NhcGVkIGNoYXJhY3RlcgojIHRoYXQgd2FzIGFkZGVkIGJ5IHN5c3RlbWQtZXNjYXBlIGluIG9yZGVyIHRvIGVzY2FwZSB0aGUgc3lzdGVtZCB1bml0IG5hbWUgdGhhdCBpbnZva2VzIHRoaXMgc2NyaXB0CnBhdGg9JHtwYXRoL3gyZC8tfQojIHNldCBycHMgYWZmaW5pdHkgZm9yIHRoZSBxdWV1ZQplY2hvICIke21hc2t9IiAgMj4gL2Rldi9udWxsID4gIi9zeXMvJHtwYXRofS9ycHNfY3B1cyIKIyB3ZSByZXR1cm4gMCBiZWNhdXNlIHRoZSAnZWNobycgY29tbWFuZCBtaWdodCBmYWlsIGlmIHRoZSBkZXZpY2UgcGF0aCB0byB3aGljaCB0aGUgcXVldWUgYmVsb25ncyBoYXMgY2hhbmdlZC4KIyB0aGlzIGNhbiBoYXBwZW4gaW4gY2FzZSBvZiBTUkktT1YgZGV2aWNlcyByZW5hbWluZy4KcmV0dXJuIDAKfQoKZnVuY3Rpb24gc2V0X25ldF9kZXZfcnBzX21hc2soKSB7CiAgIyBpbiBjYXNlIG9mIGRldmljZSB3ZSB3YW50IHRvIGl0ZXJhdGUgdGhyb3VnaCBhbGwgcXVldWVzCmZvciBpIGluIC9zeXMvIiR7cGF0aH0iL3F1ZXVlcy9yeC0qOyBkbwogIGVjaG8gIiR7bWFza30iIDI+IC9kZXYvbnVsbCA+ICIke2l9L3Jwc19jcHVzIgpkb25lCiMgd2UgcmV0dXJuIDAgYmVjYXVzZSB0aGUgJ2VjaG8nIGNvbW1hbmQgbWlnaHQgZmFpbCBpZiB0aGUgZGV2aWNlIHBhdGggdG8gd2hpY2ggdGhlIHF1ZXVlIGJlbG9uZ3MgaGFzIGNoYW5nZWQuCiMgdGhpcyBjYW4gaGFwcGVuIGluIGNhc2Ugb2YgU1JJLU9WIGRldmljZXMgcmVuYW1pbmcuCnJldHVybiAwCiB9CgpwYXRoPSR7MX0KWyAtbiAiJHtwYXRofSIgXSB8fCB7IGVjaG8gIlRoZSBkZXZpY2UgcGF0aCBhcmd1bWVudCBpcyBtaXNzaW5nIiA+JjIgOyBleGl0IDE7IH0KCm1hc2s9JHsyfQpbIC1uICIke21hc2t9IiBdIHx8IHsgZWNobyAiVGhlIG1hc2sgYXJndW1lbnQgaXMgbWlzc2luZyIgPiYyIDsgZXhpdCAxOyB9CgppZiBbWyAiJHtwYXRofSIgPX4gInF1ZXVlcyIgXV07IHRoZW4KIHNldF9xdWV1ZV9ycHNfbWFzawplbHNlCiBzZXRfbmV0X2Rldl9ycHNfbWFzawpmaQo= + verification: {} + group: {} + mode: 448 + path: /usr/local/bin/set-rps-mask.sh + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,IyEvdXNyL2Jpbi9iYXNoCgpzZXQgLWV1byBwaXBlZmFpbAoKZm9yIGNwdSBpbiAke09GRkxJTkVfQ1BVUy8vLC8gfTsKICBkbwogICAgb25saW5lX2NwdV9maWxlPSIvc3lzL2RldmljZXMvc3lzdGVtL2NwdS9jcHUkY3B1L29ubGluZSIKICAgIGlmIFsgISAtZiAiJHtvbmxpbmVfY3B1X2ZpbGV9IiBdOyB0aGVuCiAgICAgIGVjaG8gIkVSUk9SOiAke29ubGluZV9jcHVfZmlsZX0gZG9lcyBub3QgZXhpc3QsIGFib3J0IHNjcmlwdCBleGVjdXRpb24iCiAgICAgIGV4aXQgMQogICAgZmkKICBkb25lCgplY2hvICJBbGwgY3B1cyBvZmZsaW5lZCBleGlzdHMsIHNldCB0aGVtIG9mZmxpbmUiCgpmb3IgY3B1IGluICR7T0ZGTElORV9DUFVTLy8sLyB9OwogIGRvCiAgICBvbmxpbmVfY3B1X2ZpbGU9Ii9zeXMvZGV2aWNlcy9zeXN0ZW0vY3B1L2NwdSRjcHUvb25saW5lIgogICAgZWNobyAwID4gIiR7b25saW5lX2NwdV9maWxlfSIKICAgIGVjaG8gIm9mZmxpbmUgY3B1IG51bSAkY3B1IgogIGRvbmUKCg== + verification: {} + group: {} + mode: 448 + path: /usr/local/bin/set-cpus-offline.sh + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,IyEvdXNyL2Jpbi9lbnYgYmFzaApzZXQgLWV1byBwaXBlZmFpbApzZXQgLXgKCiMgY29uc3QKU0VEPSIvdXNyL2Jpbi9zZWQiCiMgdHVuYWJsZSAtIG92ZXJyaWRhYmxlIGZvciB0ZXN0aW5nIHB1cnBvc2VzCklSUUJBTEFOQ0VfQ09ORj0iJHsxOi0vZXRjL3N5c2NvbmZpZy9pcnFiYWxhbmNlfSIKQ1JJT19PUklHX0JBTk5FRF9DUFVTPSIkezI6LS9ldGMvc3lzY29uZmlnL29yaWdfaXJxX2Jhbm5lZF9jcHVzfSIKTk9ORT0wCgpbICEgLWYgIiR7SVJRQkFMQU5DRV9DT05GfSIgXSAmJiBleGl0IDAKCiR7U0VEfSAtaSAnL15ccypJUlFCQUxBTkNFX0JBTk5FRF9DUFVTXGIvZCcgIiR7SVJRQkFMQU5DRV9DT05GfSIgfHwgZXhpdCAwCiMgQ1BVIG51bWJlcnMgd2hpY2ggaGF2ZSB0aGVpciBjb3JyZXNwb25kaW5nIGJpdHMgc2V0IHRvIG9uZSBpbiB0aGlzIG1hc2sKIyB3aWxsIG5vdCBoYXZlIGFueSBpcnEncyBhc3NpZ25lZCB0byB0aGVtIG9uIHJlYmFsYW5jZS4KIyBzbyB6ZXJvIG1lYW5zIGFsbCBjcHVzIGFyZSBwYXJ0aWNpcGF0aW5nIGluIGxvYWQgYmFsYW5jaW5nLgplY2hvICJJUlFCQUxBTkNFX0JBTk5FRF9DUFVTPSR7Tk9ORX0iID4+ICIke0lSUUJBTEFOQ0VfQ09ORn0iCgojIHdlIG5vdyBvd24gdGhpcyBjb25maWd1cmF0aW9uLiBCdXQgQ1JJLU8gaGFzIGNvZGUgdG8gcmVzdG9yZSB0aGUgY29uZmlndXJhdGlvbiwKIyBhbmQgdW50aWwgaXQgZ2FpbnMgdGhlIG9wdGlvbiB0byBkaXNhYmxlIHRoaXMgcmVzdG9yZSBmbG93LCB3ZSBuZWVkIHRvIG1ha2UKIyB0aGUgY29uZmlndXJhdGlvbiBjb25zaXN0ZW50IHN1Y2ggYXMgdGhlIENSSS1PIHJlc3RvcmUgd2lsbCBkbyBub3RoaW5nLgppZiBbIC1uICIke0NSSU9fT1JJR19CQU5ORURfQ1BVU30iIF0gJiYgWyAtZiAiJHtDUklPX09SSUdfQkFOTkVEX0NQVVN9IiBdOyB0aGVuCgllY2hvICIke05PTkV9IiA+ICIke0NSSU9fT1JJR19CQU5ORURfQ1BVU30iCmZpCg== + verification: {} + group: {} + mode: 448 + path: /usr/local/bin/clear-irqbalance-banned-cpus.sh + user: {} + - contents: + source: data:text/plain;charset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ImlycS1sb2FkLWJhbGFuY2luZy5jcmlvLmlvIiwgImNwdS1jLXN0YXRlcy5jcmlvLmlvIiwgImNwdS1mcmVxLWdvdmVybm9yLmNyaW8uaW8iXQo= + verification: {} + group: {} + mode: 420 + path: /etc/crio/crio.conf.d/99-runtimes.conf + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,IyBBcHBseSB0aGUgUlBTIG1hc2sgb24gdGhlIHZpcnR1YWwgaW50ZXJmYWNlcyBvZiB0aGUgaG9zdCBieSBkZWZhdWx0LCBiZWNhc3VlCiMgZnJvbSB0aGUgY29udGFpbmVyIHBlcnNwZWN0aXZlIHRoZSBSUFMgbWFzayB0aGUgd2lsbCBiZSBjb25zdWx0ZWQsIGlzIHRoZSBvbmUgb24gdGhlIFJYIHNpZGUgb2YgdGhlIHZldGggaW4gdGhlIGhvc3QuCiMgQ29uc2lkZXIgdGhlIGZvbGxvd2luZyBkaWFncmFtOgojIFBvZCBBIDx2ZXRoMSAtIHZldGgyPiBob3N0IDx2ZXRoMyAtIHZldGg0PiBQb2QgQgojICB2ZXRoMidzIFJQUyBhZmZpbml0eSBpcyB0aGUgb25lIGRldGVybWluaW5nIHRoZSBDUFVzIHRoYXQgYXJlIGhhbmRsaW5nIHRoZSBwYWNrZXQgcHJvY2Vzc2luZyB3aGVuIHNlbmRpbmcgZGF0YSBmcm9tIFBvZCBBIHRvIHBvZCBCLgojIEFkZGl0aW9uYWwgY29tbW9uIHNjZW5hcmlvczoKIyAxLiBQb2QgQSA9IHNlbmRlciwgaG9zdCA9IHJlY2VpdmVyCiMgIFRoZSBSUFMgYWZmaW5pdHkgb2YgdGhlIGhvc3Qgc2lkZSBzaG91bGQgYmUgY29uc3VsdGVkIChiZWNhdXNlIGl04oCZcyB0aGUgcmVjZWl2ZXIpIGFuZCBpdCBzaG91bGQgYmUgc2V0IHRvIGNwdXMgbm90IHNlbnNpdGl2ZSB0byBwcmVlbXB0aW9uIChyZXNlcnZlZCBwb29sKS4KIyAyLiBQb2QgQSA9IHJlY2VpdmVyLCBob3N0ID0gc2VuZGVyCiMgIEluIGNhc2Ugb2Ygbm8gUlBTIG1hc2sgb24gdGhlIHJlY2VpdmVyIHNpZGUsIHRoZSBzZW5kZXIgbmVlZHMgdG8gcGF5IHRoZSBwcmljZSBhbmQgZG8gYWxsIHRoZSBwcm9jZXNzaW5nIG9uIGl0cyBjb3Jlcy4KbmV0LmNvcmUucnBzX2RlZmF1bHRfbWFzayA9IDAwMDAwMDAxCg== + verification: {} + group: {} + mode: 420 + path: /etc/sysctl.d/99-default-rps-mask.conf + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,U1VCU1lTVEVNPT0icXVldWVzIiwgQUNUSU9OPT0iYWRkIiwgRU5We0RFVlBBVEh9PT0iL2RldmljZXMvcGNpKi9xdWV1ZXMvcngqIiwgVEFHKz0ic3lzdGVtZCIsIFBST0dSQU09Ii9iaW4vc3lzdGVtZC1lc2NhcGUgLS1wYXRoIC0tdGVtcGxhdGU9dXBkYXRlLXJwc0Auc2VydmljZSAkZW52e0RFVlBBVEh9IiwgRU5We1NZU1RFTURfV0FOVFN9PSIlYyIKCiMgU1ItSU9WIGRldmljZXMgYXJlIG1vdmVkIChyZW5hbWVkKSwgaGVuY2Ugd2Ugd2FudCB0byBjYXRjaCB0aGlzIGV2ZW50IGFzIHdlbGwKU1VCU1lTVEVNPT0ibmV0IiwgQUNUSU9OPT0ibW92ZSIsIEVOVntERVZQQVRIfSE9Ii9kZXZpY2VzL3ZpcnR1YWwvbmV0LyoiLCBUQUcrPSJzeXN0ZW1kIiwgUFJPR1JBTT0iL2Jpbi9zeXN0ZW1kLWVzY2FwZSAtLXBhdGggLS10ZW1wbGF0ZT11cGRhdGUtcnBzQC5zZXJ2aWNlICRlbnZ7REVWUEFUSH0iLCBFTlZ7U1lTVEVNRF9XQU5UU309IiVjIgo= + verification: {} + group: {} + mode: 420 + path: /etc/udev/rules.d/99-netdev-physical-rps.rules + user: {} + - contents: + source: data:text/plain;charset=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4KCiMgc3lzdGVtZCBkb2VzIG5vdCBtYW5hZ2UgdGhlIGNwdXNldCBjZ3JvdXAgY29udHJvbGxlciwgc28gbW92ZSBldmVyeXRoaW5nIGZyb20gdGhlIG1hbmFnZWQgcGlkcyBjb250cm9sbGVyJ3Mgb3ZzLnNsaWNlCiMgdG8gdGhlIGNwdXNldCBjb250cm9sbGVyLgoKIyBDcmVhdGUgdGhlIG92cy5zbGljZQpta2RpciAtcCAiJG92c3NsaWNlIgplY2hvIDAgPiAiJG92c3NsaWNlIi9jcHVzZXQuc2NoZWRfbG9hZF9iYWxhbmNlCmNhdCAiJHJvb3QiL2NwdXNldC5jcHVzID4gIiRvdnNzbGljZSIvY3B1c2V0LmNwdXMKY2F0ICIkcm9vdCIvY3B1c2V0Lm1lbXMgPiAiJG92c3NsaWNlIi9jcHVzZXQubWVtcwoKIyBNb3ZlIE9WUyBvdmVyCmZvciBwcm9jZXNzIGluICQoY2F0ICIkb3Zzc2xpY2Vfc3lzdGVtZCIvKi9jZ3JvdXAucHJvY3MgfCBzb3J0IC1yKTsgZG8KICAgICAgICBlY2hvICRwcm9jZXNzID4gIiRvdnNzbGljZSIvY2dyb3VwLnByb2NzIDI+JjEgfCBncmVwIC12ICJJbnZhbGlkIEFyZ3VtZW50IiB8fCB0cnVlOwpkb25lCg== + verification: {} + group: {} + mode: 448 + path: /usr/local/bin/cpuset-configure.sh + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,W1VuaXRdCkRlc2NyaXB0aW9uPVRvcCBsZXZlbCBzbGljZSB1c2VkIHRvIGdpdmUgb3BlbnZzd2l0Y2ggYWNjZXNzIHRvIGFuIHVucmVzdHJpY3RlZCBzZXQgb2YgY3B1cwoKW1NsaWNlXQo= + verification: {} + group: {} + mode: 420 + path: /etc/systemd/system/ovs.slice + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,W1NlcnZpY2VdClNsaWNlPW92cy5zbGljZQo= + verification: {} + group: {} + mode: 420 + path: /etc/systemd/system/openvswitch.service.d/01-use-ovs-slice.conf + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,W1NlcnZpY2VdClNsaWNlPW92cy5zbGljZQo= + verification: {} + group: {} + mode: 420 + path: /etc/systemd/system/ovs-vswitchd.service.d/01-use-ovs-slice.conf + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,W1NlcnZpY2VdClNsaWNlPW92cy5zbGljZQo= + verification: {} + group: {} + mode: 420 + path: /etc/systemd/system/ovsdb-server.service.d/01-use-ovs-slice.conf + user: {} + - contents: + source: data:text/plain;charset=utf-8;base64,IyBUaGlzIGZpbGUgZW5hYmxlcyB0aGUgZHluYW1pYyBjcHUgYWZmaW5pdHkgbWFuYWdlbWVudCBvZiB0aGUgT1ZTIHNlcnZpY2VzCiMKIyBJdCBpcyByZWFkIGJ5IHRoZSBPVk4ncyBvdm5rdWJlLW5vZGUgRGFlbW9uU2V0IGNvbnRhaW5lciBhbmQgdGhlIGZlYXR1cmUKIyBpcyBlbmFibGVkIHdoZW4gdGhpcyBmaWxlIGV4aXN0cyBhbmQgaXMgbm90IGVtcHR5ICh0aGlzIGNvbW1lbnRhcnkgdGV4dAojIGVuc3VyZXMgdGhhdCkKIwojIEZvciBkaXNhYmxpbmcgdGhpcyBmZWF0dXJlIGluIGVtZXJnZW5jaWVzLCBlaXRoZXI6CiMgMSkgZGVsZXRlIHRoaXMgZmlsZSBhbmQgc2V0IHRoZSBjcHUgYWZmaW5pdHkgb2YgT1ZTIHNlcnZpY2VzIG1hbnVhbGx5CiMgMikgb3IgcmVwbGFjZSB0aGUgY29udGVudHMgb2YgdGhpcyBmaWxlIHdpdGggYW4gZW1wdHkgc3RyaW5nCiMgICAgdmlhIGEgTWFjaGluZUNvbmZpZwo= + verification: {} + group: {} + mode: 420 + path: /var/lib/ovn-ic/etc/enable_dynamic_cpu_affinity + user: {} + systemd: + units: + - contents: | + [Unit] + Description=Sets network devices RPS mask + + [Service] + Type=oneshot + ExecStart=/usr/local/bin/set-rps-mask.sh %I 0 + name: update-rps@.service + - contents: | + [Unit] + Description=Hugepages-1048576kB allocation on the node 0 + Before=kubelet.service + + [Service] + Environment=HUGEPAGES_COUNT=1 + Environment=HUGEPAGES_SIZE=1048576 + Environment=NUMA_NODE=0 + Type=oneshot + RemainAfterExit=true + ExecStart=/usr/local/bin/hugepages-allocation.sh + + [Install] + WantedBy=multi-user.target + enabled: true + name: hugepages-allocation-1048576kB-NUMA0.service + - contents: | + [Unit] + Description=Move services to reserved cpuset + Before=network-online.target + + [Service] + Type=oneshot + ExecStart=/usr/local/bin/cpuset-configure.sh + + [Install] + WantedBy=multi-user.target crio.service + enabled: true + name: cpuset-configure.service + - contents: | + [Unit] + Description=Set cpus offline: 2,3 + Before=kubelet.service + + [Service] + Environment=OFFLINE_CPUS=2,3 + Type=oneshot + RemainAfterExit=true + ExecStart=/usr/local/bin/set-cpus-offline.sh + + [Install] + WantedBy=multi-user.target + enabled: true + name: set-cpus-offline.service + - contents: | + [Unit] + Description=Clear the IRQBalance Banned CPU mask early in the boot + Before=kubelet.service + Before=irqbalance.service + + [Service] + Type=oneshot + RemainAfterExit=true + ExecStart=/usr/local/bin/clear-irqbalance-banned-cpus.sh + + [Install] + WantedBy=multi-user.target + enabled: true + name: clear-irqbalance-banned-cpus.service + extensions: null + fips: false + kernelArguments: null + kernelType: realtime + osImageURL: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_node.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_node.yaml new file mode 100644 index 000000000..0a2271456 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_node.yaml @@ -0,0 +1,8 @@ +apiVersion: config.openshift.io/v1 +kind: Node +metadata: + creationTimestamp: null + name: cluster +spec: + cgroupMode: v1 +status: {} diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_runtimeclass.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_runtimeclass.yaml new file mode 100644 index 000000000..73dfaf050 --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_runtimeclass.yaml @@ -0,0 +1,9 @@ +apiVersion: node.k8s.io/v1 +handler: high-performance +kind: RuntimeClass +metadata: + creationTimestamp: null + name: performance-manual +scheduling: + nodeSelector: + node-role.kubernetes.io/worker-cnf: "" diff --git a/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_tuned.yaml b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_tuned.yaml new file mode 100644 index 000000000..e4a1aa12c --- /dev/null +++ b/test/e2e/performanceprofile/testdata/render-expected-output/no-ref/manual_tuned.yaml @@ -0,0 +1,62 @@ +apiVersion: tuned.openshift.io/v1 +kind: Tuned +metadata: + creationTimestamp: null + name: openshift-node-performance-manual + namespace: openshift-cluster-node-tuning-operator +spec: + profile: + - data: "[main]\nsummary=Openshift node optimized for deterministic performance + at the cost of increased power consumption, focused on low latency network performance. + Based on Tuned 2.11 and Cluster node tuning (oc 4.5)\ninclude=openshift-node,cpu-partitioning\n\n# + Inheritance of base profiles legend:\n# cpu-partitioning -> network-latency + -> latency-performance\n# https://github.com/redhat-performance/tuned/blob/master/profiles/latency-performance/tuned.conf\n# + https://github.com/redhat-performance/tuned/blob/master/profiles/network-latency/tuned.conf\n# + https://github.com/redhat-performance/tuned/blob/master/profiles/cpu-partitioning/tuned.conf\n\n# + All values are mapped with a comment where a parent profile contains them.\n# + Different values will override the original values in parent profiles.\n\n[variables]\n#> + isolated_cores take a list of ranges; e.g. isolated_cores=2,4-7\n\nisolated_cores=1\n\n\nnot_isolated_cores_expanded=${f:cpulist_invert:${isolated_cores_expanded}}\n\n\n[cpu]\n#> + latency-performance\n#> (override)\nforce_latency=cstate.id:1|3\ngovernor=performance\nenergy_perf_bias=performance\nmin_perf_pct=100\n\n\n\n[service]\nservice.stalld=start,enable\n\n\n[vm]\n#> + network-latency\ntransparent_hugepages=never\n\n\n[irqbalance]\n# Disable the + plugin entirely, which was enabled by the parent profile `cpu-partitioning`.\n# + It can be racy if TuneD restarts for whatever reason.\n#> cpu-partitioning\nenabled=false\n\n\n[scheduler]\nruntime=0\ngroup.ksoftirqd=0:f:11:*:ksoftirqd.*\ngroup.rcuc=0:f:11:*:rcuc.*\ngroup.ktimers=0:f:11:*:ktimers.*\nsched_migration_cost_ns=5000000\n\ndefault_irq_smp_affinity + = ignore\n\n\n[sysctl]\n\n#> cpu-partitioning #RealTimeHint\nkernel.hung_task_timeout_secs=600\n#> + cpu-partitioning #RealTimeHint\nkernel.nmi_watchdog=0\n#> RealTimeHint\nkernel.sched_rt_runtime_us=-1\n#> + cpu-partitioning #RealTimeHint\nvm.stat_interval=10\n\n# cpu-partitioning and + RealTimeHint for RHEL disable it (= 0)\n# OCP is too dynamic when partitioning + and needs to evacuate\n#> scheduled timers when starting a guaranteed workload + (= 1)\nkernel.timer_migration=1\n#> network-latency\n# TODO once rhbz#2120328 + is solved: kernel.numa_balancing, net.core.busy_read and net.core.busy_poll + do not exist on RT kernels\nkernel.numa_balancing=0\nnet.core.busy_read=50\nnet.core.busy_poll=50\nnet.ipv4.tcp_fastopen=3\n\n# + If a workload mostly uses anonymous memory and it hits this limit, the entire\n# + working set is buffered for I/O, and any more write buffering would require\n# + swapping, so it's time to throttle writes until I/O can catch up. Workloads\n# + that mostly use file mappings may be able to use even higher values.\n#\n# The + generator of dirty data starts writeback at this percentage (system default\n# + is 20%)\n#> latency-performance\nvm.dirty_ratio=10\n\n# Start background writeback + (via writeback threads) at this percentage (system\n# default is 10%)\n#> latency-performance\nvm.dirty_background_ratio=3\n\n# + The swappiness parameter controls the tendency of the kernel to move\n# processes + out of physical memory and onto the swap disk.\n# 0 tells the kernel to avoid + swapping processes out of physical memory\n# for as long as possible\n# 100 + tells the kernel to aggressively swap processes out of physical memory\n# and + move them to swap cache\n#> latency-performance\nvm.swappiness=10\n\n# also + configured via a sysctl.d file\n# placed here for documentation purposes and + commented out due\n# to a tuned logging bug complaining about duplicate sysctl:\n# + \ https://issues.redhat.com/browse/RHEL-18972\n#> rps configuration\n# net.core.rps_default_mask=${not_isolated_cpumask}\n\n\n[selinux]\n#> + Custom (atomic host)\navc_cache_threshold=8192\n\n\n[net]\nnf_conntrack_hashsize=131072\n\n\n[bootloader]\n# + set empty values to disable RHEL initrd setting in cpu-partitioning\ninitrd_remove_dir=\ninitrd_dst_img=\ninitrd_add_dir=\n\n# + overrides cpu-partitioning cmdline\ncmdline_cpu_part=+nohz=on rcu_nocbs=${isolated_cores} + tuned.non_isolcpus=${not_isolated_cpumask} systemd.cpu_affinity=${not_isolated_cores_expanded} + intel_iommu=on iommu=pt\n\n\ncmdline_isolation=+isolcpus=managed_irq,${isolated_cores}\n\n\n\ncmdline_realtime=+nohz_full=${isolated_cores} + tsc=reliable nosoftlockup nmi_watchdog=0 mce=off skew_tick=1 rcutree.kthread_prio=11\n\n\n\n\n\n\n\ncmdline_hugepages=+ + default_hugepagesz=1G hugepagesz=2M hugepages=128 \n\n\n\n\ncmdline_pstate=+intel_pstate=disable\n\n\n[rtentsk]\n" + name: openshift-node-performance-manual + recommend: + - machineConfigLabels: + machineconfiguration.openshift.io/role: worker-cnf + operand: + tunedConfig: + reapply_sysctl: null + priority: 20 + profile: openshift-node-performance-manual +status: {}