Configuring Discovery ISO kernel arguments for installations using GitOps ZTP
The GitOps Zero Touch Provisioning (ZTP) workflow uses the Discovery ISO as part of the OpenShift Container Platform 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.
|
|
In OpenShift Container Platform {product-version}, you can only add kernel arguments. You can not replace or delete kernel arguments. |
-
You have installed the OpenShift CLI (oc).
-
You have logged in to the hub cluster as a user with cluster-admin privileges.
-
Create the
InfraEnvCR and edit thespec.kernelArgumentsspecification to configure kernel arguments.-
Save the following YAML in an
InfraEnv-example.yamlfile:The
InfraEnvCR in this example uses template syntax such as{{ .Cluster.ClusterName }}that is populated based on values in theClusterInstanceCR. TheClusterInstanceCR automatically populates values for these templates during deployment. Do not edit the templates manually.apiVersion: agent-install.openshift.io/v1beta1 kind: InfraEnv metadata: annotations: argocd.argoproj.io/sync-wave: "1" name: "{{ .Cluster.ClusterName }}" namespace: "{{ .Cluster.ClusterName }}" spec: clusterRef: name: "{{ .Cluster.ClusterName }}" namespace: "{{ .Cluster.ClusterName }}" kernelArguments: - operation: append value: audit=0 - operation: append value: trace=1 sshAuthorizedKey: "{{ .Site.SshPublicKey }}" proxy: "{{ .Cluster.ProxySettings }}" pullSecretRef: name: "{{ .Site.PullSecretRef.Name }}" ignitionConfigOverride: "{{ .Cluster.IgnitionConfigOverride }}" nmStateConfigLabelSelector: matchLabels: nmstate-label: "{{ .Cluster.ClusterName }}" additionalNTPSources: "{{ .Cluster.AdditionalNTPSources }}"-
kernelArguments.operationspecifies the append operation to add a kernel argument. -
kernelArguments.valuespecifies the kernel argument you want to configure. This example configures theauditkernel argument and thetracekernel argument.
-
-
-
Commit the
InfraEnv-example.yamlfile to your Git repository and push your changes. The following example shows a sample Git repository structure:~/example-ztp/install └── site-install ├── clusterinstance-example.yaml ├── InfraEnv-example.yaml └── kustomization.yaml -
Update the
kustomization.yamlfile to use theconfigMapGeneratorfield to package theInfraEnvCR into aConfigMap:apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - clusterinstance-example.yaml configMapGenerator: - name: custom-infraenv-cm namespace: example-cluster files: - InfraEnv-example.yaml generatorOptions: disableNameSuffixHash: true-
clusterinstance-example.yamlspecifies the name of theClusterInstanceCR. -
configMapGenerator.namespecifies the name of theConfigMapthat contains the customInfraEnvCR. -
configMapGenerator.namespacemust match theClusterInstancenamespace.
-
-
In your
ClusterInstanceCR, reference theConfigMapin thespec.templateRefsfield:apiVersion: siteconfig.open-cluster-management.io/v1alpha1 kind: ClusterInstance metadata: name: "example-cluster" namespace: "example-cluster" spec: clusterName: "example-cluster" templateRefs: - name: custom-infraenv-cm namespace: example-cluster # ...-
spec.templateRefsspecifies theConfigMapCR that contains the customInfraEnvCR template.
-
-
Commit the
ClusterInstanceCR andkustomization.yamlto your Git repository and push your changes.When the Argo CD pipeline syncs the changes, the SiteConfig Operator uses the custom
InfraEnv-exampleCR from the generatedConfigMapto configure the infrastructure environment, including the custom kernel arguments.
To verify that the kernel arguments are applied, after the Discovery image verifies that OpenShift Container Platform 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.
-
Begin an SSH session with the target host:
$ ssh -i /path/to/privatekey core@<host_name> -
View the system’s kernel arguments by using the following command:
$ cat /proc/cmdline