Skip to content

Commit

Permalink
Support configuring cgroupMode (#69)
Browse files Browse the repository at this point in the history
* Support configuring cgroupMode

* Add suggestions from review

---------

Co-authored-by: Stephan Feurer <stephan.feurer@vshn.ch>
  • Loading branch information
DebakelOrakel and Stephan Feurer authored Sep 22, 2023
1 parent 928eb62 commit 3241755
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 1 deletion.
2 changes: 2 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ parameters:
tags: []
userDataSecret:
name: worker-user-data
nodeConfig:
cgroupMode: v1

nodeGroups: {}

Expand Down
1 change: 1 addition & 0 deletions class/openshift4-nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ parameters:
- openshift4-nodes/component/machine-sets.jsonnet
- openshift4-nodes/component/machine-config-pools.jsonnet
- openshift4-nodes/component/machine-configs.jsonnet
- openshift4-nodes/component/node-config.jsonnet
- openshift4-nodes/component/kubelet.jsonnet
- openshift4-nodes/component/container-runtime.jsonnet
- openshift4-nodes/component/oc-debug-node.jsonnet
Expand Down
18 changes: 18 additions & 0 deletions component/node-config.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local common = import 'common.libsonnet';
local com = import 'lib/commodore.libjsonnet';
local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';
local inv = kap.inventory();

local params = inv.parameters.openshift4_nodes;

local nodeConfig = kube._Object('config.openshift.io/v1', 'Node', 'cluster') {
metadata+: {
labels+: common.DefaultLabels,
},
spec: params.nodeConfig,
};

{
'10_nodeconfig': nodeConfig,
}
17 changes: 16 additions & 1 deletion docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Configuring this higher up in the hierarchy can result in unexpected behavior.

== `machine_api_namespace`


[horizontal]
type:: string
default:: `openshift-machine-api`
Expand All @@ -72,6 +71,22 @@ The namespace where machine-api related objects should be created.

TIP: Namespaced resources without an explicit `.metadata.namespace` field will be deployed in this namespace as well.

== `nodeConfig`

[horizontal]
type:: dictionary
default::
+
[source,yaml]
----
cgroupMode: v1
----

A dictionary holding the default values applied to the `node.config.openshift.io` object created by this component.

You can switch between cgroup v1 and cgroup v2, as needed, by editing the node.config object.
For more information, see https://docs.openshift.com/container-platform/latest/installing/install_config/enabling-cgroup-v2.html[Enabling Linux control group version 2].

== `nodeGroups`

[horizontal]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: Node
metadata:
annotations: {}
labels:
app.kubernetes.io/component: openshift4-nodes
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: openshift4-nodes
name: cluster
name: cluster
spec:
cgroupMode: v1

0 comments on commit 3241755

Please sign in to comment.