Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Better way of handling kubectl port-forward on local environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Feb 26, 2019
1 parent 53fcaaf commit af517d1
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 32 deletions.
17 changes: 1 addition & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,10 @@ and observe what exactly is going on with your services.

## Requirements

* Linux Desktop - like [Ubuntu](https://www.ubuntu.com/download/desktop),
[Fedora](https://getfedora.org/), [Debian](https://www.debian.org/)
* [Docker](https://www.docker.com/)
* [kubectl](https://kubernetes.io/docs/reference/kubectl/)
* Access to OpenStack environment to provision 3 VMs

::: warning
If you have a MacOS, please install
[Byobu](http://byobu.co/),
[Firefox](https://www.mozilla.org/en-US/firefox/),
[Git](https://git-scm.com/),
[jq](https://stedolan.github.io/jq/),
[kubectl](https://kubernetes.io/docs/reference/kubectl/),
[siege](https://www.joedog.org/siege-home/),
[Terraform](https://www.terraform.io/),
[unzip](http://www.info-zip.org/UnZip.html)
yourself and start from [Lab 01 - Create VMs in OpenStack / Provision VMs
in OpenStack](lab-01/README.md#provision-vms-in-openstack).
:::

## Objectives

After you complete this course, you'll be able to:
Expand Down
12 changes: 3 additions & 9 deletions docs/lab-01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ Run Ubuntu docker image and mount the directory there:

```bash
mkdir /tmp/test && cd /tmp/test
docker run -it -rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/mnt ubuntu
docker run -it -rm -v $PWD:/mnt ubuntu
```

Install necessary software into the Docker container:

```bash
apt update -qq
apt-get install -y -qq apt-transport-https byobu curl firefox git gnupg jq openssh-client psmisc siege sudo unzip vim > /dev/null
apt-get install -y -qq apt-transport-https byobu curl git gnupg jq openssh-client psmisc siege sudo unzip vim > /dev/null
```

Run firefox **inside docker** container and reopen this page in it:

```shell
firefox https://ruzickap.github.io/k8s-istio-workshop/lab-01/ &
```

Install `kubernetes-client` package - (`kubectl`):
Install `kubernetes-client` package:

```bash
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
Expand Down
11 changes: 11 additions & 0 deletions docs/lab-02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,16 @@ kube-system pod/kube-proxy-w4tbd 1/1
kube-system pod/kube-scheduler-pruzicka-k8s-istio-workshop-node01 1/1 Running 0 78s 192.168.250.11 pruzicka-k8s-istio-workshop-node01 <none> <none>
```

::: warning
Configure the access to k8s also from your local environment...
:::

Open new terminal on your PC and run:

```shell
export KUBECONFIG=/tmp/test/k8s-istio-workshop/kubeconfig.conf
kubectl get nodes -o wide
```

![Kubernetes](https://upload.wikimedia.org/wikipedia/commons/6/67/Kubernetes_logo.svg
"Kubernetes")
2 changes: 1 addition & 1 deletion docs/lab-03/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Helm Architecture:
"Helm Architecture")
([https://blogs.oracle.com/cloudnative/helm-kubernetes-package-management](https://blogs.oracle.com/cloudnative/helm-kubernetes-package-management))

Install [Helm](https://helm.sh/) binary locally:
Install [Helm](https://helm.sh/) binary:

```bash
curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
Expand Down
6 changes: 5 additions & 1 deletion docs/lab-04/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ kubectl delete pod -n rook-ceph $(kubectl -n rook-ceph get pod -l app=rook-ceph
sleep 5
```

Establish port forwarding:
::: warning
Run the following command on your local environment.
:::

Configure port forwarding to Ceph Dashboard:

```bash
kubectl -n rook-ceph port-forward $(kubectl -n rook-ceph get pod -l app=rook-ceph-mgr -o jsonpath="{.items[0].metadata.name}") 8443:8443 &
Expand Down
14 changes: 11 additions & 3 deletions docs/lab-05/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ helm install --wait stable/fluent-bit --name=fluent-bit --namespace=logging \
--set backend.es.tls_verify=off
```

Configure port forwarding for Kibana:
::: warning
Run the following command on your local environment.
:::

Configure port forwarding to Kibana:

```bash
kubectl -n logging port-forward $(kubectl -n logging get pod -l role=kibana -o jsonpath="{.items[0].metadata.name}") 5601:5601 &
Expand Down Expand Up @@ -126,7 +130,11 @@ logging pod/fluent-bit-fluent-bit-c6tbx 1/1 Running 0 80s
logging pod/fluent-bit-fluent-bit-zfkqr 1/1 Running 0 80s 10.244.2.12 pruzicka-k8s-istio-workshop-node02 <none> <none>
```

Setup the port forwarding to Cerebro:
::: warning
Run the following command on your local environment.
:::

Configure port forwarding to Cerebro:

```bash
kubectl -n logging port-forward $(kubectl -n logging get pod -l role=cerebro -o jsonpath="{.items[0].metadata.name}") 9000:9000 &
Expand All @@ -136,7 +144,7 @@ kubectl -n logging port-forward $(kubectl -n logging get pod -l role=cerebro -o

![Cerebro](./cerebro.png "Cerebro")

Kibana ([https://localhost:5601](https://localhost:5601)):
[Kibana](https://www.elastic.co/products/kibana) ([https://localhost:5601](https://localhost:5601)):

![Kibana](./kibana.png "Kibana")

Expand Down
6 changes: 5 additions & 1 deletion docs/lab-06/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ rook-ceph Active 59m
rook-ceph-system Active 63m
```

Configure port forwarding for Istio services:
::: warning
Run the following command on your local environment.
:::

Configure port forwarding to Istio services:

```bash
# Jaeger - http://localhost:16686
Expand Down
3 changes: 2 additions & 1 deletion docs/lab-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ sed -i "/read NAMESPACE/d" ./samples/bookinfo/platform/kube/cleanup.sh
To remove your VMs from Openstack, please run:

```shell
terraform destroy -auto-approve -var-file=../../terrafrom/openstack/terraform.tfvars ../../terrafrom/openstack
cd ../..
terraform destroy -auto-approve -var-file=terrafrom/openstack/terraform.tfvars terrafrom/openstack
```

![Istio](../.vuepress/public/istio.svg "Istio")

0 comments on commit af517d1

Please sign in to comment.