Skip to content

Commit

Permalink
doc: bump README and NOTES
Browse files Browse the repository at this point in the history
  • Loading branch information
tampakrap committed Mar 27, 2024
1 parent 64ca56b commit 9600e6b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ client and the Spotify OAuth API.
- [Introduction](#introduction)
- [Prerequisities](#prerequisities)
- [Configuration](#configuration)
- [Usage](#usage)

## Introduction

Expand Down Expand Up @@ -61,3 +62,34 @@ the comments for more details.

The `SPOTIFY_PROXY_BASE_URI` is not a secret, it can be set via a variable,
which is named `spotifyProxyBaseURI`.

Example values.yaml files:
- [with the secrets managed by this helm chart](charts/spotify-auth-proxy/ci/ci-create-secrets-values.yaml)
- [with external secrets](charts/spotify-auth-proxy/ci/ci-external-secrets-values.yaml)

## Usage

After setting up the environment variables as described above, and after
installing the helm chart, you should have one StatefulSet with one replica
running. Check the logs of that pod, it should output something like the
following (replace `spotify-auth-proxy` in case you have set different name):

```
➜ kubectl -n spotify-auth-proxy logs spotify-auth-proxy-0
APIKey: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Auth URL: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
```

If the `SPOTIFY_PROXY_API_KEY` is set, then the log will output only the Auth
URL.

Open the Auth URL on your browser in order to log in. In case the Auth URL is
only accessible for localhost, then you can set a port forward:

```
➜ kubectl -n spotify-auth-proxy port-forward svc/spotify-auth-proxy 27228
Forwarding from 127.0.0.1:27228 -> 27228
Forwarding from [::1]:27228 -> 27228
```

Open the URL with a browser in order to login.
9 changes: 5 additions & 4 deletions charts/spotify-auth-proxy/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "spotify-auth-proxy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "spotify-auth-proxy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
echo "Start a port-forward"
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ include "spotify-auth-proxy.fullname" . }} 27228
echo "Get the Auth URL from the pod logs"
kubectl --namespace {{ .Release.Namespace }} logs {{ include "spotify-auth-proxy.fullname" . }}
echo "Open a browser on the Auth URL to log in"
{{- end }}

0 comments on commit 9600e6b

Please sign in to comment.