|
| 1 | +# Troubleshooting using Kubectl |
| 2 | + |
| 3 | +This document describes how one can use `kubectl` to debug any issues with the cluster. |
| 4 | + |
| 5 | +## Diving into the Components |
| 6 | + |
| 7 | +Using `kubectl`, one can inspect the cluster's current state. When `helmc install workflow-beta4` |
| 8 | +is invoked, Workflow is installed into the `deis` namespace. To inspect if Workflow is running, |
| 9 | +run: |
| 10 | + |
| 11 | + $ kubectl --namespace=deis get pods |
| 12 | + NAME READY STATUS RESTARTS AGE |
| 13 | + deis-builder-gqum7 0/1 ContainerCreating 0 4s |
| 14 | + deis-controller-h6lk6 0/1 ContainerCreating 0 4s |
| 15 | + deis-database-56v39 0/1 ContainerCreating 0 4s |
| 16 | + deis-logger-fluentd-xihr1 0/1 Pending 0 2s |
| 17 | + deis-logger-grupg 0/1 ContainerCreating 0 3s |
| 18 | + deis-minio-c2exb 0/1 Pending 0 3s |
| 19 | + deis-monitor-grafana-9ccur 0/1 Pending 0 3s |
| 20 | + deis-monitor-influxdb-f9ftm 0/1 Pending 0 3s |
| 21 | + deis-monitor-stdout-novxs 0/1 Pending 0 3s |
| 22 | + deis-monitor-telegraf-dc3y3 0/1 Pending 0 2s |
| 23 | + deis-registry-5bor6 0/1 Pending 0 3s |
| 24 | + deis-router-r02sd 0/1 Pending 0 2s |
| 25 | + deis-workflow-manager-hizv6 0/1 Pending 0 2s |
| 26 | + |
| 27 | +!!! tip |
| 28 | + To save precious keystrokes, alias `kubectl --namespace=deis` to `kd` so it is easier to type |
| 29 | + in the future. |
| 30 | + |
| 31 | +To fetch the logs of a specific component, use `kubectl logs`: |
| 32 | + |
| 33 | + $ kubectl --namespace=deis logs deis-controller-h6lk6 |
| 34 | + system information: |
| 35 | + Django Version: 1.9.6 |
| 36 | + Python 3.5.1 |
| 37 | + addgroup: gid '0' in use |
| 38 | + Django checks: |
| 39 | + System check identified no issues (2 silenced). |
| 40 | + [...] |
| 41 | + |
| 42 | +To dive into a running container to inspect its environment, use `kubectl exec`: |
| 43 | + |
| 44 | + $ kubectl --namespace=deis exec -it deis-database-56v39 gosu postgres psql |
| 45 | + psql (9.4.7) |
| 46 | + Type "help" for help. |
| 47 | + |
| 48 | + postgres=# \l |
| 49 | + List of databases |
| 50 | + Name | Owner | Encoding | Collate | Ctype | Access privileges |
| 51 | + ----------------------------------+----------+----------+------------+------------+----------------------- |
| 52 | + V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc | postgres | UTF8 | en_US.utf8 | en_US.utf8 | |
| 53 | + postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | |
| 54 | + template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + |
| 55 | + | | | | | postgres=CTc/postgres |
| 56 | + template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + |
| 57 | + | | | | | postgres=CTc/postgres |
| 58 | + (4 rows) |
| 59 | + postgres=# \connect V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 60 | + You are now connected to database "V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc" as user "postgres". |
| 61 | + V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc=# \dt |
| 62 | + List of relations |
| 63 | + Schema | Name | Type | Owner |
| 64 | + --------+--------------------------------+-------+---------------------------------- |
| 65 | + public | api_app | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 66 | + public | api_build | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 67 | + public | api_certificate | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 68 | + public | api_config | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 69 | + public | api_domain | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 70 | + public | api_key | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 71 | + public | api_push | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 72 | + public | api_release | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 73 | + public | auth_group | table | V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc |
| 74 | + --More-- |
| 75 | + V7wckOHIAn3MZ7mO5du4q5IRq7yib1Oc=# SELECT COUNT(*) from api_app; |
| 76 | + count |
| 77 | + ------- |
| 78 | + 0 |
| 79 | + (1 row) |
0 commit comments