25 lines
No EOL
693 B
Bash
Executable file
25 lines
No EOL
693 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Create a GitHub personal access token with read:packages scope
|
|
# Then run this script with your GitHub username and token
|
|
|
|
if [ "$#" -ne 2 ]; then
|
|
echo "Usage: $0 <github-username> <github-token>"
|
|
echo "Create a token at: https://github.com/settings/tokens/new"
|
|
echo "Required scope: read:packages"
|
|
exit 1
|
|
fi
|
|
|
|
GITHUB_USER=$1
|
|
GITHUB_TOKEN=$2
|
|
|
|
kubectl create secret docker-registry ghcr-secret \
|
|
--docker-server=ghcr.io \
|
|
--docker-username=$GITHUB_USER \
|
|
--docker-password=$GITHUB_TOKEN \
|
|
--namespace=aprs
|
|
|
|
echo "Secret created! Now update the StatefulSet to use it:"
|
|
echo "Add this to the pod spec:"
|
|
echo " imagePullSecrets:"
|
|
echo " - name: ghcr-secret" |