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

fix typos #3618

Merged
merged 1 commit into from
Jun 2, 2023
Merged
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
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We hope that the items listed below will inspire further engagement from the com
- Multi-cluster HPA (Horizontal Pod Autoscaling)
- Karmada operator
- ResourceInterpreter include third-party CRD resources
- Karmada playgroud
- Karmada playground
Vacant2333 marked this conversation as resolved.
Show resolved Hide resolved

## 2023 H2
- Karmada Dashboard - alpha release
Expand Down
4 changes: 2 additions & 2 deletions operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Karmada operator is a method for installing, upgrading, and deleting Karmada instances.
It builds upon the basic Karmada resource and controller concepts, provides convenience to
centrally manage entire lifecyle of Karmada instances in a global cluster. With the operator,
centrally manage entire lifecycle of Karmada instances in a global cluster. With the operator,
you can extend Karmada with custom resources (CRs) to manage your instances not only in local
clusters but also in remote clusters.

Expand Down Expand Up @@ -64,7 +64,7 @@ kubectl apply -f operator/config/crds/

### Create a Karmada instance

The Karmada operator provides a Karama CR that can define most configurations for Karmada components.
The Karmada operator provides a Karmada CR that can define most configurations for Karmada components.
It includes `image` messages, `replica`, the `args` of binary file, and custom `label`, `annotation`, and `featuregate`.
For details, see [API](./pkg/apis/operator/v1alpha1/type.go).

Expand Down
38 changes: 19 additions & 19 deletions operator/pkg/apis/operator/v1alpha1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ type KarmadaComponents struct {
// +optional
KarmadaScheduler *KarmadaScheduler `json:"karmadaScheduler,omitempty"`

// KarmadaWebhook holds settings to karmada-webook component of the karmada.
// KarmadaWebhook holds settings to karmada-webhook component of the karmada.
// +optional
KarmadaWebhook *KarmadaWebhook `json:"karmadaWebhook,omitempty"`

Expand Down Expand Up @@ -151,7 +151,7 @@ type LocalEtcd struct {
CommonSettings `json:",inline"`

// VolumeData describes the settings of etcd data store.
// We will support 3 modes: emtydir, hostPath, PVC. default by hostPath.
// We will support 3 modes: emptyDir, hostPath, PVC. default by hostPath.
// +optional
VolumeData *VolumeData `json:"volumeData,omitempty"`

Expand Down Expand Up @@ -191,7 +191,7 @@ type VolumeData struct {
}

// ExternalEtcd describes an external etcd cluster.
// operator has no knowledge of where certificate files live and they must be supplied.
// operator has no knowledge of where certificate files live, and they must be supplied.
type ExternalEtcd struct {
// Endpoints of etcd members. Required for ExternalEtcd.
Endpoints []string `json:"endpoints"`
Expand All @@ -210,7 +210,7 @@ type ExternalEtcd struct {
}

// KarmadaAPIServer holds settings to kube-apiserver component of the kubernetes.
// Karmada uses it as it's own apiserver in order to provide Kubernetes-native APIs.
// Karmada uses it as its own apiserver in order to provide Kubernetes-native APIs.
type KarmadaAPIServer struct {
// CommonSettings holds common settings to kubernetes api server.
CommonSettings `json:",inline"`
Expand All @@ -220,7 +220,7 @@ type KarmadaAPIServer struct {
ServiceSubnet *string `json:"serviceSubnet,omitempty"`

// ServiceType represents the service type of karmada apiserver.
// it is Nodeport by default.
// it is NodePort by default.
// +optional
ServiceType corev1.ServiceType `json:"serviceType,omitempty"`

Expand All @@ -231,7 +231,7 @@ type KarmadaAPIServer struct {
// Note: This is a temporary solution to allow for the configuration of the
// kube-apiserver component. In the future, we will provide a more structured way
// to configure the component. Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand Down Expand Up @@ -262,7 +262,7 @@ type KarmadaAggregatedAPIServer struct {
// Note: This is a temporary solution to allow for the configuration of the
// karmada-aggregated-apiserver component. In the future, we will provide a more structured way
// to configure the component. Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand Down Expand Up @@ -321,7 +321,7 @@ type KubeControllerManager struct {
// https://karmada.io/docs/administrator/configuration/configure-controllers#kubernetes-controllers
//
// Others are disabled by default. If you want to enable or disable other controllers, you
// have to explicitly specify all the controllers that kube-controller-manager shoud enable
// have to explicitly specify all the controllers that kube-controller-manager should enable
// at startup phase.
// +optional
Controllers []string `json:"controllers,omitempty"`
Expand All @@ -333,7 +333,7 @@ type KubeControllerManager struct {
// Note: This is a temporary solution to allow for the configuration of the
// kube-controller-manager component. In the future, we will provide a more structured way
// to configure the component. Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand Down Expand Up @@ -375,7 +375,7 @@ type KarmadaControllerManager struct {
// Note: This is a temporary solution to allow for the configuration of the
// karmada-controller-manager component. In the future, we will provide a more structured way
// to configure the component. Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand Down Expand Up @@ -406,7 +406,7 @@ type KarmadaScheduler struct {
// Note: This is a temporary solution to allow for the configuration of the karmada-scheduler
// component. In the future, we will provide a more structured way to configure the component.
// Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand Down Expand Up @@ -434,7 +434,7 @@ type KarmadaDescheduler struct {
// Note: This is a temporary solution to allow for the configuration of the karmada-descheduler
// component. In the future, we will provide a more structured way to configure the component.
// Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand All @@ -456,7 +456,7 @@ type KarmadaSearch struct {
// Note: This is a temporary solution to allow for the configuration of the karmada-descheduler
// component. In the future, we will provide a more structured way to configure the component.
// Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand All @@ -478,7 +478,7 @@ type KarmadaWebhook struct {
// Note: This is a temporary solution to allow for the configuration of the
// karmada-webhook component. In the future, we will provide a more structured way
// to configure the component. Once that is done, this field will be discouraged to be used.
// Incorrect settings on this feild maybe lead to the corresponding component in an unhealthy
// Incorrect settings on this field maybe lead to the corresponding component in an unhealthy
// state. Before you do it, please confirm that you understand the risks of this configuration.
//
// For supported flags, please see
Expand Down Expand Up @@ -553,19 +553,19 @@ type HostCluster struct {
Networking *Networking `json:"networking,omitempty"`
}

// ConditionType declarative karmada condition type of karmada installtion.
// ConditionType declarative karmada condition type of karmada installation.
type ConditionType string

const (
// Unknown represent a condition type the karmada not be reconciled by operator
// or unpredictable condition.
Unknown ConditionType = "Unknown"

// Ready represent a condition type the all installtion process to karmada have compaleted.
// Ready represent a condition type the all installation process to karmada have completed.
Ready ConditionType = "Ready"
)

// KarmadaStatus difine the most recently observed status of the Karmada.
// KarmadaStatus define the most recently observed status of the Karmada.
type KarmadaStatus struct {
// ObservedGeneration is the last observed generation.
// +optional
Expand All @@ -575,11 +575,11 @@ type KarmadaStatus struct {
// +optional
SecretRef *LocalSecretReference `json:"secretRef,omitempty"`

// KarmadaVersion represente the karmada version.
// KarmadaVersion represent the karmada version.
// +optional
KarmadaVersion string `json:"karmadaVersion,omitempty"`

// KubernetesVersion represente the karmada-apiserver version.
// KubernetesVersion represent the karmada-apiserver version.
// +optional
KubernetesVersion string `json:"kubernetesVersion,omitempty"`

Expand Down
4 changes: 2 additions & 2 deletions operator/pkg/certs/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (cert *KarmadaCert) KeyName() string {
return pair + keyExtension
}

// GeneratePrivateKey generates cert key with default size if 1024. it support
// GeneratePrivateKey generates cert key with default size if 1024. it supports
// ECDSA and RAS algorithm.
func GeneratePrivateKey(keyType x509.PublicKeyAlgorithm) (crypto.Signer, error) {
if keyType == x509.ECDSA {
Expand Down Expand Up @@ -391,7 +391,7 @@ func appendSANsToAltNames(altNames *certutil.AltNames, SANs []string) {
}
}

// EncodeCertPEM returns PEM-endcoded certificate data
// EncodeCertPEM returns PEM-encoded certificate data
func EncodeCertPEM(cert *x509.Certificate) []byte {
block := pem.Block{
Type: CertificateBlockType,
Expand Down
2 changes: 1 addition & 1 deletion operator/pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const (
// KarmadaDeschedulerComponent defines the name of the karmada-descheduler component
KarmadaDeschedulerComponent = "KarmadaDescheduler"

// KarmadaOperatorLabelKeyName defines a label key used by all of resources created by karmada operator
// KarmadaOperatorLabelKeyName defines a label key used by all resources created by karmada operator
KarmadaOperatorLabelKeyName = "app.kubernetes.io/managed-by"
)

Expand Down
6 changes: 3 additions & 3 deletions operator/pkg/controller/karmada/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/karmada-io/karmada/operator/pkg/workflow"
)

// Action is a intention corresponding karmada resource modification
// Action is an intention corresponding karmada resource modification
type Action string

const (
Expand All @@ -22,8 +22,8 @@ const (
DeInitAction Action = "deInit"
)

// Planner represents a planner to build a job woflow and startup it.
// the karmada resource change and enqueue is correspond to a action.
// Planner represents a planner to build a job workflow and startup it.
// the karmada resource change and enqueue is corresponded to an action.
// it will create different job workflow according to action.
type Planner struct {
action Action
Expand Down
4 changes: 2 additions & 2 deletions operator/pkg/controlplane/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func EnsureKarmadaAggregatedAPIServer(client clientset.Interface, cfg *operatorv
}

func installKarmadaAPIServer(client clientset.Interface, cfg *operatorv1alpha1.KarmadaAPIServer, name, namespace string) error {
apiserverDeploymentbytes, err := util.ParseTemplate(KarmadaApiserverDeployment, struct {
apiserverDeploymentBytes, err := util.ParseTemplate(KarmadaApiserverDeployment, struct {
DeploymentName, Namespace, Image, EtcdClientService string
ServiceSubnet, KarmadaCertsSecret, EtcdCertsSecret string
Replicas *int32
Expand All @@ -55,7 +55,7 @@ func installKarmadaAPIServer(client clientset.Interface, cfg *operatorv1alpha1.K
}

apiserverDeployment := &appsv1.Deployment{}
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), apiserverDeploymentbytes, apiserverDeployment); err != nil {
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), apiserverDeploymentBytes, apiserverDeployment); err != nil {
return fmt.Errorf("error when decoding karmadaApiserver deployment: %w", err)
}

Expand Down
8 changes: 4 additions & 4 deletions operator/pkg/controlplane/controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func getComponentManifests(name, namespace string, cfg *operatorv1alpha1.Karmada
}

func getKubeControllerManagerManifest(name, namespace string, cfg *operatorv1alpha1.KubeControllerManager) (*appsv1.Deployment, error) {
kubeControllerManageretBytes, err := util.ParseTemplate(KubeControllerManagerDeployment, struct {
kubeControllerManagerBytes, err := util.ParseTemplate(KubeControllerManagerDeployment, struct {
DeploymentName, Namespace, Image string
KarmadaCertsSecret, KubeconfigSecret string
Replicas *int32
Expand All @@ -84,7 +84,7 @@ func getKubeControllerManagerManifest(name, namespace string, cfg *operatorv1alp
}

kcm := &appsv1.Deployment{}
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), kubeControllerManageretBytes, kcm); err != nil {
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), kubeControllerManagerBytes, kcm); err != nil {
return nil, fmt.Errorf("err when decoding kube-controller-manager deployment: %w", err)
}

Expand All @@ -93,7 +93,7 @@ func getKubeControllerManagerManifest(name, namespace string, cfg *operatorv1alp
}

func getKarmadaControllerManagerManifest(name, namespace string, cfg *operatorv1alpha1.KarmadaControllerManager) (*appsv1.Deployment, error) {
karmadaControllerManageretBytes, err := util.ParseTemplate(KamradaControllerManagerDeployment, struct {
karmadaControllerManagerBytes, err := util.ParseTemplate(KamradaControllerManagerDeployment, struct {
Replicas *int32
DeploymentName, Namespace string
Image, KubeconfigSecret string
Expand All @@ -109,7 +109,7 @@ func getKarmadaControllerManagerManifest(name, namespace string, cfg *operatorv1
}

kcm := &appsv1.Deployment{}
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), karmadaControllerManageretBytes, kcm); err != nil {
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), karmadaControllerManagerBytes, kcm); err != nil {
return nil, fmt.Errorf("err when decoding karmada-controller-manager deployment: %w", err)
}

Expand Down
6 changes: 3 additions & 3 deletions operator/pkg/controlplane/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func EnsureKarmadaEtcd(client clientset.Interface, cfg *operatorv1alpha1.LocalEt

func installKarmadaEtcd(client clientset.Interface, name, namespace string, cfg *operatorv1alpha1.LocalEtcd) error {
// if the number of etcd is greater than one, we need to concatenate the peerURL for each member cluster.
// memberName is podName generated by etcd statefuleset: ${statefulsetName}-index
// memberName is podName generated by etcd statefulset: ${statefulsetName}-index
// memberPeerURL uses the etcd peer headless service name: ${podName}.${serviceName}.${namespace}.svc.cluster.local:2380
initialClusters := make([]string, *cfg.Replicas)
for index := range initialClusters {
Expand All @@ -44,7 +44,7 @@ func installKarmadaEtcd(client clientset.Interface, name, namespace string, cfg
initialClusters[index] = fmt.Sprintf("%s=%s", memberName, memberPeerURL)
}

etcdStatefuleSetBytes, err := util.ParseTemplate(KarmadaEtcdStatefulSet, struct {
etcdStatefulSetBytes, err := util.ParseTemplate(KarmadaEtcdStatefulSet, struct {
StatefulSetName, Namespace, Image, EtcdClientService string
CertsSecretName, EtcdPeerServiceName string
InitialCluster, EtcdDataVolumeName string
Expand All @@ -67,7 +67,7 @@ func installKarmadaEtcd(client clientset.Interface, name, namespace string, cfg
}

etcdStatefulSet := &appsv1.StatefulSet{}
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), etcdStatefuleSetBytes, etcdStatefulSet); err != nil {
if err := kuberuntime.DecodeInto(clientsetscheme.Codecs.UniversalDecoder(), etcdStatefulSetBytes, etcdStatefulSet); err != nil {
return fmt.Errorf("error when decoding Etcd StatefulSet: %w", err)
}

Expand Down
20 changes: 10 additions & 10 deletions operator/pkg/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
operatorscheme "github.com/karmada-io/karmada/operator/pkg/scheme"
tasks "github.com/karmada-io/karmada/operator/pkg/tasks/init"
"github.com/karmada-io/karmada/operator/pkg/util"
workflow "github.com/karmada-io/karmada/operator/pkg/workflow"
"github.com/karmada-io/karmada/operator/pkg/workflow"
)

var (
Expand Down Expand Up @@ -49,7 +49,7 @@ type initData struct {
name string
namespace string
karmadaVersion *utilversion.Version
controlplaneConifig *rest.Config
controlplaneConfig *rest.Config
controlplaneAddress string
remoteClient clientset.Interface
karmadaClient clientset.Interface
Expand All @@ -61,12 +61,12 @@ type initData struct {
components *operatorv1alpha1.KarmadaComponents
}

// NewInitJob initializes a job with list of init sub task. and build
// NewInitJob initializes a job with list of init sub-task. and build
// init runData object.
func NewInitJob(opt *InitOptions) *workflow.Job {
initJob := workflow.NewJob()

// add the all of tasks to the init job workflow.
// add the all tasks to the init job workflow.
initJob.AppendTask(tasks.NewPrepareCrdsTask())
initJob.AppendTask(tasks.NewCertTask())
initJob.AppendTask(tasks.NewNamespaceTask())
Expand Down Expand Up @@ -168,7 +168,7 @@ func (data *initData) RemoteClient() clientset.Interface {
func (data *initData) KarmadaClient() clientset.Interface {
if data.karmadaClient == nil {
data.Once.Do(func() {
client, err := clientset.NewForConfig(data.controlplaneConifig)
client, err := clientset.NewForConfig(data.controlplaneConfig)
if err != nil {
klog.Errorf("error when init karmada client, err: %w", err)
}
Expand All @@ -179,12 +179,12 @@ func (data *initData) KarmadaClient() clientset.Interface {
return data.karmadaClient
}

func (data *initData) ControlplaneConifg() *rest.Config {
return data.controlplaneConifig
func (data *initData) ControlplaneConfig() *rest.Config {
return data.controlplaneConfig
}

func (data *initData) SetControlplaneConifg(config *rest.Config) {
data.controlplaneConifig = config
func (data *initData) SetControlplaneConfig(config *rest.Config) {
data.controlplaneConfig = config
}

func (data *initData) Components() *operatorv1alpha1.KarmadaComponents {
Expand All @@ -195,7 +195,7 @@ func (data *initData) DataDir() string {
return data.karmadaDataDir
}

func (data *initData) CrdsRomoteURL() string {
func (data *initData) CrdsRemoteURL() string {
return data.crdRemoteURL
}

Expand Down
Loading