helm / kind-action

A GitHub Action for Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
306 stars 76 forks source link

Image pull secrets for private repository #37

Closed rafis closed 3 years ago

rafis commented 3 years ago

Hi! Thank you for developing this action. I'm trying to pull images from private repository on Docker Hub. My Helm Chart works on local machine but not in Github Actions.

I have added the reference to the image pull secrets to service account (templates/serviceaccount.yaml):

{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
...
imagePullSecrets:
  - name: {{ .Values.imageCredentials.name }}
{{- end }}

In Github Actions I'm receiving the following error:

4m40s Warning Failed pod/-skg0mhcv90-microservice-7657f7ff98-hqgfn spec.containers{microservice} kubelet, chart-testing-control-plane Failed to pull image "/microservice:1.0.0": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io//microservice:1.0.0": failed to resolve reference "docker.io//microservice:1.0.0": failed to authorize: failed to fetch oauth token: unexpected status: 401 Unauthorized 4m56s 2 -skg0mhcv90-microservice-7657f7ff98-hqgfn.167e0ba654861edd 3m23s Warning Failed pod/-skg0mhcv90-microservice-7657f7ff98-hqgfn spec.containers{microservice} kubelet, chart-testing-control-plane Failed to pull image "/microservice:1.0.0": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io//microservice:1.0.0": failed to resolve reference "docker.io//microservice:1.0.0": failed to authorize: failed to fetch oauth token: unexpected status: 429 Too Many Requests 4m18s 2 -skg0mhcv90-microservice-7657f7ff98-hqgfn.167e0baf29d75e8a

rafis commented 3 years ago

My password was containing dollar sign, I had to remove it because Github Actions doesn't have .replace() function nor any other function to escape it.