I am trying to be able to deploy an image from a space repository to AWS EKS. So far I managed to successfully save my docker image to Space. But I stuck at finding a way to upload my image to my cluster.
So far I've created the following to save my docker image to the registy. Does someone know how I could push this towards AWS EKS? Thank you in advance for taking the time help me!
job("Build Image and save to registry") {
startOn {
gitPush {
branchFilter {
+"refs/heads/main"
}
}
}
docker {
resources {
cpu = 512
memory = 1024
}
build {
context = "."
file = "Dockerfile"
}
push("<my-private>.registry.jetbrains.space/p/repo/repo/image:latest")
}
}
EDIT: my bad, it turns out I misunderstood the question!
I'm not an AWS guru, but to deploy to a Kubernetes cluster, I believe you would just need an extra step calling
kubectl apply -f your-service.yml
or something like that.It is not possible out-of-the-box to push to private registries via the
docker
(nowkaniko
) top-level DSL, but this DSL is rather legacy.Instead, use the dockerBuildPush DSL in a
host
step (instead of adocker
/kaniko
step).One way to login to the private registry is to provide the credentials as secrets to the job (add the secrets in the project settings first) and do a
docker login
command in ashellScript
block beforedockerBuildPush
:As of June 2023, you can now also use the dockerRegistryConnections DSL (but it's not available in the Free plan). In your project settings, you need to go to
Docker Registry Connections
tab, and add credentials there, and give them a key for reference, e.g."my-private-registry"
. Then you can simply add adockerRegistryConnections
block with a reference to your key, and the worker will login before the step and logout after the step, without the need for manipulating secrets:See the documentation for more info.