-
Notifications
You must be signed in to change notification settings - Fork 423
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
Docs: Update config.go comments #1636
Draft
aimeeu
wants to merge
6
commits into
main
Choose a base branch
from
updateConfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b1fb89e
Docs: Update config yaml comments
aimeeu 2ca4607
add comments of Policies, NetworkPolicies
aimeeu ef9d797
add to backing store structs
aimeeu d2b5483
more updates
aimeeu ec176f1
Merge branch 'main' into updateConfig
aimeeu d57bd3f
fix spacing in a couple of comments
aimeeu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,7 +368,7 @@ type Plugins struct { | |
// ImagePullPolicy is the pull policy to use for the container image | ||
ImagePullPolicy string `json:"imagePullPolicy,omitempty"` | ||
|
||
// Config is the plugin config to use. This can be arbitrary config used for the plugin. | ||
// Config is the plugin configuration and populates the PLUGIN_CONFIG variable that the plugin reads. This can be arbitrary config and has no specific format. | ||
Config map[string]interface{} `json:"config,omitempty"` | ||
|
||
// RBAC holds additional rbac configuration for the plugin | ||
|
@@ -383,7 +383,7 @@ type Plugins struct { | |
// SecurityContext is the container security context used for the init container | ||
SecurityContext map[string]interface{} `json:"securityContext,omitempty"` | ||
|
||
// Resources are the container resources used for the init container | ||
// Resources are the container resources used for the init container. This doesn't change the Syncer's resource requests. Configure controlePlane.statefulSet.resources to ensure deployment has enough resources to run the plugin | ||
Resources map[string]interface{} `json:"resources,omitempty"` | ||
|
||
// VolumeMounts are extra volume mounts for the init container | ||
|
@@ -678,7 +678,7 @@ type EtcdDeploy struct { | |
// Enabled defines that an external etcd should be deployed. | ||
Enabled bool `json:"enabled,omitempty"` | ||
|
||
// StatefulSet holds options for the external etcd statefulSet. | ||
// Options for the external etcd StatefulSet. See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/stateful-set-v1/ | ||
StatefulSet EtcdDeployStatefulSet `json:"statefulSet,omitempty"` | ||
|
||
// Service holds options for the external etcd service. | ||
|
@@ -763,46 +763,47 @@ type HostPathMapper struct { | |
} | ||
|
||
type CoreDNS struct { | ||
// Enabled defines if coredns is enabled | ||
// Enabled defines if CoreDNS is enabled | ||
Enabled bool `json:"enabled,omitempty"` | ||
|
||
// Embedded defines if vCluster will start the embedded coredns service | ||
// Embedded defines if vCluster will start the embedded CoreDNS service | ||
Embedded bool `json:"embedded,omitempty" product:"pro"` | ||
|
||
// Service holds extra options for the coredns service deployed within the virtual cluster | ||
// Service holds extra options for the CoreDNS service deployed within the virtual cluster | ||
Service CoreDNSService `json:"service,omitempty"` | ||
|
||
// Deployment holds extra options for the coredns deployment deployed within the virtual cluster | ||
|
||
// Deployment holds extra options for the CoreDNS deployment deployed within the virtual cluster. | ||
// Customize the CoreDNS Deployment spec, metadata.labels, and metadata.annotations. | ||
Deployment CoreDNSDeployment `json:"deployment,omitempty"` | ||
|
||
// OverwriteConfig can be used to overwrite the coredns config | ||
// Overwrite default config. Path to a custom Corefile. See https://coredns.io/2017/07/23/corefile-explained/. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
OverwriteConfig string `json:"overwriteConfig,omitempty"` | ||
|
||
// OverwriteManifests can be used to overwrite the coredns manifests used to deploy coredns | ||
// OverwriteManifests can be used to overwrite the CoreDNS manifests used to deploy CoreDNS. When used, coredns.deployment is ignored. | ||
OverwriteManifests string `json:"overwriteManifests,omitempty"` | ||
} | ||
|
||
type CoreDNSService struct { | ||
// Spec holds extra options for the coredns service | ||
// Spec holds extra options for the CoreDNS service | ||
Spec map[string]interface{} `json:"spec,omitempty"` | ||
|
||
LabelsAndAnnotations `json:",inline"` | ||
} | ||
|
||
type CoreDNSDeployment struct { | ||
// Image is the coredns image to use | ||
// Image is the CoreDNS image to use | ||
Image string `json:"image,omitempty"` | ||
|
||
// Replicas is the amount of coredns pods to run. | ||
// Replicas is the amount of CoreDNS pods to run. | ||
Replicas int `json:"replicas,omitempty"` | ||
|
||
// NodeSelector is the node selector to use for coredns. | ||
// NodeSelector is the node selector to use for CoreDNS. | ||
NodeSelector map[string]string `json:"nodeSelector,omitempty"` | ||
|
||
// Resources are the desired resources for coredns. | ||
// Resources are the desired resources for CoreDNS. | ||
Resources Resources `json:"resources,omitempty"` | ||
|
||
// Pods is additional metadata for the coredns pods. | ||
// Pods is additional metadata for the CoreDNS pods. | ||
Pods LabelsAndAnnotations `json:"pods,omitempty"` | ||
|
||
LabelsAndAnnotations `json:",inline"` | ||
|
@@ -870,7 +871,7 @@ type ControlPlaneAdvanced struct { | |
// upload all required vCluster images to a single private repository and set this value. Workload images are not affected by this. | ||
DefaultImageRegistry string `json:"defaultImageRegistry,omitempty"` | ||
|
||
// VirtualScheduler defines if a scheduler should be used within the virtual cluster or the scheduling decision for workloads will be made by the host cluster. | ||
// Defines if a scheduler should be used within the virtual cluster or the scheduling decision for workloads will be made by the host cluster. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
VirtualScheduler EnableSwitch `json:"virtualScheduler,omitempty"` | ||
|
||
// ServiceAccount specifies options for the vCluster control plane service account. | ||
|
@@ -1077,13 +1078,17 @@ type Policies struct { | |
// NetworkPolicy specifies network policy options. | ||
NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` | ||
|
||
// PodSecurityStandard that can be enforced can be one of: empty (""), baseline, restricted or privileged | ||
// PodSecurityStandard that can be enforced can be one of: empty (""), baseline, restricted or privileged. | ||
// See https://kubernetes.io/docs/concepts/security/pod-security-standards/. | ||
PodSecurityStandard string `json:"podSecurityStandard,omitempty"` | ||
|
||
// ResourceQuota specifies resource quota options. | ||
|
||
// Specify ResourceQuota options. See https://kubernetes.io/docs/concepts/policy/resource-quotas/. | ||
// Resource quotas are enforced by the host cluster and only apply to resources synced to the host cluster. | ||
ResourceQuota ResourceQuota `json:"resourceQuota,omitempty"` | ||
|
||
// LimitRange specifies limit range options. | ||
|
||
// Specify LimitRange options. See https://kubernetes.io/docs/concepts/policy/limit-range/. | ||
// vCluster creates a LimitRange resource in the same namespace as vCluster itself. | ||
// LimitRange only applies to synced resources such as pods. | ||
LimitRange LimitRange `json:"limitRange,omitempty"` | ||
|
||
// CentralAdmission defines what validating or mutating webhooks should be enforced within the virtual cluster. | ||
|
@@ -1097,10 +1102,12 @@ type ResourceQuota struct { | |
// Quota are the quota options | ||
Quota map[string]interface{} `json:"quota,omitempty"` | ||
|
||
// ScopeSelector is the resource quota scope selector | ||
// ScopeSelector is the resource quota scope selector. | ||
// See https://kubernetes.io/docs/concepts/policy/resource-quotas/#quota-scopes. | ||
ScopeSelector ScopeSelector `json:"scopeSelector,omitempty"` | ||
|
||
// Scopes are the resource quota scopes | ||
// See https://kubernetes.io/docs/concepts/policy/resource-quotas/#quota-scopes. | ||
Scopes []string `json:"scopes,omitempty"` | ||
|
||
LabelsAndAnnotations `json:",inline"` | ||
|
@@ -1126,13 +1133,15 @@ type LabelSelectorRequirement struct { | |
} | ||
|
||
type LimitRange struct { | ||
// Enabled defines if the limit range should be deployed by vCluster. | ||
// Enabled defines if vCluster should deploy the LimitRange resource. | ||
Enabled bool `json:"enabled,omitempty"` | ||
|
||
// Default are the default limits for the limit range | ||
|
||
// Default are the default limits for the LimitRange resource. | ||
// See https://kubernetes.io/docs/concepts/policy/limit-range/. | ||
Default map[string]interface{} `json:"default,omitempty"` | ||
|
||
// DefaultRequest are the default request options for the limit range | ||
// DefaultRequest are the default request options for the LimitRange resource. | ||
// See https://kubernetes.io/docs/concepts/policy/limit-range/. | ||
DefaultRequest map[string]interface{} `json:"defaultRequest,omitempty"` | ||
|
||
LabelsAndAnnotations `json:",inline"` | ||
|
@@ -1141,7 +1150,9 @@ type LimitRange struct { | |
type NetworkPolicy struct { | ||
// Enabled defines if the network policy should be deployed by vCluster. | ||
Enabled bool `json:"enabled,omitempty"` | ||
|
||
|
||
// The IP address of a DNS server to fall back to if the vCluster's DNS server is | ||
// not able to resolve the hostname. | ||
FallbackDNS string `json:"fallbackDns,omitempty"` | ||
OutgoingConnections OutgoingConnections `json:"outgoingConnections,omitempty"` | ||
|
||
|
@@ -1155,6 +1166,11 @@ type OutgoingConnections struct { | |
IPBlock IPBlock `json:"ipBlock,omitempty"` | ||
} | ||
|
||
|
||
// IPBlock describes a particular CIDR (Ex. "192.168.1.0/24","2001:db8::/64") that is allowed | ||
// to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs | ||
// that should not be included within this rule. | ||
// See https://kubernetes.io/docs/concepts/services-networking/network-policies/ | ||
type IPBlock struct { | ||
// cidr is a string representing the IPBlock | ||
// Valid examples are "192.168.1.0/24" or "2001:db8::/64" | ||
|
@@ -1345,10 +1361,10 @@ type RBACRole struct { | |
// Enabled defines if the role should be enabled or disabled. | ||
Enabled bool `json:"enabled,omitempty"` | ||
|
||
// ExtraRules will add rules to the role. | ||
// ExtraRules will add rules to the role. Configure these to add additional permissions. | ||
ExtraRules []map[string]interface{} `json:"extraRules,omitempty"` | ||
|
||
// OverwriteRules will overwrite the role rules completely. | ||
// OverwriteRules will overwrite the role rules completely. Use this when you want complete control over vCluster's permissions. | ||
OverwriteRules []map[string]interface{} `json:"overwriteRules,omitempty"` | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: go comments prefer to start the comment with the name of the exported field/type/func. Or at least mention the name in the first sentence. See: https://go.dev/doc/comment#type
This already applies to most of the fields here. So it might be good to stick with this keeping it consistent, WDYT?