---
# System prepended metadata

title: Kubernetes tips and tricks

---

# Kubernetes tips and tricks

## deploy a cluster:
Follow this tutorial: https://github.com/justmeandopensource/kubernetes/blob/master/docs/install-cluster-ubuntu-20.md

```==bash
kubeadm init --apiserver-advertise-address=172.16.16.100 --pod-network-cidr=192.168.0.0/16  --ignore-preflight-errors=all
....

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
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

```

```===bash
master@k8s-master:~$ kubeadm token create --print-join-command
W0923 14:35:45.200184  941367 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
kubeadm join 172.27.2.51:6443 --token hq3mwb.4z2r6vp7wmtvvnqs     --discovery-token-ca-cert-hash sha256:cec2adf56bd34a2992a71371ec334328986a69f26cde6e87399864bfd0cdacc3
```

## Deploy NearRT_RIC:

## Expose management to web browser:


## Issues:

### Connection kubectl refuse:
```===bash
root@k8s-master:/home/master# kubectl get pods -A
The connection to the server localhost:8080 was refused - did you specify the right host or port?
root@k8s-master:/home/master#

```

## Assign external IP:
```
kubectl patch svc service-ricplt-e2term-sctp-alpha -n ricplt -p '{"spec":{"externalIPs":["10.5.0.3"]}}'
```