-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.k8s
67 lines (44 loc) · 2.15 KB
/
README.k8s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
**************
MINIKUBE NOTES
**************
* MACOS *
*****
Change versions to your preference.
* INSTALL
rm -f ~/.minikube
brew install hyperkit docker-machine-driver-hyperkit
sudo chown root:wheel /usr/local/bin/docker-machine-driver-hyperkit
sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit
* UPGRADE
## Note: Docker Desktop includes hyperkit so upgrade Docker Desktop instead. ##
brew upgrade hyperkit && brew link --overwrite hyperkit
curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/v1.11.0/minikube-darwin-amd64
chown +x minikube && sudo mv minikube /usr/local/bin/
* RUN
minikube delete
minikube config set vm-driver hyperkit && minikube start --cpus 4 --memory 6144 --feature-gates="AllAlpha=true,BoundServiceAccountTokenVolume=false" --extra-config=apiserver.service-node-port-range=1-65535 --network-plugin=cni --extra-config=kubelet.network-plugin=cni --kubernetes-version=v1.18.3
minikube addons enable ingress
* LINUX *
*******
minikube start --cpus 4 --memory 6144 --feature-gates="AllAlpha=true,BoundServiceAccountTokenVolume=false" --extra-config=apiserver.service-node-port-range=1-65535 --network-plugin=cni --extra-config=kubelet.network-plugin=cni --kubernetes-version=v1.18.3
************************
KUBERNETES STATEFULSETS
************************
* WP/MYSQL *
kubectl apply -f mysql-wordpress-set.yaml
kubectl get pods; kubectl logs -l app=mysql,wordpress # todo: check syntax for multiples?
kubectl delete -f mysql-wordpress-set.yaml
* REDIS *
kubectl apply -f redis-set.yaml
kubectl get pods; kubectl logs -l app=redis
kubectl delete -f redis-set.yaml
* MONGODB Replicaset (without sidecar) *
kubectl apply -f mongo-set.yaml
kubectl get pods; kubectl logs -l app=mongo
MONG=$(kubectl cluster-info |awk -F: '{print $2}' |sed -e s@/@@g |head -1)
mongo --host $MONG:27017 -u myroot -p myroot
kubectl delete -f mongo-set.yaml
TROUBLESHOOTING
***************
* Cleanup PV/PVC's stuck terminating *
kubectl delete pvc --all --force --grace-period=0; kubectl delete pv --all --force --grace-period=0; kubectl get all