Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DevOps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CLEMENTE Damien
DevOps
Commits
8f932c97
Commit
8f932c97
authored
3 months ago
by
CLEMENTE Damien
Browse files
Options
Downloads
Patches
Plain Diff
Update file kubernetes_installation.md
parent
036b1333
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
kubernetes_installation.md
+58
-8
58 additions, 8 deletions
kubernetes_installation.md
with
58 additions
and
8 deletions
kubernetes_installation.md
+
58
−
8
View file @
8f932c97
...
@@ -46,6 +46,7 @@ Vérification :
...
@@ -46,6 +46,7 @@ Vérification :
```
bash
```
bash
free
-h
free
-h
```
```
verifier si la colonne echange est bien a 0.
## 4. Configuration Système pour Kubernetes
## 4. Configuration Système pour Kubernetes
...
@@ -59,6 +60,7 @@ EOF
...
@@ -59,6 +60,7 @@ EOF
modprobe overlay
modprobe overlay
modprobe br_netfilter
modprobe br_netfilter
echo
-e
overlay
\\
nbr_netfilter
>
/etc/modules-load.d/k8s.conf
cat
<<
EOF
| tee /etc/sysctl.d/99-kubernetes-k8s.conf
cat
<<
EOF
| tee /etc/sysctl.d/99-kubernetes-k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-iptables = 1
...
@@ -68,12 +70,39 @@ EOF
...
@@ -68,12 +70,39 @@ EOF
sysctl
--system
sysctl
--system
```
```
Cela va permettre de charger les modules necessaires au fonctionnement de kubernetes
## 5. Installation de Containerd
## 5. Installation de Containerd
```
bash
```
bash
apt
-y
install
containerd
apt
-y
install
containerd
iptables apt-transport-https gnupg2 curl
sudo
containerd config default |
tee
/etc/containerd/config.toml
>
/dev/null 2>&1
containerd config default |
tee
/etc/containerd/config.toml
>
/dev/null 2>&1
nano /etc/containerd/config.toml
```
Il faut par la suite modifier le fichier a la ligne 61 :
```
bash
sandbox_image
=
"registry.k8s.io/pause:3.9"
```
et ligne 125 :
```
bash
SystemdCgroup
=
true
```
Puis redemarrer le service :
```
bash
systemctl restart containerd.service
```
## 6. passer sur iptables legacy
-
Il faut passer sur la regle iptables-legacy :
```
bash
Selection Path Priority Status
------------------------------------------------------------
*
0 /usr/sbin/iptables-nft 20 auto mode
1 /usr/sbin/iptables-legacy 10 manual mode
2 /usr/sbin/iptables-nft 20 manual mode
```
```
## 6. Installation de Kubernetes (Kubeadm, Kubelet, Kubectl)
## 6. Installation de Kubernetes (Kubeadm, Kubelet, Kubectl)
...
@@ -88,7 +117,7 @@ ln -s /opt/cni/bin /usr/lib/cni
...
@@ -88,7 +117,7 @@ ln -s /opt/cni/bin /usr/lib/cni
## 7. Initialisation du Cluster Kubernetes
## 7. Initialisation du Cluster Kubernetes
Sur
**le master (kube01)**
:
Sur
**le master (kube01)
UNIQUEMENT
**
:
```
bash
```
bash
kubeadm init
--control-plane-endpoint
=
192.168.10.10
--pod-network-cidr
=
10.244.0.0/16
kubeadm init
--control-plane-endpoint
=
192.168.10.10
--pod-network-cidr
=
10.244.0.0/16
...
@@ -96,18 +125,39 @@ kubeadm init --control-plane-endpoint=192.168.10.10 --pod-network-cidr=10.244.0.
...
@@ -96,18 +125,39 @@ kubeadm init --control-plane-endpoint=192.168.10.10 --pod-network-cidr=10.244.0.
Post-initialisation :
Post-initialisation :
-
Apres l'initiation du master, nous avons ce message qu'il faut conserver :
```
bash
```
bash
Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir
-p
$HOME
/.kube
mkdir
-p
$HOME
/.kube
cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
sudo cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
sudo chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
```
Si root
:
Alternatively,
if
you are the root user, you can run
:
```
bash
export
KUBECONFIG
=
/etc/kubernetes/admin.conf
export
KUBECONFIG
=
/etc/kubernetes/admin.conf
You should now deploy a pod network to the cluster.
Run
"kubectl apply -f [podnetwork].yaml"
with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
Then you can
join
any number of worker nodes by running the following on each as root:
kubeadm
join
192.168.10.10:6443
--token
9yu8eq.hluhrzkufar4s07z
\
--discovery-token-ca-cert-hash
sha256:21820cff2482dda0ce25e234f5fc2e6a5d2676bd14ca08cf1c457eba2a3583b2
```
```
Mise en place des droits du cluster pour l'admin :
```
bash
mkdir
-p
$HOME
/.kube
cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
```
## 8. Ajout des Workers
## 8. Ajout des Workers
Sur
**chaque worker**
:
Sur
**chaque worker**
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment