Ubuntu 22.04.3 LTS stand-alone privatized deployment sealos desktop

  • It is recommended to use an odd number of Master nodes and several Node nodes.
  • Operating System: Ubuntu 22.04 LTS
  • Kernel version: 5.4 and above
  • Recommended configuration: CPU 4 cores, memory 8GB, storage space above 100GB
  • Minimum configuration: CPU 2 cores, memory 4GB, storage space 60GB

The Ubuntu 22.04.3 LTS version used here, Ubuntu 20.04.4 LTS version should also be available. If you are interested, you can test it.

root@master:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

The size of the partition. After it is built, the disk occupies 51G, so the partition must be large. Here is the capacity increased by expanding lvs.

root@master:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
tmpfs tmpfs 791M 8.2M 783M 2% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4 97G 51G 42G 55% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 ext4 2.0G 251M 1.6G 14% /boot
tmpfs tmpfs 791M 4.0K 791M 1% /run/user/0

The disk capacity is not enough for reference. If the disk capacity is sufficient, please skip this step.

root@master:~# lvs
  LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
  ubuntu-lv ubuntu-vg -wi-ao---- <49.00g
root@master:~# vgs
  VG #PV #LV #SN Attr VSize VFree
  ubuntu-vg 1 1 0 wz--n- <98.00g 49.00g
root@master:~# pvs
  PV VG Fmt Attr PSize PFree
  /dev/sda3 ubuntu-vg lvm2 a-- <98.00g 49.00g
root@master:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.5M 1 loop /snap/core20/2015
loop1 7:1 0 111.9M 1 loop /snap/lxd/24322
loop2 7:2 0 63.4M 1 loop /snap/core20/1974
loop3 7:3 0 53.3M 1 loop /snap/snapd/19457
loop4 7:4 0 40.8M 1 loop /snap/snapd/20092
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 2G 0 part /boot
└─sda3 8:3 0 98G 0 part
  └─ubuntu--vg-ubuntu--lv 253:0 0 49G 0 lvm /var/lib/containers/storage/overlay
                                                    /
sr0 11:0 1 1024M 0 rom
 
root@master:~# lvextend -L + 49G /dev/ubuntu-vg/ubuntu-lv
  Size of logical volume ubuntu-vg/ubuntu-lv changed from <49.00 GiB (12543 extents) to <98.00 GiB (25087 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.
root@master:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
tmpfs tmpfs 791M 3.3M 788M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4 48G 40G 6.4G 86% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 ext4 2.0G 251M 1.6G 14% /boot
tmpfs tmpfs 791M 4.0K 791M 1% /run/user/0
 
 
root@master:~# resize2fs /dev/ubuntu-vg/ubuntu-lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 13
The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 25689088 (4k) blocks long.
 
root@master:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
tmpfs tmpfs 791M 3.3M 788M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4 97G 40G 53G 43% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 ext4 2.0G 251M 1.6G 14% /boot
tmpfs tmpfs 791M 4.0K 791M 1% /run/user/0

First install sealos

apt install jq curl vim -y
curl --silent "https://api.github.com/repos/labring/sealos/releases" | jq -r '.[].tag_name'

echo "deb [trusted=yes] https://apt.fury.io/labring/ /" | sudo tee /etc/apt/sources.list.d/labring.list

sudo apt update & amp; & amp; sudo apt install sealos -y

The following installation steps are based on the article by the author.

Complete Guide to Sealos Privatized Deployment_sealos Deployment_Michelangchiang’s Blog-CSDN Blog

 230 22:39:35 root sealos apply -f Clusterfile
  231 22:41:17 root sh sealos.sh
  232 22:59:47 root kubectl get pods -A
  233 23:00:12 root sealos run docker.io/labring/sealos-cloud:latest --env cloudDomain="10.1.1.138.nip.io"

Cluster

sealos gen labring/kubernetes:v1.25.6 \
    labring/helm:v3.12.0 \
    labring/calico:v3.24.1 \
    labring/cert-manager:v1.8.0 \
    labring/openebs:v3.4.0 \
    --masters 10.1.1.138 > Clusterfile


sealos apply -f Clusterfile

After waiting for the cluster to be ready, use kubectl get pods -A to view the cluster status:

vim sealos.sh

#!/bin/bash
set -e

cat << EOF > ingress-nginx-config.yaml
apiVersion: apps.sealos.io/v1beta1
Kind: Config
metadata:
  creationTimestamp: null
  name: ingress-nginx-config
spec:
  data: |
    controller:
      hostNetwork: true
      kind: DaemonSet
      service:
        type: NodePort
  match: docker.io/labring/ingress-nginx:v1.5.1
  path: charts/ingress-nginx/values.yaml
  strategy: merge
EOF

sealos run docker.io/labring/kubernetes-reflector:v7.0.151\
    docker.io/labring/ingress-nginx:v1.5.1\
    docker.io/labring/zot:v1.4.3\
    docker.io/labring/kubeblocks:v0.5.3\
    --env policy=anonymousPolicy\
    --config-file ingress-nginx-config.yaml

echo "patch ingress-nginx-controller tolerations to allow run on master node, if you don't want to run on master node, please ignore this step"
kubectl -n ingress-nginx patch ds ingress-nginx-controller -p '{"spec":{"template":{"spec":{"tolerations":[{"key":"node-role.kubernetes.io /control-plane","operator":"Exists","effect":"NoSchedule"}]}}}}'

echo "waiting for kubeblocks crd created, this may take a while"
while ! kubectl get clusterdefinitions.apps.kubeblocks.io redis >/dev/null 2> & amp;1; do
  sleep 5
done

echo "start patch redis clusterdefinition"
kubectl patch clusterdefinitions.apps.kubeblocks.io redis --type='json' -p '[{"op": "add", "path": "/spec/componentDefs/0/podSpec/containers/1/resources/ limits", "value": {"cpu":"100m", "memory":"100Mi"}}]'
echo "patch redis success"

echo "wait for all pods to be ready then install Sealos"
kubectl get po -A

sh sealos.sh

sh sealos.sh

The execution takes a long time, please wait patiently.

kubectl get po -A

The process may take a little longer. Wait until all Pods are in the Ready state before proceeding to the next step.

Last command

sealos run docker.io/labring/sealos-cloud:latest --env cloudDomain="10.1.1.138.nip.io"

The process was still very tortuous, but in the end it was successful. In fact, you have to read the article carefully, which can save a lot of time. Alibaba Cloud’s Shadowless Cloud Desktop has a 3-month trial, and it is also possible to use Alibaba Cloud’s Shadowless Cloud Desktop. The test is successful, but there is one thing that is not resolved. After logging in, you can enter the password, but the browser keeps prompting security questions. Ubuntu does not know how to set it up properly.

For the desktop version of Alibaba Cloud Shadowless Cloud, there is no solution to the problem of browser opening.

root@1:~# lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

Please see the solution below for the CHROME settings of windows.

Mongodb requires AVX support. If the CPU does not support AVX, it will fail. J1900 does not support AVX, so please skip this pit.

I would like to thank Mr. BXY very much!

Log viewing reference

kubectl logs sealos-mongodb-mongodb-0 -n sealos

The browser prompts “Not Secure” when accessing the Sealos website
If you provided the correct certificate during deployment and still receive this prompt, you can take the following actions:

Check whether the certificate matches the domain name: the certificate needs to parse {{ $domain }} and *.{{ $domain }};
Check that the certificate is properly base64 encoded and written to the tls-secret.yaml file;
This behavior is normal if you do not provide a certificate during deployment, as Sealos’ self-signed certificate is used by default. You can choose the following two ways to solve it:

Trust the certificate: Export the certificate in the browser, then double-click the certificate to open it and import it into a trusted root certification authority;
Turn off the browser’s security check: Taking Chrome as an example, modify the shortcut of the Chrome browser, add the –ignore-certificate-errors parameter after the target, and then reopen the browser.
What should I do if I am stuck in Waiting waiting for mongodb secret generated during deployment?
Sealos relies on the database service provided by kubeblocks. If you are stuck at this step during the deployment process, it means that an error occurred when deploying Sealos dependent components in the previous step. You should try redeploying.

How to redeploy?
If you need to redeploy, just execute the following command:

$ sealos reset
This command will clean up all cluster resources, allowing you to deploy from scratch.

This article refers to the article by Michelangelo Young, thank you very much!
https://blog.csdn.net/alex_yangchuansheng/article/details/131937199

Finally, enjoy the desktop of sealos

sealos also provides one-click commands. If the above does not succeed, test the following command after sealos reset and follow the prompts.

curl -sfL https://raw.githubusercontent.com/labring/sealos/main/scripts/cloud/install.sh -o /tmp/install.sh & amp; & amp; bash /tmp/install.sh 

admin

sealos2023

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. Cloud native entry-level skills treeHomepageOverview 16567 people are learning the system