...
There is a Makefile
on the root directory of this project. In order to deploy you will need to use the following syntax:
export CREDENTIALS=file://$(pwd)/akraino-secrets
export BASE_REPO="git::https://gerrit.akraino.org/r/kni/templates"
export BASE_PATH="aws/3-node"
export SITE_REPO="git::https://gerrit.akraino.org/r/kni/templates"
export SETTINGS_PATH="aws/sample_settings.yaml"
make deploy
...
environment variable | description |
---|---|
BASE_REPO | Repository for the base manifests. This is the repository where the default manifest templates are stored. For Akraino, it's defaulting to git::https://gerrit.akraino.org/r/kni/templates |
BASE_PATH | Inside BASE_REPO, there is one specific folder for each blueprint and provider: aws/1-node, libvirt/1-node, etc... So you need to specify a folder inside BASE_REPO, that will match the type of deployment that you want to execute. |
SITE_REPO | Repository for the site manifests. Each site can have different manifests and settings, this needs to be a per-site repository where individual settings need to be stored, and where the generated manifests per site will be stored. For Akraino, it's defaulting to git::https://gerrit.akraino.org/r/kni/templates |
SETTINGS_PATH | Specific site settings. Once the site repository is being cloned, it needs to contain a settings.yaml file with the per-site settings. This needs to be the path inside the SITE_REPO where the settings.yaml is contained. In Akraino, a sample settings file for AWS and libvirt is provided. You can see it on aws/sample_settings.yaml and libvirt/sample_settings.yaml on the SITE_REPO. You should create your own settings specific for your deployment. |
Settings Specific for AWS DeploymentsHow to deploy for AWS
There are two different footprints for AWS: 1 master/1 worker, and 3 masters/3 workers. Makefile needs to be called with:
make deploy CREDENTIALS=git@github.com:<git_user>/akraino-secrets.git BASE_REPO=git::https://gerrit.akraino.org/r/kni/templates.git BASE_PATH=[aws/1-node | aws/3-node] SITE_REPO=git::https://gerrit.akraino.org/r/kni/templates.git SETTINGS_PATH=aws/sample_settings.yaml
Site Configurations for Deployments to AWS
Deploying to AWS requires a site-config.yaml
file to be created that looks like thisThe settings file will look like:
settings: baseDomain: "devcluster.openshift.com" clusterName: "kni-edge" clusterCIDR: "10.128.0.0/14" clusterSubnetLength: 9 machineCIDR: "10.0.0.0/16" serviceCIDR: "172.30.0.0/16" SDNType: "OpenShiftSDN" AWSRegion: "us-westeast-1"
...
where
variable | description |
---|---|
baseDomain |
...
DNS zone matching with the one created on Route53, e.g. "kni.akraino.org" | |
clusterName |
...
name you are going to give to the cluster, e.g. "site-01" | |
AWSRegion |
...
region where you want your cluster to deploy, e.g. "us-east-1" | |
The other values (clusterCIDR, clusterSubnetLength, machineCIDR, serviceCIDR, SDNType) can be left with the defaults |
...
as above |
Then, when deploying the cluster, apply the settings using:
make deploy SETTINGS_PATH=site-config.yaml BASE_PATH="aws/3-node"
Note: The make process will create the needed artifacts and will start the deployment of the specified cluster. Please consider that, for security reasons. , AWS has disabled the SSH access to nodes.If If you need to SSH for any reason, please take a look at `Unable to SSH into Master Nodes` section from the following document: https://github.com/openshift/installer/blob/master/docs/user/troubleshooting.md
How to deploy for Libvirt
There are two different footprints for libvirt: 1 master/1 worker, and 3 masters/3 workers. Makefile needs to be called with:
make deploy CREDENTIALS=git@github.com:<git_user>/akraino-secrets.git BASE_REPO=git::https://gerrit.akraino.org/r/kni/templates.git BASE_PATH=[libvirt/1-node|libvirt/3-node] SITE_REPO=git::https://gerrit.akraino.org/r/kni/templates.git SETTINGS_PATH=libvirt/sample_settings.yaml INSTALLER_PATH=file:///${GOPATH}/bin/openshift-install
in the upstream troubleshooting documentation.
Site Configurations for Deployments to libvirt
Deploying to libvirt requires a site-config.yaml file to be created that looks like thisA sample settings.yaml file has been created specifically for Libvirt targets. It needs to look like:
settings:
baseDomain: "tt.testing"
clusterName: "test"
clusterCIDR: "10.128.0.0/14"
clusterSubnetLength: 9
machineCIDR: "192.168.126.0/24"
serviceCIDR: "172.30.0.0/16"
SDNType: "OpenShiftSDN"
libvirtURI: "qemu+tcp://192.168.122.1/system"
...
where
variable | description |
---|---|
baseDomain | DNS zone matching with the entry created in /etc/NetworkManager/dnsmasq.d/openshift.conf during the libvirt-howto machine setup. (tt.testing by default) |
clusterName |
...
name you are going to give to the cluster |
...
, e.g. "site-01" | |
libvirtURI | host IP of the prepared virthost, e.g. "qemu+tcp://192.168.122.1/system" |
The other values (clusterCIDR, clusterSubnetLength, machineCIDR, serviceCIDR, SDNType) |
...
can be left with the defaults as above |
Then, when deploying the cluster, apply the settings using:
make deploy SETTINGS_PATH=site-config.yaml BASE_PATH="libvirt/3-node"
...
There is a recording of the deployment of a Libvirt blueprint with to libvirt (1 master and , 1 worker. Please, see the following link to watch it: ) here: https://www.youtube.com/watch?v=3mDb1cba8uU
Temporary workaround
Currently Note: Currently the installer is failing when adding console to the cluster for libvirt. In order to make it work, please follow instructions on https://github.com/openshift/installer/pull/1371.
...
Then cluster can be managed with the kubectl or oc
(drop-in replacement with advanced functionality) CLI tools. To get the oc
client, see "Step 5 - Accessing your new cluster" at https://cloud.openshift.com/clusters/install.
...
Destroying the
...
Cluster
In order to destroy the running cluster and clean up your environment, run
make clean
...
The openshift-installer binaries are published on https://github.com/openshift/installer/releases.
For faster deploy, you can grab the installer from the upper link. However, there may be situations where you need to compile your own installer (such as the case of libvirt), or you need a newer version. You can build the binary following the instructions on https://github.com/openshift/installer, or you can use the provided target from our project.
The binary can be produced with the following command:
make binary
It accepts an additional INSTALLER_GIT_TAG parameter that allows to specify the installer version that you want to build. Once built, the openshift-install is placed in the build directory. This binary can be copied into $GOPATH/bin for easier use. Once generated, the new installer can be used with an env var:
export INSTALLER_PATH=http://<url_to_binary>/openshift-install
Or pass it as a parameter to make command.
Customization
Use your own manifests
openshift-installer is also able to produce manifests, that end users can modify and deploy a cluster with the modified settings. New manifests can be generated with:
/path/to/openshift-install create manifests
This will generate a pair of folders: manifests and openshift.
Those manifests can be modified with the desired values. After that this code can be executed to generate a new cluster based on the modified manifests:
...
Troubleshooting the Cluster
Please see the upstream documentation for details.