Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise log level instructions for kapp and kubectl in docs #1904

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 125 additions & 54 deletions site/content/docs/howto/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,60 +33,131 @@ Choose an update method that corresponds with the original installation method y
[Install Supervisor]({{< ref "../howto/install-supervisor" >}}) or [Install Concierge]({{< ref "../howto/install-concierge" >}})
for more information.

### Using kapp

To adjust the log level of the Pinniped Supervisor or Concierge using `kapp`, edit the `log_level` in the `values.yaml` files
in your local copy of the Pinniped GitHub repository. Open either `deploy/supervisor/values.yaml` or `deploy/concierge/values.yaml`
and edit the following line:

```yaml
log_level: "info|debug|trace|all"
```
Then apply your configuration via `kapp deploy -f`.

### Using kubectl

To adjust the log level of the Pinniped Supervisor or Concierge using `kubectl`, find the configmap on your cluster within
the namespace of each deployment:

```bash
# get the concierge config
kubectl get cm pinniped-concierge-config --namespace concierge --output yaml > cm.concierge.yaml
# get the supervisor config
kubectl get cm pinniped-supervisor-static-config --namespace supervisor --output yaml > cm.supervisor.yaml
```

Edit the yaml files:

```yaml
# pinniped supervisor config
kind: ConfigMap
apiVersion: v1
metadata:
name: pinniped-supervisor-static-config
namespace: supervisor
data:
pinniped.yaml: |
apiGroupSuffix: pinniped.dev
log:
level: "info|debug|trace|all"
# ...
---
# pinniped concierge config
kind: ConfigMap
apiVersion: v1
metadata:
name: pinniped-concierge-config
namespace: supervisor
data:
pinniped.yaml: |
apiGroupSuffix: pinniped.dev
log:
level: "info|debug|trace|all"
# ...
```

And then apply your configuration via `kubectl apply -f`.
### Using ytt and kapp for Supervisor

1. Refer to the [Install Supervisor]({{< ref "./install-supervisor" >}}#with-custom-options) page for instructions for
installing `kapp` and `ytt`. These instructions assume that the Supervisor was previously installed on your cluster in
a way that conforms to the [Using kapp]({{< ref "./install-supervisor" >}}#using-kapp) heading and that the `ytt` and `kapp`
command-line tools have been installed using the instructions from the [Carvel documentation](https://carvel.dev/#whole-suite).

2. Clone the Pinniped GitHub repository and visit the `deploy/supervisor` directory

- `git clone git@github.com:vmware-tanzu/pinniped.git`
- `cd pinniped/deploy/supervisor`

1. Assess which release version is installed on your cluster. All release versions are [listed on GitHub](https://github.com/vmware-tanzu/pinniped/releases).

1. Checkout the version that corresponds to the version tag installed on your cluster, e.g. `{{< latestversion >}}`.

- `git checkout {{< latestversion >}}`

1. Run the following command to render the templates and redeploy the Supervisor with the adjusted `log level`:

- `ytt --file . --data-value log_level=trace | kapp deploy --app pinniped-supervisor --yes --file -`

1. Restart the Supervisor pods:

- `kubectl delete --all pods -n pinniped-supervisor`

1. Reset the log level when debugging is finished.

### Using ytt and kapp for Concierge

1. Refer to the [Install Concierge]({{< ref "./install-concierge" >}}#with-custom-options) page for instructions for
installing `kapp` and `ytt`. These instructions assume that the Concierge was previously installed on your cluster in
a way that conforms to the [Using kapp]({{< ref "./install-concierge" >}}#using-kapp) heading and that the `ytt` and `kapp`
command-line tools have been installed using the instructions from the [Carvel documentation](https://carvel.dev/#whole-suite).

2. Clone the Pinniped GitHub repository and visit the `deploy/concierge` directory

- `git clone git@github.com:vmware-tanzu/pinniped.git`
- `cd pinniped/deploy/concierge`

1. Assess which release version is installed on your cluster. All release versions are [listed on GitHub](https://github.com/vmware-tanzu/pinniped/releases).

1. Checkout the version that corresponds to the version tag installed on your cluster, e.g. `{{< latestversion >}}`.

- `git checkout {{< latestversion >}}`

1. Run the following command to render the templates and redeploy the Concierge with the adjusted `log level`:

- `ytt --file . --data-value log_level=trace | kapp deploy --app pinniped-concierge --yes --file -`

1. Restart the Concierge pods:

- `kubectl delete --all pods -n pinniped-concierge`

1. Reset the log level when debugging is finished.

### Using kubectl for Supervisor

1. These instructions assume that the Supervisor was previously installed on your cluster in
a way that conforms to the [Using kubectl]({{< ref "./install-supervisor" >}}#using-kubectl) heading on the Install Supervisor page.

1. To adjust the log level of the Pinniped Supervisor using `kubectl`, find the Supervisor's configuration configmap:

- `kubectl get cm pinniped-supervisor-static-config --namespace pinniped-supervisor --output yaml > supervisor-cm.yaml`

1. Edit this configmap to change the `log level`:

```yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: pinniped-supervisor-static-config
namespace: pinniped-supervisor
data:
pinniped.yaml: |
apiGroupSuffix: pinniped.dev
log:
level: trace
# ...
```

1. Apply the new configuration:

- `kubectl apply -f supervisor-cm.yaml`

1. Restart the Supervisor pods:

- `kubectl delete --all pods -n pinniped-supervisor`

1. Reset the log level when debugging is finished.

### Using kubectl for Concierge

1. These instructions assume that the Concierge was previously installed on your cluster in
a way that conforms to the [Using kubectl]({{< ref "./install-concierge" >}}#using-kubectl) heading on the Install Concierge page.

1. To adjust the log level of the Pinniped Concierge using `kubectl`, find the Concierge's configuration configmap:

- `kubectl get cm pinniped-concierge-config --namespace pinniped-concierge --output yaml > concierge-cm.yaml`

1. Edit this configmap to change the `log level`:

```yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: pinniped-concierge-config
namespace: pinniped-concierge
data:
pinniped.yaml: |
apiGroupSuffix: pinniped.dev
log:
level: trace
# ...
```

1. Apply the new configuration:

- `kubectl apply -f concierge-cm.yaml`

1. Restart the Concierge pods:

- `kubectl delete --all pods -n pinniped-concierge`

1. Reset the log level when debugging is finished.

## Clearing session and credential caching by the CLI

Expand Down
Loading