|
| 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 | +---- |
0 commit comments