Skip to content

Commit 55fa9e2

Browse files
authored
Add support for custom restate entrypoint/args (#43)
1 parent 21188c7 commit 55fa9e2

5 files changed

Lines changed: 32 additions & 0 deletions

File tree

crd/RestateCluster.pkl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ class Compute {
5252
/// Affinity is a group of affinity scheduling rules.
5353
affinity: PodSpec.Affinity?
5454

55+
/// Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided.
56+
command: Listing<String>?
57+
58+
/// Arguments to the entrypoint. The container image's CMD is used if this is not provided.
59+
args: Listing<String>?
60+
5561
/// Specifies the DNS parameters of the Restate pod. Parameters specified here will be merged to the
5662
/// generated DNS configuration based on DNSPolicy.
5763
dnsConfig: PodSpec.PodDNSConfig?

crd/restateclusters.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,18 @@ spec:
549549
type: array
550550
type: object
551551
type: object
552+
args:
553+
description: Arguments to the entrypoint. The container image's CMD is used if this is not provided.
554+
items:
555+
type: string
556+
nullable: true
557+
type: array
558+
command:
559+
description: Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided.
560+
items:
561+
type: string
562+
nullable: true
563+
type: array
552564
dnsConfig:
553565
description: Specifies the DNS parameters of the Restate pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.
554566
nullable: true

justfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,11 @@ build *flags:
7777

7878
docker:
7979
docker build . -f docker/Dockerfile --tag={{ image }} --progress='{{ DOCKER_PROGRESS }}' --load
80+
81+
fmt:
82+
cargo fmt --all
83+
84+
lint:
85+
cargo clippy
86+
87+
check: fmt lint

src/controllers/restatecluster/reconcilers/compute.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ fn restate_statefulset(
355355
name: "restate".into(),
356356
image: Some(spec.compute.image.clone()),
357357
image_pull_policy: spec.compute.image_pull_policy.clone(),
358+
command: spec.compute.command.clone(),
359+
args: spec.compute.args.clone(),
358360
env: Some(env),
359361
ports: Some(vec![
360362
ContainerPort {

src/resources/restateclusters.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ pub struct RestateClusterCompute {
123123
pub replicas: Option<i32>,
124124
/// Container image name. More info: https://kubernetes.io/docs/concepts/containers/images.
125125
pub image: String,
126+
/// Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided.
127+
pub command: Option<Vec<String>>,
128+
/// Arguments to the entrypoint. The container image's CMD is used if this is not provided.
129+
pub args: Option<Vec<String>>,
126130
/// Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
127131
pub image_pull_policy: Option<String>,
128132
/// Optional list of references to secrets in the same namespace to use for pulling the image.

0 commit comments

Comments
 (0)