I'm trying to configure a Kubernetes job to run a set of bash and python scripts that contains some AWS CLI commands.
Is there a good image out there for doing that? Do I need to create a custom docker image? I just want a container with these tools installed, what's the easiest way of getting there?
Easiest would be getting any image from Docker hub containing AWS CLI, for example woahbase/alpine-awscli
.
You can use it in a following way kubectl run aws-cli --image=woahbase/alpine-awscli
This would create a pod
names aws-cli which would contain following image. You would need to upload your scripts to the pod
or mount a storage Configure a Pod to Use a PersistentVolume for Storage.
Keep in mind this is not recommended as this image does not belong to you and you have no idea if there were no changes before checking.
I would create my own Docker hub repo and build my own image, something like the following:
FROM alpine:3.6
RUN apk -v --update add \
python \
py-pip \
groff \
less \
mailcap \
&& \
pip install --upgrade awscli==1.14.5 s3cmd==2.0.1 python-magic && \
apk -v --purge del py-pip && \
rm /var/cache/apk/*
VOLUME /root/.aws
VOLUME /project
WORKDIR /project
ENTRYPOINT ["aws"]