This technical documentation presents the guidelines (e.g server installation instructions, configuration of system elements) allowing preparation, configuration and maintenant in operational state of the primary development server.
The DEV cluster is dedicated to run of a version of CYBNITY software components which is not already released (e.g staging version, feature branch version).
The services provided by the CYBDEV01 server are focus on:
Current hardware configuration is based on a Hewlett-Packard Z640 server:
See Ubuntu-installation procedure to prepare a server into a “ready for virtualization installation” state.
Current prepared server configuration is:
RKE2 virtualization system is implemented as Kubernetes layer hosting the CYBNTY staging versions deployed into a Dev cluster.
sudo snap install helm --classic
mkdir /opt/rke2
export INSTALL_RKE2_METHOD="tar"
export INSTALL_RKE2_CHANNEL="stable"
export INSTALL_RKE2_TYPE="server"
export INSTALL_RKE2_TAR_PREFIX="/opt/rke2"
curl -sfL https://get.rke2.io | sh -
Add permanent path to rke2 binary (/opt/rke2/bin) and add it to PATH into file /etc/environment
sudo systemctl enable rke2-server.service
sudo systemctl start rke2-server.service
sudo ln -s /var/lib/rancher/rke2/bin/kubectl /usr/local/bin/kubectl
sudo ln -s /var/lib/rancher/rke2/bin/kubelet /usr/local/bin/kubelet
sudo ln -s /var/lib/rancher/rke2/bin/crictl /usr/local/bin/crictl
sudo ln -s /var/lib/rancher/rke2/bin/ctr /usr/local/bin/ctr
mkdir -p ~/.kube
sudo ln -s /etc/rancher/rke2/rke2.yaml ~/.kube/config
kubectl get nodes -o wide
Copy KUBECONFIG for cluster access (https://docs.rke2.io/cluster_access documentation)
create conig.yaml (https://docs.rke2.io/install/configuration)
sudo cp -f /usr/local/share/rke2/rke2-cis-sysctl.conf /etc/sysctl.d/60-rke2-cis.conf
sudo systemctl restart systemd-sysctl
/etc/rancher/rke2/config.yaml:
# Database configuration
# active snapshots
etcd-disable-snapshots: false
# snapshot interval time every 5 hours
etcd-snapshot-schedule-cron: "0*/5 * * *"
etcd-snapshot-retention: 3
systemctl start rke2-serverjournalctl -u rke2-server.service
## Kubernetes resources
### Base data storage resource (Persistent Volume)
- Create a sub-directory of `/srv` dedicated to the Kubernetes resources (e.g Persistent Volumes) via commands:
mkdir /srv/k8s mkdir /srv/k8s/data
- __From root $HOME directory__, create a symbolic link simplying the identification of K8S data storage base path via command:
# Allow direct access to RKE2 dedicated disk area reserved for K8S data (e.g under data folder, for PersistentVolumes creation) sudo ln -s /srv/k8s/data .kube/data
- Create new PV resource file (automatic applied resource during RKE2 start) regarding base persistent volume via command:
`vi /var/lib/rancher/rke2/server/manifests/rke2-base-pv.yaml`
- file containing (see for help [best practices for PV](https://www.loft.sh/blog/kubernetes-persistent-volumes-examples-and-best-practices)) according to storage capacity available:
apiVersion: v1 kind: PersistentVolume metadata: name: base-pv spec: capacity: storage: 50Gi volumeMode: Filesystem accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: “/srv/k8s/data”
- Check the automatically created resource via command: `kubectl get pv`
# INFRASTRUCTURE SERVICES
## Storage
### Longhorn
Distributed block storage system deployed for containers data management.
## Monitoring & Logging
## Networking
### Container Network Interface (CNI)
Canal solution is deployed as CNI plugin.
## Security
## Server auto-stop
Add a crontab directive to stop the server in a safe way (with wait of existing process secure end before make the stop) with power off:
- open and add command into crontab via command: `sudo crontab -e`
- add line in file and save as:
30 20 * * * shutdown -P
- check crontab pla via command: `sudo crontab -l`
# APPLICATION SERVICES
## CYBNITY software repository
- Add complementary helm charts (e.g allowing deployment of CYBNITY applications) to node repository list via commands:
helm repo add cybnity https://cybnity.github.io/iac-helm-charts ```