Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating from product:pro to tier:pro in config.go #1697

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"hostPathMapper": {
"$ref": "#/$defs/HostPathMapper",
"description": "HostPathMapper defines if vCluster should rewrite host paths.",
"description": "HostPathMapper defines if vCluster should rewrite host paths. This is a Pro feature since central is a Pro feature and we don't recommend using HostPathMapper without central.",
"pro": true
},
"ingress": {
Expand Down Expand Up @@ -517,7 +517,7 @@
},
"embedded": {
"type": "boolean",
"description": "Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a PRO feature.",
"description": "Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a Pro feature.",
"pro": true
},
"service": {
Expand Down Expand Up @@ -913,7 +913,7 @@
"properties": {
"embedded": {
"$ref": "#/$defs/EtcdEmbedded",
"description": "Embedded defines to use embedded etcd as a storage backend for the virtual cluster",
"description": "Embedded defines to use embedded etcd as a storage backend for the virtual cluster. This is a Pro feature.",
"pro": true
},
"deploy": {
Expand Down Expand Up @@ -1054,8 +1054,7 @@
"properties": {
"enabled": {
"type": "boolean",
"description": "Enabled defines if the embedded etcd should be used.",
"pro": true
"description": "Enabled defines if the embedded etcd should be used."
},
"migrateFromDeployedEtcd": {
"type": "boolean",
Expand Down Expand Up @@ -1085,7 +1084,7 @@
},
"isolatedControlPlane": {
"$ref": "#/$defs/ExperimentalIsolatedControlPlane",
"description": "IsolatedControlPlane is a feature to run the vCluster control plane in a different Kubernetes cluster than the workloads themselves.",
"description": "IsolatedControlPlane is a feature to run the vCluster control plane in a different Kubernetes cluster than the workloads themselves. This is a Pro feature.",
"pro": true
},
"virtualClusterKubeConfig": {
Expand All @@ -1097,7 +1096,7 @@
"$ref": "#/$defs/DenyRule"
},
"type": "array",
"description": "DenyProxyRequests denies certain requests in the vCluster proxy.",
"description": "DenyProxyRequests denies certain requests in the vCluster proxy. This is a Pro feature.",
"pro": true
}
},
Expand Down Expand Up @@ -1280,12 +1279,12 @@
"properties": {
"disableSync": {
"type": "boolean",
"description": "DisableSync will not sync any resources and disable most control plane functionality.",
"description": "DisableSync will not sync any resources and disable most control plane functionality. This is a Pro feature.",
"pro": true
},
"rewriteKubernetesService": {
"type": "boolean",
"description": "RewriteKubernetesService will rewrite the Kubernetes service to point to the vCluster service if disableSync is enabled",
"description": "RewriteKubernetesService will rewrite the Kubernetes service to point to the vCluster service if disableSync is enabled. This is a Pro feature.",
"pro": true
},
"targetNamespace": {
Expand Down Expand Up @@ -1799,7 +1798,7 @@
"$ref": "#/$defs/ResolveDNS"
},
"type": "array",
"description": "ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured.",
"description": "ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured. This is a Pro feature since embedded coredns is a Pro feature.",
"pro": true
},
"advanced": {
Expand Down Expand Up @@ -2214,7 +2213,7 @@
},
"centralAdmission": {
"$ref": "#/$defs/CentralAdmission",
"description": "CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster.",
"description": "CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster. This is a Pro feature.",
"pro": true
}
},
Expand Down
14 changes: 7 additions & 7 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ controlPlane:
caFile: ""
# Etcd defines that etcd should be used as the backend for the virtual cluster
etcd:
# Embedded defines to use embedded etcd as a storage backend for the virtual cluster
# Embedded defines to use embedded etcd as a storage backend for the virtual cluster. This is a Pro feature.
embedded:
# Enabled defines if the embedded etcd should be used.
enabled: false
Expand Down Expand Up @@ -408,7 +408,7 @@ controlPlane:
coredns:
# Enabled defines if coredns is enabled
enabled: true
# Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a PRO feature.
# Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a Pro feature.
embedded: false
# OverwriteManifests can be used to overwrite the coredns manifests used to deploy coredns
overwriteManifests: ""
Expand Down Expand Up @@ -665,7 +665,7 @@ networking:
# FromHost defines the services that should get synced from the host to the virtual cluster.
fromHost: []

# ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured.
# ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured. This is a Pro feature since embedded coredns is a Pro feature.
resolveDNS: []

# Advanced holds advanced network options.
Expand Down Expand Up @@ -759,7 +759,7 @@ policies:
- 172.16.0.0/12
- 192.168.0.0/16

# CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster.
# CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster. This is a Pro feature.
centralAdmission:
# ValidatingWebhooks are validating webhooks that should be enforced in the virtual cluster
validatingWebhooks: []
Expand Down Expand Up @@ -796,16 +796,16 @@ experimental:

# SyncSettings are advanced settings for the syncer controller.
syncSettings:
# DisableSync will not sync any resources and disable most control plane functionality.
# DisableSync will not sync any resources and disable most control plane functionality. This is a Pro feature.
disableSync: false
# RewriteKubernetesService will rewrite the Kubernetes service to point to the vCluster service if disableSync is enabled
# RewriteKubernetesService will rewrite the Kubernetes service to point to the vCluster service if disableSync is enabled. This is a Pro feature.
rewriteKubernetesService: false
# TargetNamespace is the namespace where the workloads should get synced to.
targetNamespace: ""
# SetOwner specifies if vCluster should set an owner reference on the synced objects to the vCluster service. This allows for easy garbage collection.
setOwner: true

# IsolatedControlPlane is a feature to run the vCluster control plane in a different Kubernetes cluster than the workloads themselves.
# IsolatedControlPlane is a feature to run the vCluster control plane in a different Kubernetes cluster than the workloads themselves. This is a Pro feature.
isolatedControlPlane:
# Headless states that Helm should deploy the vCluster in headless mode for the isolated control plane.
headless: false
Expand Down
64 changes: 30 additions & 34 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,15 @@ type Networking struct {
// ReplicateServices allows replicating services from the host within the virtual cluster or the other way around.
ReplicateServices ReplicateServices `json:"replicateServices,omitempty"`

// ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured.
ResolveDNS []ResolveDNS `json:"resolveDNS,omitempty" product:"pro"`
// ResolveDNS allows to define extra DNS rules. This only works if embedded coredns is configured. This is a Pro feature since embedded coredns is a Pro feature.
ResolveDNS []ResolveDNS `json:"resolveDNS,omitempty" tier:"pro"`

// Advanced holds advanced network options.
Advanced NetworkingAdvanced `json:"advanced,omitempty"`
}

func (n Networking) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(n))
addTierToJSONSchema(base, reflect.TypeOf(n))
}

type ReplicateServices struct {
Expand Down Expand Up @@ -561,8 +561,8 @@ type ControlPlane struct {
// Proxy defines options for the virtual cluster control plane proxy that is used to do authentication and intercept requests.
Proxy ControlPlaneProxy `json:"proxy,omitempty"`

// HostPathMapper defines if vCluster should rewrite host paths.
HostPathMapper HostPathMapper `json:"hostPathMapper,omitempty" product:"pro"`
// HostPathMapper defines if vCluster should rewrite host paths. This is a Pro feature since central is a Pro feature and we don't recommend using HostPathMapper without central.
HostPathMapper HostPathMapper `json:"hostPathMapper,omitempty" tier:"pro"`

// Ingress defines options for vCluster ingress deployed by Helm.
Ingress ControlPlaneIngress `json:"ingress,omitempty"`
Expand All @@ -581,7 +581,7 @@ type ControlPlane struct {
}

func (c ControlPlane) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(c))
addTierToJSONSchema(base, reflect.TypeOf(c))
}

type ControlPlaneStatefulSet struct {
Expand Down Expand Up @@ -798,29 +798,25 @@ type DatabaseKine struct {
}

type Etcd struct {
// Embedded defines to use embedded etcd as a storage backend for the virtual cluster
Embedded EtcdEmbedded `json:"embedded,omitempty" product:"pro"`
// Embedded defines to use embedded etcd as a storage backend for the virtual cluster. This is a Pro feature.
Embedded EtcdEmbedded `json:"embedded,omitempty" tier:"pro"`

// Deploy defines to use an external etcd that is deployed by the helm chart
Deploy EtcdDeploy `json:"deploy,omitempty"`
}

func (e Etcd) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(e))
addTierToJSONSchema(base, reflect.TypeOf(e))
}

type EtcdEmbedded struct {
// Enabled defines if the embedded etcd should be used.
Enabled bool `json:"enabled,omitempty" product:"pro"`
Enabled bool `json:"enabled,omitempty"`

// MigrateFromDeployedEtcd signals that vCluster should migrate from the deployed external etcd to embedded etcd.
MigrateFromDeployedEtcd bool `json:"migrateFromDeployedEtcd,omitempty"`
}

func (e EtcdEmbedded) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(e))
}

type EtcdDeploy struct {
// Enabled defines that an external etcd should be deployed.
Enabled bool `json:"enabled,omitempty"`
Expand Down Expand Up @@ -913,8 +909,8 @@ type CoreDNS struct {
// Enabled defines if coredns is enabled
Enabled bool `json:"enabled,omitempty"`

// Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a PRO feature.
Embedded bool `json:"embedded,omitempty" product:"pro"`
// Embedded defines if vCluster will start the embedded coredns service within the control-plane and not as a separate deployment. This is a Pro feature.
Embedded bool `json:"embedded,omitempty" tier:"pro"`

// Service holds extra options for the coredns service deployed within the virtual cluster
Service CoreDNSService `json:"service,omitempty"`
Expand All @@ -930,7 +926,7 @@ type CoreDNS struct {
}

func (c CoreDNS) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(c))
addTierToJSONSchema(base, reflect.TypeOf(c))
}

type CoreDNSService struct {
Expand Down Expand Up @@ -1237,12 +1233,12 @@ type Policies struct {
// LimitRange specifies limit range options.
LimitRange LimitRange `json:"limitRange,omitempty"`

// CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster.
CentralAdmission CentralAdmission `json:"centralAdmission,omitempty" product:"pro"`
// CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster. This is a Pro feature.
CentralAdmission CentralAdmission `json:"centralAdmission,omitempty" tier:"pro"`
}

func (p Policies) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(p))
addTierToJSONSchema(base, reflect.TypeOf(p))
}

type ResourceQuota struct {
Expand Down Expand Up @@ -1526,18 +1522,18 @@ type Experimental struct {
// MultiNamespaceMode tells virtual cluster to sync to multiple namespaces instead of a single one. This will map each virtual cluster namespace to a single namespace in the host cluster.
MultiNamespaceMode ExperimentalMultiNamespaceMode `json:"multiNamespaceMode,omitempty"`

// IsolatedControlPlane is a feature to run the vCluster control plane in a different Kubernetes cluster than the workloads themselves.
IsolatedControlPlane ExperimentalIsolatedControlPlane `json:"isolatedControlPlane,omitempty" product:"pro"`
// IsolatedControlPlane is a feature to run the vCluster control plane in a different Kubernetes cluster than the workloads themselves. This is a Pro feature.
IsolatedControlPlane ExperimentalIsolatedControlPlane `json:"isolatedControlPlane,omitempty" tier:"pro"`

// VirtualClusterKubeConfig allows you to override distro specifics and specify where vCluster will find the required certificates and vCluster config.
VirtualClusterKubeConfig VirtualClusterKubeConfig `json:"virtualClusterKubeConfig,omitempty"`

// DenyProxyRequests denies certain requests in the vCluster proxy.
DenyProxyRequests []DenyRule `json:"denyProxyRequests,omitempty" product:"pro"`
// DenyProxyRequests denies certain requests in the vCluster proxy. This is a Pro feature.
DenyProxyRequests []DenyRule `json:"denyProxyRequests,omitempty" tier:"pro"`
}

func (e Experimental) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(e))
addTierToJSONSchema(base, reflect.TypeOf(e))
}

type ExperimentalMultiNamespaceMode struct {
Expand All @@ -1550,7 +1546,7 @@ type ExperimentalMultiNamespaceMode struct {

type ExperimentalIsolatedControlPlane struct {
// Enabled specifies if the isolated control plane feature should be enabled.
Enabled bool `json:"enabled,omitempty" product:"pro"`
Enabled bool `json:"enabled,omitempty"`

// Headless states that Helm should deploy the vCluster in headless mode for the isolated control plane.
Headless bool `json:"headless,omitempty"`
Expand All @@ -1566,11 +1562,11 @@ type ExperimentalIsolatedControlPlane struct {
}

type ExperimentalSyncSettings struct {
// DisableSync will not sync any resources and disable most control plane functionality.
DisableSync bool `json:"disableSync,omitempty" product:"pro"`
// DisableSync will not sync any resources and disable most control plane functionality. This is a Pro feature.
DisableSync bool `json:"disableSync,omitempty" tier:"pro"`

// RewriteKubernetesService will rewrite the Kubernetes service to point to the vCluster service if disableSync is enabled
RewriteKubernetesService bool `json:"rewriteKubernetesService,omitempty" product:"pro"`
// RewriteKubernetesService will rewrite the Kubernetes service to point to the vCluster service if disableSync is enabled. This is a Pro feature.
RewriteKubernetesService bool `json:"rewriteKubernetesService,omitempty" tier:"pro"`

// TargetNamespace is the namespace where the workloads should get synced to.
TargetNamespace string `json:"targetNamespace,omitempty"`
Expand All @@ -1589,7 +1585,7 @@ type ExperimentalSyncSettings struct {
}

func (e ExperimentalSyncSettings) JSONSchemaExtend(base *jsonschema.Schema) {
addProToJSONSchema(base, reflect.TypeOf(e))
addTierToJSONSchema(base, reflect.TypeOf(e))
}

type ExperimentalDeploy struct {
Expand Down Expand Up @@ -1874,12 +1870,12 @@ type RuleWithVerbs struct {
Verbs []string `json:"operations,omitempty"`
}

// addProToJSONSchema looks for fields with the `product:"pro"` tag and adds the pro tag to the central field.
// addTierToJSONSchema looks for fields with the `tier:"pro"` tag and adds the tier tag to the central field.
// Requires `json:""` tag to be set as well.
func addProToJSONSchema(base *jsonschema.Schema, t reflect.Type) {
func addTierToJSONSchema(base *jsonschema.Schema, t reflect.Type) {
proFields := []string{}
for i := 0; i < t.NumField(); i++ {
tag := t.Field(i).Tag.Get("product")
tag := t.Field(i).Tag.Get("tier")
jsonName := strings.Split(t.Field(i).Tag.Get("json"), ",")[0]
if tag == "" {
continue
Expand Down
Loading