Skip to content

Commit ae9cee8

Browse files
authored
Merge pull request #54 from jamalshahverdiev/master
Separating setup scripts into install.sh and update README
2 parents 2fe3e3e + a580164 commit ae9cee8

File tree

3 files changed

+248
-330
lines changed

3 files changed

+248
-330
lines changed

README.md

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ The container network range is `170.33.0.0/16` owned by flanneld with `host-gw`
5656

5757
#### Setup
5858

59-
Clone this repo into your local machine and download kubernetes binary release first and move them into the root directory of this repo.
59+
Clone this repo into your local machine and download kubernetes binary release first and move them into the root directory of this repo (GitBash for the Windows must be run as Administrator to install ```vagrant-winnfsd``` plugin).
6060

6161
```bash
62+
vagrant plugin install vagrant-winnfsd
6263
git clone https://github.com/rootsongjc/kubernetes-vagrant-centos-cluster.git
6364
cd kubernetes-vagrant-centos-cluster
6465
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz
@@ -87,36 +88,14 @@ vagrant box add CentOS-7-x86_64-Vagrant-1801_02.VirtualBox.box --name centos/7
8788

8889
The next time you run `vagrant up`, vagrant will import the local box automatically.
8990

90-
**For Windows**
91+
#### Note for Windows
92+
- The project will run some bash script under the VirtualMachines. These scripts line ending need to be in LF. Git for windows set ```core.autocrlf``` true by default at the installation time. When you clone this project repository, this parameter (set to true) ask git to change all line ending to CRLF. This behavior need to be changed before cloning the repository (or after for each files by hand). We recommand to turn this to off by running ```git config --global core.autocrlf false``` and ```git config --global core.eol lf``` before cloning. Then, after cloning, do not forget to turn the behavior back if you want to run other windows projects: ```git config --global core.autocrlf true``` and ```git config --global core.eol crlf```.
9193

92-
While running `vagrant up` in Windows, you will see the following output:
9394

94-
```bash
95-
G:\code\kubernetes-vagrant-centos-cluster>vagrant up
96-
Bringing machine 'node1' up with 'virtualbox' provider...
97-
Bringing machine 'node2' up with 'virtualbox' provider...
98-
Bringing machine 'node3' up with 'virtualbox' provider...
99-
==> node1: Importing base box 'centos/7'...
100-
==> node1: Matching MAC address for NAT networking...
101-
==> node1: Setting the name of the VM: node1
102-
==> node1: Clearing any previously set network interfaces...
103-
==> node1: Specific bridge 'en0: Wi-Fi (AirPort)' not found. You may be asked to specify
104-
==> node1: which network to bridge to.
105-
==> node1: Available bridged network interfaces:
106-
1) Realtek PCIe GBE Family Controller
107-
2) TAP-Windows Adapter V9
108-
==> node1: When choosing an interface, it is usually the one that is
109-
==> node1: being used to connect to the internet.
110-
node1: Which interface should the network bridge to?
111-
node1: Which interface should the network bridge to?
112-
```
113-
114-
Press `1` to continue. (Choose the corresponding network interface for node2 and node3)
115-
116-
You will see these output while node3 is going to be complete:
95+
If you have executed the previous git global configuration then, you will not see these output while node3 is going to be complete:
11796

11897
```bash
119-
node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
98+
node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
12099
node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kube-proxy.service to /usr/lib/systemd/system/kube-proxy.service.
121100
node3: deploy coredns
122101
node3: /tmp/vagrant-shell: ./dns-deploy.sh: /bin/bash^M: bad interpreter: No such file or directory
@@ -145,7 +124,7 @@ There are 3 ways to access the kubernetes cluster.
145124

146125
**local**
147126

148-
In order to manage the cluster on local you should Install `kubectl` command line tool first.
127+
In order to manage the cluster on local you should Install `kubectl` command line tool first(But, you don't need to do it manual because of ```install.sh``` script itself do this)
149128

150129
Go to [Kubernetes release notes](https://kubernetes.io/docs/imported/release/notes/), download the client binaries, unzip it and then move `kubectl` to your `$PATH` folder, for MacOS:
151130

@@ -171,6 +150,7 @@ Login to the virtual machine for dubuging. In most situations, you have no need
171150
vagrant ssh node1
172151
sudo -i
173152
kubectl get nodes
153+
kubectl get pods --namespace=kube-system
174154
```
175155

176156
**Kubernetes dashboard**
@@ -214,7 +194,7 @@ Refresh the browser and click `Advance`, skip it. You will see the dashboard pag
214194
Run this command on your local machine.
215195

216196
```bash
217-
kubectl apply -f addon/heapster/
197+
kubectl apply -f /vagrant/addon/heapster/
218198
```
219199

220200
Append the following item to your local `/etc/hosts` file.
@@ -232,7 +212,7 @@ Open the URL in browser: <http://grafana.jimmysong.io>
232212
Run this command on your local machine.
233213

234214
```bash
235-
kubectl apply -f addon/traefik-ingress
215+
kubectl apply -f /vagrant/addon/traefik-ingress
236216
```
237217

238218
Append the following item to your local file `/etc/hosts`.
@@ -250,7 +230,7 @@ Traefik UI URL: <http://traefik.jimmysong.io>
250230
Run this command on your local machine.
251231

252232
```bash
253-
kubectl apply -f addon/efk/
233+
kubectl apply -f /vagrant/addon/efk/
254234
```
255235

256236
**Note**: Powerful CPU and memory allocation required. At least 4G per virtual machine.
@@ -260,7 +240,7 @@ kubectl apply -f addon/efk/
260240
Run this command on your local machine.
261241

262242
```bash
263-
hack/deploy-helm.sh
243+
/vagrant/hack/deploy-helm.sh
264244
```
265245

266246
### Service Mesh
@@ -274,14 +254,14 @@ Go to [Istio release](https://github.com/istio/istio/releases) to download the b
274254
```bash
275255
wget https://github.com/istio/istio/releases/download/1.0.0/istio-1.0.0-osx.tar.gz
276256
tar xvf istio-1.0.0-osx.tar.gz
277-
mv bin/istioctl /usr/local/bin/
257+
mv istio-1.0.0/bin/istioctl /usr/local/bin/
278258
```
279259

280260
Deploy istio into Kubernetes:
281261

282262
```bash
283-
kubectl apply -f addon/istio/istio-demo.yaml
284-
kubectl apply -f addon/istio/istio-ingress.yaml
263+
kubectl apply -f /vagrant/addon/istio/istio-demo.yaml
264+
kubectl apply -f /vagrant/addon/istio/istio-ingress.yaml
285265
```
286266

287267
**Run sample**
@@ -290,9 +270,9 @@ We will let the sidecars be auto injected.
290270

291271
```bash
292272
kubectl label namespace default istio-injection=enabled
293-
kubectl apply -n default -f yaml/istio-bookinfo/bookinfo.yaml
294-
kubectl apply -n default -f yaml/istio-bookinfo/bookinfo-gateway.yaml
295-
kubectl apply -n default -f yaml/istio-bookinfo/destination-rule-all.yaml
273+
kubectl apply -n default -f /vagrant/yaml/istio-bookinfo/bookinfo.yaml
274+
kubectl apply -n default -f /vagrant/yaml/istio-bookinfo/bookinfo-gateway.yaml
275+
kubectl apply -n default -f /vagrant/yaml/istio-bookinfo/destination-rule-all.yaml
296276
```
297277

298278
Add the following items into the file `/etc/hosts` of your local machine.
@@ -325,7 +305,7 @@ Run the following commands in your local machine.
325305

326306
```bash
327307
# Deploy vistio via kubectl
328-
kubectl -n default apply -f addon/vistio/
308+
kubectl -n default apply -f /vagrant/addon/vistio/
329309

330310
# Expose vistio-api
331311
kubectl -n default port-forward $(kubectl -n default get pod -l app=vistio-api -o jsonpath='{.items[0].metadata.name}') 9091:9091 &
@@ -347,7 +327,7 @@ Kiali is a project to help observability for the Istio service mesh, see [https
347327
Run the following commands in your local machine.
348328

349329
```bash
350-
kubectl apply -n istio-system -f addon/kiali
330+
kubectl apply -n istio-system -f /vagrant/addon/kiali
351331
```
352332

353333
Kiali web: http://172.17.8.101:32439
@@ -365,7 +345,7 @@ User/password: admin/admin
365345
Run the following commands in your local machine.
366346

367347
```bash
368-
kubectl apply -f addon/weave-scope
348+
kubectl apply -f /vagrant/addon/weave-scope
369349
```
370350

371351
Add a record on your local `/etc/hosts`.

0 commit comments

Comments
 (0)