Skip to content

Commit

Permalink
Revert "ssp: Remove tekton from SSP object and documentation (kubevir…
Browse files Browse the repository at this point in the history
…t#2881)"

This reverts commit 35f75dc.

Most of the change should not be in the current version.
The tekton feature gate should still be propagated to SSP.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
  • Loading branch information
akrejcir committed Apr 29, 2024
1 parent bc69bbf commit 221c8e5
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 42 deletions.
6 changes: 0 additions & 6 deletions api/v1beta1/hyperconverged_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,11 @@ type HyperConvergedSpec struct {
// TektonPipelinesNamespace defines namespace in which example pipelines will be deployed.
// If unset, then the default value is the operator namespace.
// +optional
// +kubebuilder:deprecatedversion:warning="tektonPipelinesNamespace field is ignored"
// Deprecated: This field is ignored.
TektonPipelinesNamespace *string `json:"tektonPipelinesNamespace,omitempty"`

// TektonTasksNamespace defines namespace in which tekton tasks will be deployed.
// If unset, then the default value is the operator namespace.
// +optional
// +kubebuilder:deprecatedversion:warning="tektonTasksNamespace field is ignored"
// Deprecated: This field is ignored.
TektonTasksNamespace *string `json:"tektonTasksNamespace,omitempty"`

// KubeSecondaryDNSNameServerIP defines name server IP used by KubeSecondaryDNS
Expand Down Expand Up @@ -423,8 +419,6 @@ type HyperConvergedFeatureGates struct {
// +optional
// +kubebuilder:default=false
// +default=false
// +kubebuilder:deprecatedversion:warning="deployTektonTaskResources feature gate ignored"
// Deprecated: This field is ignored.
DeployTektonTaskResources *bool `json:"deployTektonTaskResources,omitempty"`

// deploy VM console proxy resources in SSP operator
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions config/crd/bases/hco.kubevirt.io_hyperconvergeds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,8 @@ spec:
type: boolean
deployTektonTaskResources:
default: false
description: |-
deploy resources (kubevirt tekton tasks and example pipelines) in SSP operator
Deprecated: This field is ignored.
description: deploy resources (kubevirt tekton tasks and example
pipelines) in SSP operator
type: boolean
deployVmConsoleProxy:
default: false
Expand Down Expand Up @@ -2670,13 +2669,11 @@ spec:
description: |-
TektonPipelinesNamespace defines namespace in which example pipelines will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tektonTasksNamespace:
description: |-
TektonTasksNamespace defines namespace in which tekton tasks will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tlsSecurityProfile:
description: |-
Expand Down
4 changes: 3 additions & 1 deletion controllers/hyperconverged/hyperconverged_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ var _ = Describe("HyperconvergedController", func() {

hco := commontestutils.NewHco()
hco.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
WithHostPassthroughCPU: ptr.To(true),
WithHostPassthroughCPU: ptr.To(true),
DeployTektonTaskResources: ptr.To(true),
}

ci := hcoutil.GetClusterInfo()
Expand Down Expand Up @@ -260,6 +261,7 @@ var _ = Describe("HyperconvergedController", func() {
hco := commontestutils.NewHco()
hco.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
WithHostPassthroughCPU: ptr.To(true),
DeployTektonTaskResources: ptr.To(true),
EnableManagedTenantQuota: ptr.To(true),
EnableApplicationAwareQuota: ptr.To(true),
}
Expand Down
22 changes: 22 additions & 0 deletions controllers/operands/ssp.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ func NewSSP(hc *hcov1beta1.HyperConverged, opts ...string) (*sspv1beta2.SSP, []h
// causing nil pointers dereferences at the DeepCopyInto() below.
TLSSecurityProfile: hcoutil.GetClusterInfo().GetTLSSecurityProfile(hc.Spec.TLSSecurityProfile),
FeatureGates: &sspv1beta2.FeatureGates{},
TektonPipelines: &sspv1beta2.TektonPipelines{},
TektonTasks: &sspv1beta2.TektonTasks{},
}

if hc.Spec.FeatureGates.DeployTektonTaskResources != nil {
spec.FeatureGates.DeployTektonTaskResources = *hc.Spec.FeatureGates.DeployTektonTaskResources
}

if hc.Spec.FeatureGates.DeployVMConsoleProxy != nil {
Expand All @@ -164,6 +170,22 @@ func NewSSP(hc *hcov1beta1.HyperConverged, opts ...string) (*sspv1beta2.SSP, []h
// Disable common-instancetypes deployment by SSP from 4.16, now handled by virt-operator
spec.FeatureGates.DeployCommonInstancetypes = ptr.To(false)

// Default value is the operator namespace
pipelinesNamespace := getNamespace(hc.Namespace, opts)
if hc.Spec.TektonPipelinesNamespace != nil {
pipelinesNamespace = *hc.Spec.TektonPipelinesNamespace
}

spec.TektonPipelines.Namespace = pipelinesNamespace

// Default value is the operator namespace
tasksNamespace := getNamespace(hc.Namespace, opts)
if hc.Spec.TektonTasksNamespace != nil {
tasksNamespace = *hc.Spec.TektonTasksNamespace
}

spec.TektonTasks.Namespace = tasksNamespace

if hc.Spec.Infra.NodePlacement != nil {
spec.TemplateValidator.Placement = hc.Spec.Infra.NodePlacement.DeepCopy()
}
Expand Down
7 changes: 2 additions & 5 deletions deploy/crds/hco00.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,8 @@ spec:
type: boolean
deployTektonTaskResources:
default: false
description: |-
deploy resources (kubevirt tekton tasks and example pipelines) in SSP operator
Deprecated: This field is ignored.
description: deploy resources (kubevirt tekton tasks and example
pipelines) in SSP operator
type: boolean
deployVmConsoleProxy:
default: false
Expand Down Expand Up @@ -2670,13 +2669,11 @@ spec:
description: |-
TektonPipelinesNamespace defines namespace in which example pipelines will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tektonTasksNamespace:
description: |-
TektonTasksNamespace defines namespace in which tekton tasks will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tlsSecurityProfile:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,8 @@ spec:
type: boolean
deployTektonTaskResources:
default: false
description: |-
deploy resources (kubevirt tekton tasks and example pipelines) in SSP operator
Deprecated: This field is ignored.
description: deploy resources (kubevirt tekton tasks and example
pipelines) in SSP operator
type: boolean
deployVmConsoleProxy:
default: false
Expand Down Expand Up @@ -2670,13 +2669,11 @@ spec:
description: |-
TektonPipelinesNamespace defines namespace in which example pipelines will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tektonTasksNamespace:
description: |-
TektonTasksNamespace defines namespace in which tekton tasks will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tlsSecurityProfile:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,8 @@ spec:
type: boolean
deployTektonTaskResources:
default: false
description: |-
deploy resources (kubevirt tekton tasks and example pipelines) in SSP operator
Deprecated: This field is ignored.
description: deploy resources (kubevirt tekton tasks and example
pipelines) in SSP operator
type: boolean
deployVmConsoleProxy:
default: false
Expand Down Expand Up @@ -2670,13 +2669,11 @@ spec:
description: |-
TektonPipelinesNamespace defines namespace in which example pipelines will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tektonTasksNamespace:
description: |-
TektonTasksNamespace defines namespace in which tekton tasks will be deployed.
If unset, then the default value is the operator namespace.
Deprecated: This field is ignored.
type: string
tlsSecurityProfile:
description: |-
Expand Down
6 changes: 3 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ HyperConvergedFeatureGates is a set of optional feature gates to enable or disab
| downwardMetrics | Allow to expose a limited set of host metrics to guests. | *bool | false | false |
| withHostPassthroughCPU | Allow migrating a virtual machine with CPU host-passthrough mode. This should be enabled only when the Cluster is homogeneous from CPU HW perspective doc here | *bool | false | false |
| enableCommonBootImageImport | Opt-in to automatic delivery/updates of the common data import cron templates. There are two sources for the data import cron templates: hard coded list of common templates, and custom templates that can be added to the dataImportCronTemplates field. This feature gates only control the common templates. It is possible to use custom templates by adding them to the dataImportCronTemplates field. | *bool | true | false |
| deployTektonTaskResources | deploy resources (kubevirt tekton tasks and example pipelines) in SSP operator Deprecated: This field is ignored. | *bool | false | false |
| deployTektonTaskResources | deploy resources (kubevirt tekton tasks and example pipelines) in SSP operator | *bool | false | false |
| deployVmConsoleProxy | deploy VM console proxy resources in SSP operator | *bool | false | false |
| deployKubeSecondaryDNS | Deploy KubeSecondaryDNS by CNAO | *bool | false | false |
| nonRoot | Enables rootless virt-launcher.\n\nDeprecated: please use the root FG. | *bool | true | false |
Expand Down Expand Up @@ -218,8 +218,8 @@ HyperConvergedSpec defines the desired state of HyperConverged
| uninstallStrategy | UninstallStrategy defines how to proceed on uninstall when workloads (VirtualMachines, DataVolumes) still exist. BlockUninstallIfWorkloadsExist will prevent the CR from being removed when workloads still exist. BlockUninstallIfWorkloadsExist is the safest choice to protect your workloads from accidental data loss, so it's strongly advised. RemoveWorkloads will cause all the workloads to be cascading deleted on uninstallation. WARNING: please notice that RemoveWorkloads will cause your workloads to be deleted as soon as this CR will be, even accidentally, deleted. Please correctly consider the implications of this option before setting it. BlockUninstallIfWorkloadsExist is the default behaviour. | HyperConvergedUninstallStrategy | BlockUninstallIfWorkloadsExist | false |
| logVerbosityConfig | LogVerbosityConfig configures the verbosity level of Kubevirt's different components. The higher the value - the higher the log verbosity. | *[LogVerbosityConfiguration](#logverbosityconfiguration) | | false |
| tlsSecurityProfile | TLSSecurityProfile specifies the settings for TLS connections to be propagated to all kubevirt-hyperconverged components. If unset, the hyperconverged cluster operator will consume the value set on the APIServer CR on OCP/OKD or Intermediate if on vanilla k8s. Note that only Old, Intermediate and Custom profiles are currently supported, and the maximum available MinTLSVersions is VersionTLS12. | *openshiftconfigv1.TLSSecurityProfile | | false |
| tektonPipelinesNamespace | TektonPipelinesNamespace defines namespace in which example pipelines will be deployed. If unset, then the default value is the operator namespace. Deprecated: This field is ignored. | *string | | false |
| tektonTasksNamespace | TektonTasksNamespace defines namespace in which tekton tasks will be deployed. If unset, then the default value is the operator namespace. Deprecated: This field is ignored. | *string | | false |
| tektonPipelinesNamespace | TektonPipelinesNamespace defines namespace in which example pipelines will be deployed. If unset, then the default value is the operator namespace. | *string | | false |
| tektonTasksNamespace | TektonTasksNamespace defines namespace in which tekton tasks will be deployed. If unset, then the default value is the operator namespace. | *string | | false |
| kubeSecondaryDNSNameServerIP | KubeSecondaryDNSNameServerIP defines name server IP used by KubeSecondaryDNS | *string | | false |
| evictionStrategy | EvictionStrategy defines at the cluster level if the VirtualMachineInstance should be migrated instead of shut-off in case of a node drain. If the VirtualMachineInstance specific field is set it overrides the cluster level one. Allowed values: - `None` no eviction strategy at cluster level. - `LiveMigrate` migrate the VM on eviction; a not live migratable VM with no specific strategy will block the drain of the node util manually evicted. - `LiveMigrateIfPossible` migrate the VM on eviction if live migration is possible, otherwise directly evict. - `External` block the drain, track eviction and notify an external controller. Defaults to LiveMigrate with multiple worker nodes, None on single worker clusters. | *v1.EvictionStrategy | | false |
| vmStateStorageClass | VMStateStorageClass is the name of the storage class to use for the PVCs created to preserve VM state, like TPM. The storage class must support RWX in filesystem mode. | *string | | false |
Expand Down
9 changes: 9 additions & 0 deletions docs/cluster-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ the [dataImportCronTemplates field](#configure-custom-golden-images), even if th

**Default**: `true`

### deployTektonTaskResources Feature Gate
Set the `deployTektonTaskResources` feature gate to true to allow SSP operator to deploy its resources. SSP operator will
deploy example pipelines and tasks which enables tekton to work with VMs, disks and common-templates.

**Note**: Once `deployTektonTaskResources` is set to true, SSP operator will not delete deployed resources if `deployTektonTaskResources` is
reverted back to false.

**Default**: `false`

### deployVmConsoleProxy Feature Gate
Set the `deployVmConsoleProxy` feature gate to true to allow SSP operator to deploy its resources. SSP operator will
deploy a proxy that provides an access to the VNC console of a KubeVirt Virtual Machine (VM).
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 221c8e5

Please sign in to comment.