7 minute read
There are three options to setup a development environment:
The focus of this article is to provide all necessary information to install it in a compressed tutorial. There are footnotes providing additional information on certain steps, that might be new to certain user groups.
Note: this content is also available in a presence workshop with an experienced facilitator guiding the participants through the installation and answering questions. Contact us for more information!
This installation method requires some previous settings:
As shown, the Factorycube is an optional device that combines all the required hardware in a rugged industrial gateway for industrial use.
This step is also available via a step-by-step video: TODO
https://www.umh.app/development.yaml
. If you are paranoid or want to setup devices for production you could copy the file, modify and host it yourself. Here is the templateThis process takes around 15 - 20 minutes depending on your internet connection and there will be no further information about the installation status on the output of the device visible (the information on the computer screen).
To verify whether the installation worked and to access Grafana (the dashboard) and Node-RED, we will first enable SSH via password authentification, fetch the login details for Kubernetes and then login via Lens.
The login console will look like “messed up” due to the logs of the installation process in the steps above.
Immediatly after start. Nothing is messed up yet.
"Messed up" login screen
You can “clean it up” by pressing two times enter.
You can also immediatly proceed with entering the default username rancher
(do not forget to press enter) and the default password rancher
to login.
Logging into k3OS using the username `rancher`
Logging into k3OS using the password `rancher`
After a successfull login you should see the current IP address of the device on your computer screen.
Successfully logged into k3OS
Enable SSH password authentification in k3OS 6. This is currently not necessary anymore as the automated setup script will do that automatically, therefore this step can be skipped. This paragraph only exists to remind you that this setting is not the default behavior of k3OS and should be deactivated in production environments.
For production environments we recommend using a certificate to authenticate, which is enabled by default. This can be archieved by modifying the cloud-init file and linking to a public key stored on your GitHub account.
Connect via SSH 3 from your laptop with the edge device. The IP address is shown on the computer screen on your edge device (see also step 1). If it is not available anymore, you can view the current IP address using ip addr
or ifconfig eth0
(works with out devices).
Username: rancher
Password: rancher
/tools
you can find a bash script that will do this step automatically for youExecute cat /etc/rancher/k3s/k3s.yaml
in your SSH session on your laptop to retrieve the Kubernetes credentials. Copy the content of the result into your clipboard.
Execute `cat /etc/rancher/k3s/k3s.yaml`
Copy the content
Connect with the edge device using the software Lens and the Kubernetes credentials from your clipboard.
Add a new cluster in Lens
Select `Paste as text`
Paste from the clipboard
Ensure that you have adjusted the IP in the Kubernetes credentials with the IP of the edge device.
Also make sure that you simply adjust the IP in between. The port that follows the :
should remain untouched (e.g. https://XXX.X.X.X:6443 in that case).
Hint: If you get the message ‘certificate not valid’ or something similar when connecting, verify that you entered the correct port before proceeding to the troubleshooting section (/docs/tutorials/k3os/how-to-fix-invalid-certs-due-to-misconfigured-date/).
You have now access to the Kubernetes cluster!
The installation is finished when all Pods are “Running”. You can do that by clicking on Pods on the left side.
Click in Lens on Workloads and then on Pods
Select the relevant namespaces `factorycube-server` and `factorycube-edge`
everything should be running
Some credentials are automatically generated by the system. One of them are the login credentials of Grafana. You can retrieve them by clicking on “Secrets” on the left side in Lens. Then search for a secret called “grafana-secret” and open it. Press “decode” and copy the password into your clipboard.
Press on the left side in Lens on Configuration and then Secret.
Then select grafana-secret
Then click on the eye on the right side of adminpassword to decrypt it
Grafana is now accessible by opening the following URL in your browser: http://<IP>:8080
(e.g., http://192.168.1.2:8080
). You can login by using the username admin
and password from your clipboard.
Node-RED is accessible by opening the following URL in your browser: http://<IP>:1880/nodered
.
Once you have access, you can proceed with the second article Connecting machines and creating dashboards.
This option is only recommended for developers. Therefore, the installation is targeted for them and might not be as detailed as option 1.
git clone https://github.com/united-manufacturing-hub/united-manufacturing-hub.git
or downloaded and extracted using the download button on GitHub.minikube start
. If minikube fails to start, see the drivers page for help setting up a compatible container or virtual-machine manager.Output of the command `minikube start`
kubectl version
should look like in the screenshot.Expected output of `kubectl version`
deployment/united-manufacturing-hub
kubectl create namespace united-manufacturing-hub
Expected output of `kubectl create namespace`
Output of curl
helm install united-manufacturing-hub . -n united-manufacturing-hub
Output of `helm install`
Now go grab a coffee and wait 15-20 minutes until all pods are “Running”.
Now you should be able to see the cluster using Lens
For a manual installation, we recommend that you take a look at the installation script and follow these commands manually and adjust them when needed.
See also out guide: What is semantic versioning ↩︎
See also out guide: How to flash an operating system on a USB-stick ↩︎
See also out guide: How to connect via SSH ↩︎
See also out guide: How to setup a development network ↩︎
See also out guide: How to boot from a USB-stick ↩︎
See also out guide: Enabling k3os password authentication ↩︎
Can be installed using the following command: export VERIFY_CHECKSUM=false && curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh
↩︎
Can be installed on Ubuntu using the following command: sudo apt-get install kubectl
↩︎