Skip to content

Commit

Permalink
Make provisioner image configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Trieflinger <[email protected]>
  • Loading branch information
strieflin committed Dec 21, 2022
1 parent a7799ed commit fee0129
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
8 changes: 8 additions & 0 deletions klyshko-operator/charts/klyshko-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ helm install --name my-release -f values.yaml klyshko-operator
| `controller.image.tag` | Controller image tag | `latest` |
| `controller.image.pullPolicy` | Controller image pull policy | `IfNotPresent` |
| `controller.imagePullSecrets` | Pull secrets used to fetch the controller image | `[]` |

### Provisioner

| Parameter | Description | Default |
| ------------------------------ | ------------------------------------------------- | ---------------------------------- |
| `provisioner.image.registry` | Image registry used to pull the provisioner image | `ghcr.io` |
| `provisioner.image.repository` | Provisioner image name | `carbynestack/klyshko-provisioner` |
| `provisioner.image.tag` | Provisioner image tag | `latest` |
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ spec:
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
- --zap-log-level=info
- --provisioner-image={{ printf "%s/%s:%s" .Values.provisioner.image.registry .Values.provisioner.image.repository .Values.provisioner.image.tag }}
command:
- /manager
image: "{{ .Values.controller.image.registry }}/{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
Expand Down
6 changes: 6 additions & 0 deletions klyshko-operator/charts/klyshko-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ controller:
pullPolicy: IfNotPresent
tag: latest
imagePullSecrets: []

provisioner:
image:
registry: ghcr.io
repository: carbynestack/klyshko-provisioner
tag: latest
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ spec:
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--zap-log-level=info"
- "--provisioner-image=carbynestack/klyshko-provisioner:1.0.0-SNAPSHOT"
7 changes: 4 additions & 3 deletions klyshko-operator/controllers/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ func (vcp *vcp) setupControllers(ctx context.Context, vcpID int, etcdClient *cli
NewTupleGenerationJobReconciler(
k8sManager.GetClient(), k8sManager.GetScheme(), etcdClient, castorClient),
&TupleGenerationTaskReconciler{ // TODO Replace with constructors
Client: k8sManager.GetClient(),
Scheme: k8sManager.GetScheme(),
EtcdClient: etcdClient,
Client: k8sManager.GetClient(),
Scheme: k8sManager.GetScheme(),
EtcdClient: etcdClient,
ProvisionerImage: "carbynestack/klyshko-provisioner:1.0.0-SNAPSHOT",
},
}
if vcpID == 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import (
// TupleGenerationTaskReconciler reconciles a TupleGenerationTask object.
type TupleGenerationTaskReconciler struct {
client.Client
Scheme *runtime.Scheme
EtcdClient *clientv3.Client
Scheme *runtime.Scheme
EtcdClient *clientv3.Client
ProvisionerImage string
}

//+kubebuilder:rbac:groups=klyshko.carbnyestack.io,resources=tuplegenerationtasks,verbs=get;list;watch;create;update;patch;delete
Expand Down Expand Up @@ -331,8 +332,8 @@ func (r *TupleGenerationTaskReconciler) createProvisionerPod(ctx context.Context
},
Spec: v1.PodSpec{
Containers: []v1.Container{{
Name: "generator",
Image: "carbynestack/klyshko-provisioner:1.0.0-SNAPSHOT", // TODO Read from config
Name: "provisioner",
Image: r.ProvisionerImage,
Env: []v1.EnvVar{
{
Name: "KII_JOB_ID",
Expand Down
8 changes: 5 additions & 3 deletions klyshko-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var (
etcdEndpoint = flag.String("etcd-endpoint", "172.18.1.129:2379", "The address of the etcd service used for cross VCP coordination.")
etcdDialTimeout = flag.Int("etcd-dial-timeout", 5, "The timeout (in seconds) for failing to establish a connection to the etcd service.")
castorURL = flag.String("castor-url", "http://cs-castor.default.svc.cluster.local:10100", "The base url of the castor service used to upload generated tuples.")
provisionerImage = flag.String("provisioner-image", "ghcr.io/carbynestack/klyshko-provisioner:latest", "The name of the provisioner image.")
)

func main() {
Expand Down Expand Up @@ -96,9 +97,10 @@ func main() {
}

if err = (&controllers.TupleGenerationTaskReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
EtcdClient: etcdClient,
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
EtcdClient: etcdClient,
ProvisionerImage: *provisionerImage,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "TupleGenerationTask")
os.Exit(1)
Expand Down

0 comments on commit fee0129

Please sign in to comment.