Skip to content

Commit c086be3

Browse files
committed
Adding procedure for adding kernel params in ZTP
1 parent 00dce91 commit c086be3

File tree

4 files changed

+171
-0
lines changed

4 files changed

+171
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-deploying-far-edge-sites.adoc
4+
:_content-type: PROCEDURE
5+
[id="setting-managed-bare-metal-host-kernel-arguments_{context}"]
6+
= Configuring Discovery ISO kernel arguments for manual installations using GitOps ZTP
7+
8+
The GitOps ZTP workflow uses the Discovery ISO as part of the {product-title} installation process on managed bare-metal hosts. You can edit the `InfraEnv` resource to specify kernel arguments for the Discovery ISO. This is useful for cluster installations with specific environmental requirements. For example, configure the `rd.net.timeout.carrier` kernel argument for the Discovery ISO to facilitate static networking for the cluster or to receive a DHCP address before downloading the root file system during installation.
9+
10+
[NOTE]
11+
====
12+
In {product-title} {product-version}, you can only add kernel arguments. You can not replace or delete kernel arguments.
13+
====
14+
15+
.Prerequisites
16+
17+
* You have installed the OpenShift CLI (oc).
18+
* You have logged in to the hub cluster as a user with cluster-admin privileges.
19+
* You have manually generated the installation and configuration custom resources (CRs).
20+
21+
.Procedure
22+
23+
. Edit the `spec.kernelArguments` specification in the `InfraEnv` CR to configure kernel arguments:
24+
25+
[source,yaml,options="nowrap",role="white-space-pre"]
26+
----
27+
apiVersion: agent-install.openshift.io/v1beta1
28+
kind: InfraEnv
29+
metadata:
30+
name: <cluster_name>
31+
namespace: <cluster_name>
32+
spec:
33+
kernelArguments:
34+
- operation: append <1>
35+
value: audit=0 <2>
36+
- operation: append
37+
value: trace=1
38+
clusterRef:
39+
name: <cluster_name>
40+
namespace: <cluster_name>
41+
pullSecretRef:
42+
name: pull-secret
43+
----
44+
<1> Specify the append operation to add a kernel argument.
45+
<2> Specify the kernel argument you want to configure. This example configures the audit kernel argument and the trace kernel argument.
46+
47+
[NOTE]
48+
====
49+
The `SiteConfig` CR generates the `InfraEnv` resource as part of the day-0 installation CRs.
50+
====
51+
52+
.Verification
53+
To verify that the kernel arguments are applied, after the Discovery image verifies that {product-title} is ready for installation, you can SSH to the target host before the installation process begins. At that point, you can view the kernel arguments for the Discovery ISO in the `/proc/cmdline` file.
54+
55+
. Begin an SSH session with the target host:
56+
+
57+
[source,terminal]
58+
----
59+
$ ssh -i /path/to/privatekey core@<host_name>
60+
----
61+
62+
. View the system's kernel arguments by using the following command:
63+
+
64+
[source,terminal]
65+
----
66+
$ cat /proc/cmdline
67+
----
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-deploying-far-edge-sites.adoc
4+
:_content-type: PROCEDURE
5+
[id="setting-managed-bare-metal-host-kernel-arguments_{context}"]
6+
= Configuring Discovery ISO kernel arguments for installations using GitOps ZTP
7+
8+
The GitOps ZTP workflow uses the Discovery ISO as part of the {product-title} installation process on managed bare-metal hosts. You can edit the `InfraEnv` resource to specify kernel arguments for the Discovery ISO. This is useful for cluster installations with specific environmental requirements. For example, configure the `rd.net.timeout.carrier` kernel argument for the Discovery ISO to facilitate static networking for the cluster or to receive a DHCP address before downloading the root file system during installation.
9+
10+
[NOTE]
11+
====
12+
In {product-title} {product-version}, you can only add kernel arguments. You can not replace or delete kernel arguments.
13+
====
14+
15+
.Prerequisites
16+
17+
* You have installed the OpenShift CLI (oc).
18+
* You have logged in to the hub cluster as a user with cluster-admin privileges.
19+
20+
.Procedure
21+
22+
. Create the `InfraEnv` CR and edit the `spec.kernelArguments` specification to configure kernel arguments.
23+
24+
.. Save the following YAML in an `InfraEnv-example.yaml` file:
25+
+
26+
[NOTE]
27+
====
28+
The `InfraEnv` CR in this example uses template syntax such as `{{ .Cluster.ClusterName }}` that is populated based on values in the `SiteConfig` CR. The `SiteConfig` CR automatically populates values for these templates during deployment. Do not edit the templates manually.
29+
====
30+
+
31+
[source,yaml]
32+
----
33+
apiVersion: agent-install.openshift.io/v1beta1
34+
kind: InfraEnv
35+
metadata:
36+
annotations:
37+
argocd.argoproj.io/sync-wave: "1"
38+
name: "{{ .Cluster.ClusterName }}"
39+
namespace: "{{ .Cluster.ClusterName }}"
40+
spec:
41+
clusterRef:
42+
name: "{{ .Cluster.ClusterName }}"
43+
namespace: "{{ .Cluster.ClusterName }}"
44+
kernelArguments:
45+
- operation: append <1>
46+
value: audit=0 <2>
47+
- operation: append
48+
value: trace=1
49+
sshAuthorizedKey: "{{ .Site.SshPublicKey }}"
50+
proxy: "{{ .Cluster.ProxySettings }}"
51+
pullSecretRef:
52+
name: "{{ .Site.PullSecretRef.Name }}"
53+
ignitionConfigOverride: "{{ .Cluster.IgnitionConfigOverride }}"
54+
nmStateConfigLabelSelector:
55+
matchLabels:
56+
nmstate-label: "{{ .Cluster.ClusterName }}"
57+
additionalNTPSources: "{{ .Cluster.AdditionalNTPSources }}"
58+
----
59+
<1> Specify the append operation to add a kernel argument.
60+
<2> Specify the kernel argument you want to configure. This example configures the audit kernel argument and the trace kernel argument.
61+
62+
. Commit the `InfraEnv-example.yaml` CR to the same location in your Git repository that has the `SiteConfig` CR and push your changes. The following example shows a sample Git repository structure:
63+
64+
+
65+
[source,text]
66+
----
67+
~/example-ztp/install
68+
└── site-install
69+
├── siteconfig-example.yaml
70+
├── InfraEnv-example.yaml
71+
...
72+
----
73+
74+
. Edit the `spec.clusters.crTemplates` specification in the `SiteConfig` CR to reference the `InfraEnv-example.yaml` CR in your Git repository:
75+
+
76+
[source,yaml,options="nowrap",role="white-space-pre"]
77+
----
78+
clusters:
79+
crTemplates:
80+
InfraEnv: "InfraEnv-example.yaml"
81+
----
82+
+
83+
When you are ready to deploy your cluster by committing and pushing the `SiteConfig` CR, the build pipeline uses the custom `InfraEnv-example` CR in your Git repository to configure the infrastructure environment, including the custom kernel arguments.
84+
85+
.Verification
86+
To verify that the kernel arguments are applied, after the Discovery image verifies that {product-title} is ready for installation, you can SSH to the target host before the installation process begins. At that point, you can view the kernel arguments for the Discovery ISO in the `/proc/cmdline` file.
87+
88+
. Begin an SSH session with the target host:
89+
+
90+
[source,terminal]
91+
----
92+
$ ssh -i /path/to/privatekey core@<host_name>
93+
----
94+
95+
. View the system's kernel arguments by using the following command:
96+
+
97+
[source,terminal]
98+
----
99+
$ cat /proc/cmdline
100+
----

scalability_and_performance/ztp_far_edge/ztp-deploying-far-edge-sites.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ The target bare-metal host must meet the networking, firmware, and hardware requ
1919

2020
include::modules/ztp-creating-the-site-secrets.adoc[leveloffset=+1]
2121

22+
include::modules/ztp-configuring-kernel-arguments-for-discovery-iso.adoc[leveloffset=+1]
23+
2224
include::modules/ztp-deploying-a-site.adoc[leveloffset=+1]
2325

2426
[role="_additional-resources"]

scalability_and_performance/ztp_far_edge/ztp-manual-install.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ include::modules/ztp-generating-install-and-config-crs-manually.adoc[leveloffset
2929
3030
include::modules/ztp-creating-the-site-secrets.adoc[leveloffset=+1]
3131

32+
include::modules/ztp-configuring-kernel-arguments-for-discovery-iso-in-manual-installations.adoc[leveloffset=+1]
33+
3234
include::modules/ztp-manually-install-a-single-managed-cluster.adoc[leveloffset=+1]
3335

3436
[role="_additional-resources"]

0 commit comments

Comments
 (0)