# Cheat Sheet

## Get join command

```bash
kubeadm token create --print-join-command
```

## Reset cluster

```bash
kubeadm reset
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
```

## Install kubeadm, kubectl and kubelet

### Setup repository

```bash
apt-get update && apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
```

### Latest

```bash
apt-get update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl
```

### Specific version

```bash
apt-get install \
  kubelet=1.14.2-00 \
  kubeadm=1.14.2-00 \
  kubectl=1.14.2-00 \
  kubernetes-cni=0.7.5-00
apt-mark hold kubelet kubeadm kubectl
```

## Get kubeadm dependencies versions

```bash
kubelet --version
kubeadm version
kubectl version
dpkg --list |grep kubernetes-cni
```

## Network

### Get Pod and Service CIDRs

```bash
kubeadm config view | grep Subnet
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.devops.buzz/public/kubeadm/cheat-sheet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
