diff --git a/api/v1/chyt_types.go b/api/v1/chyt_types.go index b6e9654b..1a7e5b9f 100644 --- a/api/v1/chyt_types.go +++ b/api/v1/chyt_types.go @@ -40,8 +40,11 @@ type ChytSpec struct { Ytsaurus *corev1.LocalObjectReference `json:"ytsaurus,omitempty"` Image string `json:"image,omitempty"` + // Mark specified image as default for cliques. //+kubebuilder:default:=false MakeDefault bool `json:"makeDefault"` + // Create ch_public clique, which is used by default when running CHYT queries. + CreatePublicClique *bool `json:"createPublicClique,omitempty"` } // ChytStatus defines the observed state of Chyt diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index ec571566..efcd74ee 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -273,6 +273,11 @@ func (in *ChytSpec) DeepCopyInto(out *ChytSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.CreatePublicClique != nil { + in, out := &in.CreatePublicClique, &out.CreatePublicClique + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChytSpec. diff --git a/config/crd/bases/cluster.ytsaurus.tech_chyts.yaml b/config/crd/bases/cluster.ytsaurus.tech_chyts.yaml index 1ce8dd03..616d8963 100644 --- a/config/crd/bases/cluster.ytsaurus.tech_chyts.yaml +++ b/config/crd/bases/cluster.ytsaurus.tech_chyts.yaml @@ -40,6 +40,10 @@ spec: spec: description: ChytSpec defines the desired state of Chyt properties: + createPublicClique: + description: Create ch_public clique, which is used by default when + running CHYT queries. + type: boolean image: type: string imagePullSecrets: @@ -58,6 +62,7 @@ spec: type: array makeDefault: default: false + description: Mark specified image as default for cliques. type: boolean ytsaurus: description: |- diff --git a/config/samples/cluster_v1_chyt.yaml b/config/samples/cluster_v1_chyt.yaml index aa3c3cfd..59cac769 100644 --- a/config/samples/cluster_v1_chyt.yaml +++ b/config/samples/cluster_v1_chyt.yaml @@ -8,3 +8,4 @@ spec: minisaurus image: ghcr.io/ytsaurus/chyt:2.14.0-relwithdebinfo makeDefault: true + createPublicClique: true diff --git a/docs/api.md b/docs/api.md index 1eb1e2a0..4e7a9fc0 100644 --- a/docs/api.md +++ b/docs/api.md @@ -181,7 +181,8 @@ _Appears in:_ | `imagePullSecrets` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#localobjectreference-v1-core) array_ | | | | | `ytsaurus` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#localobjectreference-v1-core)_ | | | | | `image` _string_ | | | | -| `makeDefault` _boolean_ | | false | | +| `makeDefault` _boolean_ | Mark specified image as default for cliques. | false | | +| `createPublicClique` _boolean_ | Create ch_public clique, which is used by default when running CHYT queries. | | | diff --git a/pkg/components/chyt.go b/pkg/components/chyt.go index 83012f0b..b9aa99bd 100644 --- a/pkg/components/chyt.go +++ b/pkg/components/chyt.go @@ -188,7 +188,8 @@ func (c *Chyt) doSync(ctx context.Context, dry bool) (ComponentStatus, error) { return status, err } - if c.ytsaurus.Spec.StrawberryController != nil && c.chyt.GetResource().Spec.MakeDefault { + createPublicClique := c.chyt.GetResource().Spec.CreatePublicClique + if c.ytsaurus.Spec.StrawberryController != nil && createPublicClique != nil && *createPublicClique { if !dry { c.prepareChPublicJob() } diff --git a/ytop-chart/templates/crds/chyts.cluster.ytsaurus.tech.yaml b/ytop-chart/templates/crds/chyts.cluster.ytsaurus.tech.yaml index 9d284822..7ce12a8e 100644 --- a/ytop-chart/templates/crds/chyts.cluster.ytsaurus.tech.yaml +++ b/ytop-chart/templates/crds/chyts.cluster.ytsaurus.tech.yaml @@ -51,6 +51,10 @@ spec: spec: description: ChytSpec defines the desired state of Chyt properties: + createPublicClique: + description: Create ch_public clique, which is used by default when + running CHYT queries. + type: boolean image: type: string imagePullSecrets: @@ -69,6 +73,7 @@ spec: type: array makeDefault: default: false + description: Mark specified image as default for cliques. type: boolean ytsaurus: description: |-