You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
CR api gateway deployment pod can't pull its consul-dataplane docker image. This is because when we deployed deploy CR with kind: Gateway, the correct deployment will be created with the correct pointing to serviceAccount, but unfortunately, this serviceAccount named <gateway-name>-gateway does not contain imagePullSecret in its definition.
Reproduction Steps
Docker pull official images and add own tags
Docker push official images with own tags to private registry (Azure container registry) which is secured (ImagePullSecret is required)
Add secret on k8s - myregistry.azurecr.io-access (kubernetes.io/dockerconfigjson) - is valid
Download official consul helm chart 1.5.3 (Consul 1.19.2)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 14m default-scheduler Successfully assigned spoc/my-api-gateway-58c4f65b9c-82ktg to aks-nodepool1-myVM
Normal Pulled 14m kubelet Pulling image "myregistry.azurecr.io/repo/release/consul-k8s-control-plane:1.5.3"
Normal Created 14m kubelet Created container consul-connect-inject-init
Normal Started 14m kubelet Started container consul-connect-inject-init
Normal Pulling 13m (x4 over 14m) kubelet Pulling image "myregistry.azurecr.io/repo/release/consul-dataplane:1.5.3"
Warning Failed 13m (x4 over 14m) kubelet Failed to pull image "myregistry.azurecr.io/repo/release/consul-dataplane:1.5.3": failed to pull and unpack image "myregistry.azurecr.io/repo/release/consul-dataplane:1.5.3": failed to resolve reference "myregistry.azurecr.io/repo/release/consul-dataplane:1.5.3": failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://myregistry.azurecr.io/oauth2/token?scope=repository%3Arelease%2Fconsul-dataplane%3Apull&service=myregistry.azurecr.io: 401 Unauthorized
Warning Failed 13m (x4 over 14m) kubelet Error: ErrImagePull
Warning Failed 13m (x5 over 14m) kubelet Error: ImagePullBackOff
Normal BackOff 4m39s (x42 over 14m) kubelet Back-off pulling image "myregistry.azurecr.io/repo/release/consul-dataplane:1.5.3"
Expected behavior
The ServiceAccount created by the controller adding objects after detecting CR gateway will contain the correct imagePullSecret defined in the helm chart, in the global section
The ServiceAccount definition is missing the imagePullSecret if it was added in the helm chart under global:
In version 1.19.2 (consul-k8s1.5.3) you fixed the bug only for pulling the consul-k8s-control-plane image, which is needed to init container api gateway pod in #3862 but not for api gateway deployment image - consul-dataplane.
By the way, check this for other CR creation cases where serviceAccount from imagePullSecret is required.
The text was updated successfully, but these errors were encountered:
pawellegowski89
changed the title
api gateway deployment - service account missing imagePullSecrets
CR api gateway - deployment service account missing imagePullSecrets
Sep 10, 2024
pawellegowski89
changed the title
CR api gateway - deployment service account missing imagePullSecrets
CR Api Gateway - deployment service account missing imagePullSecrets
Sep 10, 2024
Community Note
Overview of the Issue
CR api gateway deployment pod can't pull its consul-dataplane docker image. This is because when we deployed deploy CR with kind: Gateway, the correct deployment will be created with the correct pointing to serviceAccount, but unfortunately, this serviceAccount named
<gateway-name>-gateway
does not contain imagePullSecret in its definition.Reproduction Steps
command to find created object with bad definition:
kubectl get serviceAccount my-api-gateway -n ns
Invalid serviceAccount definition:
Logs
Logs in 1.19.2 version:
Expected behavior
The ServiceAccount created by the controller adding objects after detecting CR gateway will contain the correct imagePullSecret defined in the helm chart, in the global section
Environment details
consul-k8s
version: 1.5.3values.yaml
used to deploy the helm chart:Additional Context
I think the definition below is wrong:
https://github.com/hashicorp/consul-k8s/blob/v1.5.3/control-plane/gateways/serviceaccount.go
The ServiceAccount definition is missing the imagePullSecret if it was added in the helm chart under
global:
In version 1.19.2 (consul-k8s1.5.3) you fixed the bug only for pulling the consul-k8s-control-plane image, which is needed to init container api gateway pod in #3862 but not for api gateway deployment image - consul-dataplane.
By the way, check this for other CR creation cases where serviceAccount from imagePullSecret is required.
The text was updated successfully, but these errors were encountered: