Fix gdb issue and update e2e image
This commit is contained in:
parent
4019357f2e
commit
fdc9ab2158
3 changed files with 84 additions and 80 deletions
|
@ -40,7 +40,7 @@ if [ "$missing" = true ];then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v08252018-3c507e98c
|
E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v08292018-7740d78
|
||||||
|
|
||||||
DOCKER_OPTS=${DOCKER_OPTS:-""}
|
DOCKER_OPTS=${DOCKER_OPTS:-""}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@ There are many ways to troubleshoot the ingress-controller. The following are ba
|
||||||
methods to obtain more information.
|
methods to obtain more information.
|
||||||
|
|
||||||
Check the Ingress Resource Events
|
Check the Ingress Resource Events
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ kubectl get ing -n <namespace-of-ingress-resource>
|
$ kubectl get ing -n <namespace-of-ingress-resource>
|
||||||
NAME HOSTS ADDRESS PORTS AGE
|
NAME HOSTS ADDRESS PORTS AGE
|
||||||
cafe-ingress cafe.com 10.0.2.15 80 25s
|
cafe-ingress cafe.com 10.0.2.15 80 25s
|
||||||
|
@ -41,7 +42,8 @@ Events:
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the Ingress Controller Logs
|
Check the Ingress Controller Logs
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ kubectl get pods -n <namespace-of-ingress-controller>
|
$ kubectl get pods -n <namespace-of-ingress-controller>
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m
|
nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m
|
||||||
|
@ -57,7 +59,8 @@ NGINX Ingress controller
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the Nginx Configuration
|
Check the Nginx Configuration
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ kubectl get pods -n <namespace-of-ingress-controller>
|
$ kubectl get pods -n <namespace-of-ingress-controller>
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m
|
nginx-ingress-controller-67956bf89d-fv58j 1/1 Running 0 1m
|
||||||
|
@ -78,7 +81,8 @@ http {
|
||||||
```
|
```
|
||||||
|
|
||||||
Check if used Services Exist
|
Check if used Services Exist
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ kubectl get svc --all-namespaces
|
$ kubectl get svc --all-namespaces
|
||||||
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||||
default coffee-svc ClusterIP 10.106.154.35 <none> 80/TCP 18m
|
default coffee-svc ClusterIP 10.106.154.35 <none> 80/TCP 18m
|
||||||
|
@ -94,7 +98,7 @@ kube-system kubernetes-dashboard NodePort 10.103.128.17 <none>
|
||||||
Using the flag `--v=XX` it is possible to increase the level of logging. This is performed by editing
|
Using the flag `--v=XX` it is possible to increase the level of logging. This is performed by editing
|
||||||
the deployment.
|
the deployment.
|
||||||
|
|
||||||
```
|
```console
|
||||||
$ kubectl get deploy -n <namespace-of-ingress-controller>
|
$ kubectl get deploy -n <namespace-of-ingress-controller>
|
||||||
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
|
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
|
||||||
default-http-backend 1 1 1 1 35m
|
default-http-backend 1 1 1 1 35m
|
||||||
|
@ -122,10 +126,9 @@ Both authentications must work:
|
||||||
+ apiserver +<-------------------+ ingress |
|
+ apiserver +<-------------------+ ingress |
|
||||||
| | | controller |
|
| | | controller |
|
||||||
+-------------+ +------------+
|
+-------------+ +------------+
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
__Service authentication__
|
**Service authentication**
|
||||||
|
|
||||||
The Ingress controller needs information from apiserver. Therefore, authentication is required, which can be achieved in two different ways:
|
The Ingress controller needs information from apiserver. Therefore, authentication is required, which can be achieved in two different ways:
|
||||||
|
|
||||||
|
@ -139,8 +142,8 @@ Please do not use this approach in production.
|
||||||
|
|
||||||
In the diagram below you can see the full authentication flow with all options, starting with the browser
|
In the diagram below you can see the full authentication flow with all options, starting with the browser
|
||||||
on the lower left hand side.
|
on the lower left hand side.
|
||||||
```
|
|
||||||
|
|
||||||
|
```
|
||||||
Kubernetes Workstation
|
Kubernetes Workstation
|
||||||
+---------------------------------------------------+ +------------------+
|
+---------------------------------------------------+ +------------------+
|
||||||
| | | |
|
| | | |
|
||||||
|
@ -168,7 +171,7 @@ token that is required to authenticate with the API server.
|
||||||
|
|
||||||
Verify with the following commands:
|
Verify with the following commands:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
# start a container that contains curl
|
# start a container that contains curl
|
||||||
$ kubectl run test --image=tutum/curl -- sleep 10000
|
$ kubectl run test --image=tutum/curl -- sleep 10000
|
||||||
|
|
||||||
|
@ -248,8 +251,8 @@ If you are configuring the API server by hand, you can set this with the `--admi
|
||||||
|
|
||||||
More information:
|
More information:
|
||||||
|
|
||||||
* [User Guide: Service Accounts](http://kubernetes.io/docs/user-guide/service-accounts/)
|
- [User Guide: Service Accounts](http://kubernetes.io/docs/user-guide/service-accounts/)
|
||||||
* [Cluster Administrator Guide: Managing Service Accounts](http://kubernetes.io/docs/admin/service-accounts-admin/)
|
- [Cluster Administrator Guide: Managing Service Accounts](http://kubernetes.io/docs/admin/service-accounts-admin/)
|
||||||
|
|
||||||
## Kube-Config
|
## Kube-Config
|
||||||
|
|
||||||
|
@ -261,38 +264,37 @@ add the flag `--kubeconfig=/etc/kubernetes/kubeconfig.yaml` to the args section
|
||||||
[Gdb](https://www.gnu.org/software/gdb/) can be used to with nginx to perform a configuration
|
[Gdb](https://www.gnu.org/software/gdb/) can be used to with nginx to perform a configuration
|
||||||
dump. This allows us to see which configuration is being used, as well as older configurations.
|
dump. This allows us to see which configuration is being used, as well as older configurations.
|
||||||
|
|
||||||
Before starting make sure that nginx is running with the `--with-debug`. See the `Debug Logging` section seen above.
|
|
||||||
Note: The below is based on the nginx [documentation](https://docs.nginx.com/nginx/admin-guide/monitoring/debugging/#dumping-nginx-configuration-from-a-running-process).
|
Note: The below is based on the nginx [documentation](https://docs.nginx.com/nginx/admin-guide/monitoring/debugging/#dumping-nginx-configuration-from-a-running-process).
|
||||||
|
|
||||||
1. SSH into the worker
|
1. SSH into the worker
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ ssh user@workerIP
|
$ ssh user@workerIP
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Obtain the Docker Container Running nginx
|
2. Obtain the Docker Container Running nginx
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ docker ps | grep nginx-ingress-controller
|
$ docker ps | grep nginx-ingress-controller
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||||
d9e1d243156a quay.io/kubernetes-ingress-controller/nginx-ingress-controller "/usr/bin/dumb-init …" 19 minutes ago Up 19 minutes k8s_nginx-ingress-controller_nginx-ingress-controller-67956bf89d-mqxzt_kube-system_079f31ec-aa37-11e8-ad39-080027a227db_0
|
d9e1d243156a quay.io/kubernetes-ingress-controller/nginx-ingress-controller "/usr/bin/dumb-init …" 19 minutes ago Up 19 minutes k8s_nginx-ingress-controller_nginx-ingress-controller-67956bf89d-mqxzt_kube-system_079f31ec-aa37-11e8-ad39-080027a227db_0
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Exec into the container
|
3. Exec into the container
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ docker exec -it --user=0 --privileged d9e1d243156a bash
|
$ docker exec -it --user=0 --privileged d9e1d243156a bash
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Make sure nginx is running in `--with-debug`
|
4. Make sure nginx is running in `--with-debug`
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ nginx -V 2>&1 | grep -- '--with-debug'
|
$ nginx -V 2>&1 | grep -- '--with-debug'
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Install gdb
|
5. Get list of processes running on container
|
||||||
```
|
|
||||||
$ apt-get update; apt-get install gdb -y
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Get list of processes running on container
|
```console
|
||||||
```
|
|
||||||
$ ps -ef
|
$ ps -ef
|
||||||
UID PID PPID C STIME TTY TIME CMD
|
UID PID PPID C STIME TTY TIME CMD
|
||||||
root 1 0 0 20:23 ? 00:00:00 /usr/bin/dumb-init /nginx-ingres
|
root 1 0 0 20:23 ? 00:00:00 /usr/bin/dumb-init /nginx-ingres
|
||||||
|
@ -304,7 +306,8 @@ Note: The below is based on the nginx [documentation](https://docs.nginx.com/ngi
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Attach gdb to the nginx master process
|
7. Attach gdb to the nginx master process
|
||||||
```
|
|
||||||
|
```console
|
||||||
$ gdb -p 21
|
$ gdb -p 21
|
||||||
....
|
....
|
||||||
Attaching to process 21
|
Attaching to process 21
|
||||||
|
@ -314,7 +317,8 @@ Note: The below is based on the nginx [documentation](https://docs.nginx.com/ngi
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Copy and paste the following:
|
8. Copy and paste the following:
|
||||||
```
|
|
||||||
|
```console
|
||||||
set $cd = ngx_cycle->config_dump
|
set $cd = ngx_cycle->config_dump
|
||||||
set $nelts = $cd.nelts
|
set $nelts = $cd.nelts
|
||||||
set $elts = (ngx_conf_dump_t*)($cd.elts)
|
set $elts = (ngx_conf_dump_t*)($cd.elts)
|
||||||
|
@ -329,6 +333,7 @@ Note: The below is based on the nginx [documentation](https://docs.nginx.com/ngi
|
||||||
9. Quit GDB by pressing CTRL+D
|
9. Quit GDB by pressing CTRL+D
|
||||||
|
|
||||||
10. Open nginx_conf.txt
|
10. Open nginx_conf.txt
|
||||||
```
|
|
||||||
|
```console
|
||||||
cat nginx_conf.txt
|
cat nginx_conf.txt
|
||||||
```
|
```
|
|
@ -541,7 +541,6 @@ apt-get remove -y --purge \
|
||||||
protobuf-compiler \
|
protobuf-compiler \
|
||||||
python \
|
python \
|
||||||
xz-utils \
|
xz-utils \
|
||||||
libpython3.6-stdlib \
|
|
||||||
git g++ pkgconf flex bison doxygen libyajl-dev liblmdb-dev libgeoip-dev libtool dh-autoreconf libpcre++-dev libxml2-dev
|
git g++ pkgconf flex bison doxygen libyajl-dev liblmdb-dev libgeoip-dev libtool dh-autoreconf libpcre++-dev libxml2-dev
|
||||||
|
|
||||||
apt-get autoremove -y
|
apt-get autoremove -y
|
||||||
|
|
Loading…
Reference in a new issue