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

Add a FAQ and switch rare issue from README to it #437

Merged
merged 18 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 10 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
50 changes: 50 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Frequently Asked Questions

- [Pods are stuck terminating after uninstall. How do I fix it?](#pods-are-stuck-terminating-after-uninstall-how-do-i-fix-it)
- [Uninstall is stuck. How do I fix it?](#uninstall-is-stuck-how-do-i-fix-it)
- [The PSAT plugin is not working](#the-psat-plugin-is-not-working)

## Pods are stuck terminating after uninstall. How do I fix it?

If you uninstall the spire chart before all users of the csi driver are removed, pods will get stuck in a terminating state waiting for the driver, that no longer is installed, to unmount the volumes for the pod. In order to fix this, reinstall the chart and remove all affected workloads that are not part of the spire helm chart itself, before attempting to remove spire again.
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved

You can discover pods that use the driver with the following command:
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
```
kubectl get pods --all-namespaces -o go-template='{{range .items}}{{$nn := printf "%s %s" .metadata.namespace .metadata.name}}{{range .spec.volumes}}{{if .csi.driver}}{{if eq .csi.driver "csi.spiffe.io"}}{{printf "%s\n" $nn}}{{end}}{{end}}{{end}}{{end}}'
```

## Uninstall is stuck. How do I fix it?

If you uninstall the spiffe csi driver manually before removing the chart, pods can still be using the driver an are unable to unmount the csi volume.
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved

To resolve, reinstall the chart before trying to remove it again.

## The PSAT plugin is not working

The chart requires `Projected Service Account Tokens` which has to be enabled on your k8s api server. In most cases this is already done for you.
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved

> **Note**: This is enabled by default with newer versions as shown by the existence of:
>
> - --service-account-issuer
> - --service-account-key-file
> - --service-account-signing-key-file

See [Service Account Token Volume Projection](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#serviceaccount-token-volume-projection) in the Kubernetes docs for more details.

To enable Projected Service Account Tokens on Docker for Mac/Windows run the following
command to SSH into the Docker Desktop K8s VM.

```bash
docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
```
Then add the following to `/etc/kubernetes/manifests/kube-apiserver.yaml`
```yaml
spec:
containers:
- command:
- kube-apiserver
- --api-audiences=api,spire-server
- --service-account-issuer=api,spire-agent
- --service-account-key-file=/run/config/pki/sa.pub
- --service-account-signing-key-file=/run/config/pki/sa.key
```
26 changes: 2 additions & 24 deletions charts/spire/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,8 @@ A Helm chart for deploying the complete Spire stack including: spire-server, spi

> **Note**: For Kubernetes, we will officially support the last 3 versions as described in [k8s versioning](https://kubernetes.io/releases/version-skew-policy/#supported-versions). Any version before the last 3 we will try to support as long it doesn't bring security issues or any big maintenance burden.

kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
## Prerequisites

Please note this chart requires `Projected Service Account Tokens` which has to be enabled on your k8s api server.

To enable Projected Service Account Tokens on Docker for Mac/Windows run the following
command to SSH into the Docker Desktop K8s VM.

```bash
docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
```

Then add the following to `/etc/kubernetes/manifests/kube-apiserver.yaml`

```yaml
spec:
containers:
- command:
- kube-apiserver
- --api-audiences=api,spire-server
- --service-account-issuer=api,spire-agent
- --service-account-key-file=/run/config/pki/sa.pub
- --service-account-signing-key-file=/run/config/pki/sa.key
```

## FAQ
For any issues see our [FAQ](../../FAQ.md)…
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
## Usage

To utilize Spire in your own workloads you should add the following to your workload:
Expand Down
26 changes: 2 additions & 24 deletions charts/spire/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,8 @@

> **Note**: For Kubernetes, we will officially support the last 3 versions as described in [k8s versioning](https://kubernetes.io/releases/version-skew-policy/#supported-versions). Any version before the last 3 we will try to support as long it doesn't bring security issues or any big maintenance burden.

kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
## Prerequisites

Please note this chart requires `Projected Service Account Tokens` which has to be enabled on your k8s api server.

To enable Projected Service Account Tokens on Docker for Mac/Windows run the following
command to SSH into the Docker Desktop K8s VM.

```bash
docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
```

Then add the following to `/etc/kubernetes/manifests/kube-apiserver.yaml`

```yaml
spec:
containers:
- command:
- kube-apiserver
- --api-audiences=api,spire-server
- --service-account-issuer=api,spire-agent
- --service-account-key-file=/run/config/pki/sa.pub
- --service-account-signing-key-file=/run/config/pki/sa.key
```

## FAQ
For any issues see our [FAQ](../../FAQ.md)…
kfox1111 marked this conversation as resolved.
Show resolved Hide resolved
## Usage

To utilize Spire in your own workloads you should add the following to your workload:
Expand Down