DEV Community

Discussion on: Using GitHub Container Registry with Kubernetes

Collapse
 
elpddev profile image
Eyal Lapid

I have also succesfuly used the create secret kubectl cli command. It has the benefit of doing the transformation for you.

kubectl create secret docker-registry mysecretname --docker-server=https://ghcr.io --docker-username=mygithubusername --docker-password=mygithubreadtoken --docker-email=mygithubemail
Enter fullscreen mode Exit fullscreen mode
Collapse
 
sourcecodemage profile image
SourceCode Mage

I'll give this a try the next time a PAT expires. Do you know if the same command can be used to update the token to a new value after it expires? With this article's kubectl apply method, the renewal complained :

Warning: resource secrets/name is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
secret/name configured

But it did update the secret to the new value.