OKD Project Documentation
repository·master·Indexed 24 days ago
https://github.com/okd-project/okdOKD is the community distribution of Kubernetes that powers Red Hat's OpenShift, optimized for continuous application development and multi-tenant deployment. This documentation provides installation and configuration guides for various environments, including Azure Cloud Shell, OpenStack via Terraform, VMware vSphere using govc, and Bare Metal User-Provisioned Infrastructure (UPI).
What's inside OKD
- The Bare Metal User-Provisioned Infrastructure (UPI) guides provide workarounds and optimizations for OKD deployments on bare metal hardware. Because bare metal environments vary significantly, these guides address common scenarios where standard OKD installer assumptions may fail, such as specific network interface configurations, DNS issues in Fedora CoreOS (FCOS), and hostname resolution.
Why manual iptables manipulation via MachineConfig is discouraged
masterAttempting to manage node firewalls by deploying
MachineConfigto manipulateiptablesis unreliable in OKD.If you are using the default networking setups like OpenShift SDN or OVNKubernetes, the CNI manages the
iptablesruleset. For example, in OpenShift SDN, whenever the SDN updates its rules, it updates them at index 0, effectively prepending its rules before any custom rules you have injected. This circumvents your filtering logic.To avoid network instability or security bypasses, do not blindly configure
iptables; instead, integrate your rules into the CNI manually or use the provider's supported configuration mechanisms.Use Source-to-Image (S2I) to build applications
masterSource-to-Image (S2I) is a tool that allows you to deploy applications by providing only the source code. It combines your source code with an existing S2I-enabled container image to produce a new, runnable image.
Commonly available S2I builder images include:
- Ruby
- Python
- Node.js
- PHP
- Perl
- WildFly
- MySQL
- MongoDB
- PostgreSQL
- MariaDB
Understand OKD bootstrap vs OCP bootstrap
masterA key architectural difference between OKD and OCP is the underlying operating system:
- OCP: Uses RHEL CoreOS (RHCOS), which includes
kubelet,crio, andMachine Config Daemonby default. - OKD: Uses Fedora CoreOS (FCOS). Because FCOS is more versatile, OKD must update the plain FCOS to include OKD-specific content.
The Bootstrap Process in OKD:
- The
release-image-download.servicepulls themachine-os-contentimage from the payload. - It extracts the
ostreecommit and pivots the bootstrap node into it. - For control plane and worker nodes, the
machine-config-firstboot.serviceperforms a similar update early in the process.
- OCP: Uses RHEL CoreOS (RHCOS), which includes
Understand OKD default security controls
masterOKD implements several security defaults to isolate workloads:
- Non-root execution: Containers run as a unique, non-root user. They cannot access host resources, run privileged, or become root.
- Resource Limits: CPU and memory limits are enforced by the system.
- Storage Isolation: Persistent storage is assigned a unique SELinux label to prevent cross-project access.
- Project Isolation: Containers in different projects are isolated from each other by default.
- Build Controls: While regular users can run builds, Docker builds (which often run as root) can be restricted via
builds/dockerandbuilds/custompolicy resources.
Operator availability in OKD vs OCP
masterSome optional operators available in Red Hat OpenShift Container Platform (OCP) are not available in OKD. Users should refer to the official OKD technical documentation for details on operator availability. An OKD-specific catalog containing community versions of these operators is currently in development.Inject DNS Configuration into the Bootstrap Ignition
masterThe bootstrap node is a 'snowflake' and does not use
MachineConfig. You must manually inject the DNS configuration into thebootstrap.ignfile. This step must be performed after runningopenshift-install create ignition-configs.It is recommended to use
ignition.config.mergeor tools likejqoryqto merge the following JSON structure into yourbootstrap.ignrather than editing the file by hand.{ "storage": { "links": [ { "group": {}, "path": "/etc/resolv.conf", "user": {}, "target": "../run/systemd/resolve/resolv.conf" } ], "files": [ { "overwrite": true, "path": "/etc/systemd/resolved.conf.d/50-no-dns-stub.conf", "user": { "name": "root" }, "contents": { "source": "data:text/plain;charset=utf-8;base64,W1Jlc29sdmVdCkROU1N0dWJMaXN0ZW5lcj1ubwo=" }, "mode": 420 }, { "overwrite": true, "path": "/etc/systemd/resolved.conf.d/75-static-dns-servers.conf", "user": { "name": "root" }, "contents": { "source": "data:text/plain;charset=utf-8;base64,<INJECT_YOUR_BASE_64_HERE>" }, "mode": 420 } ] } }Configure DNS Reverse Zone records for OKD
masterCreate a reverse zone file (e.g.,
/var/named/zones/db.192.168.100) to map IP addresses back to FQDNs.Replace
BASTION_LAST_OCTECT_IP,BOOTSTRAP_SERVER_LAST_OCTECT_IP, etc., with the last octet of the respective IP addresses, and replace FQDN placeholders with the actual hostnames.$TTL 604800 @ IN SOA ns1.example.com. admin.example.com. ( 6 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ; Negative Cache TTL ) ; name servers - NS records IN NS ns1.example.com. ; name servers - PTR records BASTION_LAST_OCTECT_IP IN PTR ns1.example.com. ; OpenShift Container Platform Cluster - PTR records BOOTSTRAP_SERVER_LAST_OCTECT_IP IN PTR BOOTSTRAP_SERVER_FQDN. CONTROL_PLANE_0_LAST_OCTECT_IP IN PTR CONTROL_PLANE_0_FQDN. CONTROL_PLANE_1_LAST_OCTECT_IP IN PTR CONTROL_PLANE_1_FQDN. CONTROL_PLANE_2_LAST_OCTECT_IP IN PTR CONTROL_PLANE_2_FQDN. COMPUTE_NODE_0_LAST_OCTECT_IP IN PTR COMPUTE_NODE_0_FQDN. COMPUTE_NODE_1_LAST_OCTECT_IP IN PTR COMPUTE_NODE_1_FQDN.Provision OKD on vSphere using UPI and Terraform
masterThis guide outlines the process for provisioning Fedora CoreOS (FCOS) on VMware vSphere and installing OKD using User-Provisioned Infrastructure (UPI) and Terraform. The process involves preparing DNS/DHCP, setting up a load balancer, generating ignition configurations, and using Terraform to deploy the virtual machines.
High-Level Workflow
- Prepare Environment: Configure DNS, DHCP, and a Load Balancer (e.g., HAProxy).
- Get Tools: Download
ocand theopenshift-installbinary. - Configure Installation: Create
install-config.yamland generate ignition files. - Deploy Infrastructure: Use Terraform to provision VMs.
- Bootstrap: Wait for the bootstrap node to complete, then run a second Terraform apply to destroy the bootstrap VM.
- Finalize: Wait for the full cluster installation to complete.
Configure cluster traffic to use a private network interface
masterIn bare metal deployments with dual NICs (e.g.,
eno1for public andeno2for private), OKD may default to using the public interface for the Node'sInternalIP. Because other nodes useInternalIP(not DNS) to resolve peer addresses, cluster traffic may inadvertently traverse the public network.To ensure cluster-internal traffic traverses the private network, you must manually set the Kubelet IP. Refer to the
Nodes with custom IPguide for specific implementation steps.Install OKD SCOS using installer-provisioned resources
masterFor cloud-based installations using installer-provisioned resources, use the
openshift-installbinary.Pull Secret Note: During installation, you may be prompted for a pull-secret. For OKD4, you can either provide the pull-secret used for your registry or use the following dummy JSON to bypass the required value check:
{"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}}Upon successful completion (typically ~30 minutes on AWS), the installer will output the console URL, admin username, and admin password.
$ openshift-install create clusterEnable or Disable Network Interfaces via MachineConfigs
masterIn OKD/FCOS, network interfaces are managed by
NetworkManager. You can enable or disable specific interfaces (such as unused IPMI ports or misconfigured physical adapters that delay startup via DHCP) by deployingMachineConfigobjects.To disable an interface, you must instruct
NetworkManagerto mark it as unmanaged. This is achieved by placing a configuration file in/etc/NetworkManager/conf.d/using aMachineConfigwith anignitionstorage payload.Deployment Timing:
- Running Cluster: Deploy the
MachineConfigdirectly to the cluster. - Cluster Installation (Bare Metal): Include the YAML within the
manifestsfolder after runningopenshift-install create manifestsbut before runningopenshift-install create ignition-configs.
apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: master name: okd-configure-master-disable-XYZ-network-interface spec: config: ignition: version: 3.1.0 storage: files: - contents: source: data:text/plain;charset=utf-8;base64,<YOUR_BASE64_HERE> mode: 420 path: /etc/NetworkManager/conf.d/50-disable-XYZ-interfaces.conf- Running Cluster: Deploy the