<p>I have referred this tutorial to create deployable image:</p>
<p><a href="https://medium.com/@javatechie/kubernetes-tutorial-run-deploy-spring-boot-application-in-k8s-cluster-using-yaml-configuration-3b079154d232" rel="nofollow noreferrer">https://medium.com/@javatechie/kubernetes-tutorial-run-deploy-spring-boot-application-in-k8s-cluster-using-yaml-configuration-3b079154d232</a></p>
<p>I want to use this HELM chart in order to deploy image from directory:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment # Kubernetes resource kind we are creating
metadata:
  name: spring-boot-k8s
spec:
  selector:
    matchLabels:
      app: spring-boot-k8s
  replicas: 2 # Number of replicas that will be created for this deployment
  template:
    metadata:
      labels:
        app: spring-boot-k8s
    spec:
      containers:
        - name: spring-boot-k8s
          image: springboot-k8s-example:1.0 
# Image that will be used to containers in the cluster
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080 
# The port that the container is running on in the cluster
</code></pre>
<p>How I can deploy the docker image <code>springboot-k8s-example:1.0</code> from a directory or from a private Docker registry from url link?</p>

Peter Penzov
<p>Here you will need to create an image pull secret to pull an image from your own repository. I have reproduced your issue and pushed the image to my privet docker registry and then pulled the image successfully.</p>
<p>This could be done by using the below command here I am assuming that you are using docker privet registry :</p>
<pre><code>kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=&lt;docker-username&gt; --docker-password=&lt;your-password&gt; --docker-email=&lt;docker-email
</code></pre>
<p>This will create a secret and now you will need to add it in your deployment manifest so that it could authenticate with privet registry to pull the image.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment # Kubernetes resource kind we are creating
metadata:
  name: spring-boot-k8s
spec:
  selector:
    matchLabels:
      app: spring-boot-k8s
  replicas: 2 # Number of replicas that will be created for this deployment
  template:
    metadata:
      labels:
        app: spring-boot-k8s
    spec:
      containers:
        - name: spring-boot-k8s
          image: sidharthpai/springboot-k8s-example:1.0
# Image that will be used to containers in the cluster
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
      imagePullSecrets:
      - name: regcred
</code></pre>
<p>For more reference to create image pull secret : <a href="https://github.com/javahometech/kubernetes/tree/master/secrets" rel="nofollow noreferrer">image pull secret</a></p>
<p>Now to prepare the helm chart you will need to create a chart with relevant name and then configure Deployment.yml &amp; Secret.yml in the helm chart template.Once this is done you will need to configure values.yml.</p>
<p>Deployment.yml (template)</p>
<pre><code>apiVersion: apps/v1
kind: Deployment # Kubernetes resource kind we are creating
metadata:
  name: {{ .Values.name}}
spec:
  selector:
    matchLabels:
      app: {{ .Values.app}}
  replicas: 2 # Number of replicas that will be created for this deployment
  template:
    metadata:
      labels:
        app: {{ .Values.app}}
    spec:
      containers:
        - name: {{ .Values.name}}
          image: {{ .Values.image}}
# Image that will be used to containers in the cluster
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
      imagePullSecrets:
      - name: {{ .Values.secret_name}}
</code></pre>
<p>Secret.yml(Template)</p>
<pre><code>apiVersion: v1
data:
  .dockerconfigjson: {{ .Values.docker_config}}
kind: Secret
metadata:
  name: {{ .Values.secret_name}}
type: kubernetes.io/dockerconfigjson
</code></pre>
<p>Values.yml</p>
<pre><code>name: spring-boot-k8s
app: spring-boot-k8s
image: sidharthpai/springboot-k8s-example:1.0
secret_name: regcred
docker_config: &lt;docker-config-value&gt;
</code></pre>
<p><a href="https://i.stack.imgur.com/1kRjb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1kRjb.png" alt="Deployed the application using helm chart" /></a></p>
