crc-org / snc

Single Node Cluster creation scripts for OpenShift 4.x as used by CodeReady Containers
https://crc.dev
Apache License 2.0
103 stars 50 forks source link
codeready openshift openshift-cluster openshift-deployment podman single-node-cluster snc

Single node cluster (snc) scripts for OpenShift 4

NOTE: Please select the respective branch to create a bundle for a specific OpenShift release (ie. to create a 4.15.x OpenShift bundle, choose the release-4.15 branch)

How to use?

How to create disk image?

Monitoring

The installation is a long process. It can take up to 45 mins. You can monitor the progress of the installation with kubectl.

$ export KUBECONFIG=<directory_to_cloned_repo>/crc-tmp-install-data/auth/kubeconfig
$ kubectl get pods --all-namespaces

Building SNC for OKD 4

# Create a pull secret file

cat << EOF > /tmp/pull_secret.json
{"auths":{"fake":{"auth": "Zm9vOmJhcgo="}}}
EOF

# Set environment for OKD build
export OKD_VERSION=4.5.0-0.okd-2020-08-12-020541
export OPENSHIFT_PULL_SECRET_PATH="/tmp/pull_secret.json"

# Build the Single Node cluster
./snc.sh
export BUNDLED_PULL_SECRET_PATH="/tmp/pull_secret.json"
./createdisk.sh crc-tmp-install-data

Creating container image for bundles

After running snc.sh/createdisk.sh, the generated bundles can be uploaded to a container registry using this command:

./gen-bundle-image.sh <version> <openshift/okd/podman>

Note: a GPG key is needed to sign the bundles before they are wrapped in a container image.

Troubleshooting

OpenShift installer will create 1 VM. It is sometimes useful to ssh inside the VM. Add the following lines in your ~/.ssh/config file. You can then do ssh master.

Host master
    Hostname 192.168.126.11
    User core
    IdentityFile <directory_to_cloned_repo>/id_ecdsa_crc
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null

Environment Variables

The following environment variables can be used to change the default values of bundle generation.

SNC_GENERATE_MACOS_BUNDLE : if set to 0, bundle generation for MacOS is disabled, any other value will enable it. SNC_GENERATE_WINDOWS_BUNDLE : if set to 0, bundle generation for Windows is disabled, any other value will enable it. SNC_GENERATE_LINUX_BUNDLE : if set to 0, bundle generation for Linux is disabled, any other value will enable it.

Please note the SNC project is “as-is” on this Github repository. At this time, it is not an offically supported Red Hat solution.