skip to content
Alvin Lucillo

Using local images in k8s deploy resource

/ 1 min read

💻 Tech

If you want your images to be used by your k8s deploy resource, you can use imagePullPolicy: IfNotPresent. This is helpful if you’ve built your images in your minikube VM and you want to use them in your k8s cluster.

apiVersion: apps/v1

kind: Deployment

metadata:
  name: my-deployment

spec:
    replicas: 1
    selector:
        matchLabels:
        app: my-app
    template:
        metadata:
        labels:
            app: my-app
        spec:
        containers:
            - name: my-app
            image: my-image
            imagePullPolicy: IfNotPresent
            ports:
                - containerPort: 8080