Rancher rakenduse evitamine k8s klastrile

Allikas: Imre kasutab arvutit
Redaktsioon seisuga 19. aprill 2023, kell 22:33 kasutajalt Imre (arutelu | kaastöö) (Imre teisaldas lehekülje Rancher rakenduse evitamine k2s klastrile pealkirja Rancher rakenduse evitamine k8s klastrile alla)
(erin) ←Vanem redaktsioon | Viimane redaktsiooni (erin) | Uuem redaktsioon→ (erin)
Mine navigeerimisribaleMine otsikasti

Sissejuhatus

Käesoleva punkti tegevused toimivad mitte eelmises punktis ettevalmistatud kubernetes node arvutis, aga töökohaarvutis. Rancher rakenduse paigaldamiseks esitatakse väga erinevaid variante, üks neist on paigaldada olemasolevasse tavalisse RKE2 tarkvara kubernetes klastrisse helm abil, https://docs.ranchermanager.rancher.io/getting-started/quick-start-guides/deploy-rancher-manager/helm-cli → 'Install Rancher with Helm'.

Rancher rakenduse paigaldamine

Süsteemile teada olevate helm repode nimekirja küsimine

tookohaarvuti$ helm repo list
Error: no repositories to show

rancher helm repo lisamine

tookohaarvuti$ helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
"rancher-latest" has been added to your repositories
 
tookohaarvuti$ helm repo list
NAME            URL                                             
rancher-latest  https://releases.rancher.com/server-charts/latest

Seejärel moodustatakse namespace rancher rakendusele

tookohaarvuti$ kubectl create namespace cattle-system
namespace/cattle-system created

Seejärel täiendatakse kubernetes api liidest (crd teema)

tookohaarvuti$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.crds.yaml
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created

Lisatakse veel üks help repo, tõenäoliselt cert-manager jaoks

tookohaarvuti$ helm repo add jetstack https://charts.jetstack.io
"jetstack" has been added to your repositories

Uuendatakse helm repod

tookohaarvuti$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "jetstack" chart repository
...Successfully got an update from the "rancher-latest" chart repository
Update Complete. ⎈Happy Helming!⎈

Seejärel paigaldatakse cert-manager tarkvara

tookohaarvuti$ helm install cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --create-namespace \
  --version v1.7.1
 
NAME: cert-manager
LAST DEPLOYED: Sat Nov 26 00:36:24 2022
NAMESPACE: cert-manager
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
cert-manager v1.7.1 has been deployed successfully!
 
In order to begin issuing certificates, you will need to set up a ClusterIssuer
or Issuer resource (for example, by creating a 'letsencrypt-staging' issuer).
 
More information on the different types of issuers and how to configure them
can be found in our documentation:
 
https://cert-manager.io/docs/configuration/
 
For information on how to configure cert-manager to automatically provision
Certificates for Ingress resources, take a look at the `ingress-shim`
documentation:
 
https://cert-manager.io/docs/usage/ingress/

Lõpuks paigaldatakse rancher tarkvara

tookohaarvuti$ helm install rancher rancher-latest/rancher \
  --namespace cattle-system \
  --set hostname=k3s-rnr-tartu.auul.pri.ee \
  --set replicas=1 \
  --set bootstrapPassword=parool
 
NAME: rancher
LAST DEPLOYED: Sat Nov 26 00:40:38 2022
NAMESPACE: cattle-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Rancher Server has been installed.
 
NOTE: Rancher may take several minutes to fully initialize. Please standby while Certificates are being issued, Containers are started and the Ingress rule comes up.
 
Check out our docs at https://rancher.com/docs/
 
If you provided your own bootstrap password during installation, browse to https://k3s-rnr-tartu.auul.pri.ee to get started.
 
If this is the first time you installed Rancher, get started by running this command and clicking the URL it generates:
 
```
echo https://k3s-rnr-tartu.auul.pri.ee/dashboard/?setup=$(kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}')
```
 
To get just the bootstrap password on its own, run:
 
```
kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{.data.bootstrapPassword|base64decode}}{{ "\n" }}'
```
 
 
Happy Containering!

Seejärel tuleb brauseris avada Rancher webgui https://k3s-rnr-tartu.auul.pri.ee/ kus saab sertifikaadi kohta hoiatuse, seda ignoreerida. Logida sisse kirjeldatud parooliga ning kinnnitada, et https://k3s-rnr-tartu.auul.pri.ee/ on teenuse webgui url. Seejärel saab rancherit kasutada tavalisel viisil

TODO

kus

  • Rancher rakenduse enda all töötab kubernetes klaster nimega 'local' ja see on tehtud RKE2 tarkvara abil
  • kasutusel on kolm node'i iga 8 cpu ja 16 GB mäluga
  • paigaldati parasjagu viimane stable versioon rancherist, 2022 sügise lõpus on see v. 2.7
  • kasutusel on kubernetes tarkvara v. 1.24.8

Rancher rakenduse kasutamine

TODO

Kasulikud lisamaterjalid

  • TODO