# Using a custom docker image for Elastic Cloud on Kubernetes

**URL:** <https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [June 4, 2019, 6:09pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241 "2019-06-04T18:09:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rutomo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rutomo/32/45283_2.png) [@rutomo](https://discuss.elastic.co/u/rutomo)\
**Post date:** [June 4, 2019, 6:09pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/1 "2019-06-04T18:09:06Z")

</div>

Hi,

I'm looking into or doing some research on Elastic Cloud on Kubernetes and went through the Quickstart page but I couldn't find a way to use ECK with a custom ES docker image hosted on docker hub. Is there a way to do so?

---

<div class="post-metadata">

**Author:** ![aravindputrevu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aravindputrevu/32/24816_2.png) [@aravindputrevu](https://discuss.elastic.co/u/aravindputrevu)\
**Post date:** [June 5, 2019, 7:32am UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/2 "2019-06-05T07:32:34Z")

</div>

Curious to know why you want to run a custom ES docker image. As we post all the updates keep the containers patched with latest security fixes.

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [June 5, 2019, 12:21pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/3 "2019-06-05T12:21:13Z")

</div>

Both the Elasticsearch and the Kibana CRDs have an `image` attribute that allow you specify a custom docker image.

---

<div class="post-metadata">

**Author:** ![rutomo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rutomo/32/45283_2.png) [@rutomo](https://discuss.elastic.co/u/rutomo)\
**Post date:** [June 5, 2019, 12:26pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/4 "2019-06-05T12:26:07Z")

</div>

I want to build a custom image based on the official ES docker image to add few things for my needs.

---

<div class="post-metadata">

**Author:** ![rutomo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rutomo/32/45283_2.png) [@rutomo](https://discuss.elastic.co/u/rutomo)\
**Post date:** [June 5, 2019, 1:27pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/5 "2019-06-05T13:27:06Z")

</div>

Thanks. I went through the CRD definition and saw this attribute, however, I'm not certain how to use it if I have a private docker repo. I tried with the following:

> cat \<\<EOF | kubectl apply -f -  
> apiVersion: [elasticsearch.k8s.elastic.co/v1alpha1](http://elasticsearch.k8s.elastic.co/v1alpha1)  
> kind: Elasticsearch  
> metadata:  
> name: quickstart  
> spec:  
> image: rutomo/custom-es:6.8.0  
> nodes:
> 
> - nodeCount: 1  
> config:  
> node.master: true  
> node.data: true  
> node.ingest: true  
> EOF

I got an error saying that it couldn't parse Elasticsearch version so I assume **version** is required so I tried to the following:

> cat \<\<EOF | kubectl apply -f -  
> apiVersion: [elasticsearch.k8s.elastic.co/v1alpha1](http://elasticsearch.k8s.elastic.co/v1alpha1)  
> kind: Elasticsearch  
> metadata:  
> name: quickstart  
> spec:  
> image: rutomo/custom-es  
> version: 6.8.0  
> nodes:
> 
> - nodeCount: 1  
> config:  
> node.master: true  
> node.data: true  
> node.ingest: true  
> EOF

I got **Init:ImagePullBackOff** which I assumed it's because it's a private repo so I have to pass docker hub secret, however, I'm not sure how to do this as it's not mentioned anywhere in the quickstart or documentation. Also, I'm not sure if I did it correctly because I have a specific tag for my custom ES image. I will go through into the CRD again and see if I can find anything for the secret.

EDIT: ignore the formatting since I'm not sure how to format it properly.

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [June 5, 2019, 1:59pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/6 "2019-06-05T13:59:15Z")

</div>

In principle what is written in the Kubernetes documenation applies also to ECK  
[https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)

For ECK 0.8.0 we don't support a full podTemplate yet which means you cannot unfortunately specify the necessary `imagePullSecrets`. We will fix that in the next release.

---

<div class="post-metadata">

**Author:** ![rutomo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rutomo/32/45283_2.png) [@rutomo](https://discuss.elastic.co/u/rutomo)\
**Post date:** [June 5, 2019, 3:08pm UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/7 "2019-06-05T15:08:10Z")

</div>

Thanks for confirming, Peter.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:10am UTC](https://discuss.elastic.co/t/using-a-custom-docker-image-for-elastic-cloud-on-kubernetes/184241/8 "2022-11-04T07:10:52Z")

</div>


