Closed Rindrics closed 2 years ago
@Rindrics thanks you for the question!
Actually Gatling CR does NOT support to add imagePullSecret
definition to Gatling CR at this point. We'll consider to add the feature.
But there is a workaround to pull the image from private registry. Here is a procedure
Suppose you want to deploy your gatling CR (ie, 'gatling-sample01') to default
namespace, create an "image pull secret" like this
PASS=xxxxxx
NAMESPACE=default
kubectl create secret docker-registry mysecret --docker-server=<registry server name> --docker-username=<registry-accout-name> --docker-password=$PASS --docker-email=your@mail.com -n $NAMESPACE
So your image pull secret named mysecret
was created under default
namespace
Suppose you define service account named gatling-operator-worker
in your Gatling CR, modify the gatling-operator-worker
service account for the namespace to use this secret as an imagePullSecret like this:
NAMESPACE=default
kubectl patch serviceaccount gatling-operator-worker -p "{\"imagePullSecrets\": [{\"name\": \"mysecret\"}]}" -n $NAMESPACE
Now you're ready to deploy your galting CR where private image is defined.
apiVersion: gatling-operator.tech.zozo.com/v1alpha1
kind: Gatling
metadata:
name: gatling-sample01
spec:
generateReport: false
generateLocalReport: false
notifyReport: false
cleanupAfterJobDone: true
podSpec:
serviceAccountName: "gatling-operator-worker"
gatlingImage: myPriveteRepo.io/foo:latest
Hope this would help
Thanks to your instruction, I managed to pull the image and let Gatling containers run!
Thank you so much for your detailed instruction.
@Rindrics thank you for the confirmation!!
Thank you for developing useful tool!
Is there any way to use container images placed in a private registry?
Context
I specified my container image in
gatling-operator_v1alpha1_gatling01.yaml
as follows:Applying the yaml above of course cause
ImagePullBackOff
error.What I tried
I tried adding
imagePullSecret: mysecret
to the yaml, but found the current API does not support it.Thanks,