How to change image in new Operator - cniackz/public GitHub Wiki

Objetive:

To document how I changed from Alpine Image to Ubuntu Image in new Operator.

Reasoning:

This will allow me to gain confidence on how to change from any given image to DirectPV image.

Steps:

  1. In file: /Users/cniackz/directpv-operator/config/manager/manager.yaml, changed the image in the container:
      containers:
      - command:
        - /manager
        args:
        - --leader-elect
        image: controller:latest
        name: manager
        env:
        - name: MEMCACHED_IMAGE
          value: "ubuntu:latest"
  1. In file /Users/cniackz/directpv-operator/internal/controller/memcached_controller.go, changed the command line and added arguments for ubuntu to run instead:
						Command: []string{"/bin/bash", "-c", "--"},
						Args:    []string{"while true; do sleep 30; done;"},
  1. Then compiled and redeployed:
make generate
make manifests
make docker-build docker-push
createcluster
make deploy
kubectl get deployment -n memcached-operator-system
cd ~/directpv-operator
kubectl apply -f cache_v1alpha1_memcached.yaml
kubectl get deployment
kubectl get pods
kubectl get memcached/memcached-sample -o yaml
  1. Now I see Ubuntu properly running:

Screenshot 2023-07-24 at 2 40 45 PM