Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ jobs:
- admission-webhook-k0s-not-compatible
- k0smotron-upgrade
- machinedeployment
- remote-hosted-control-planes

steps:
- name: Check out code into the Go module directory
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ run:
linters:
default: none
enable:
- depguard
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the recent changes in the golangci-lint configuration, some noisy errors appeared. I think it’s safe to remove the depguard linter for now. It deserves some investigation on how to configure it properly in follow-up changes.

- goheader
- revive
settings:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ generate-e2e-templates-main: $(KUSTOMIZE)
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-webhook-recreate-in-single-mode --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-webhook-recreate-in-single-mode.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-webhook-k0s-not-compatible --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-webhook-k0s-not-compatible.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-machinedeployment.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-remote-hcp.yaml


e2e: k0smotron-image-bundle.tar install.yaml kustomize generate-e2e-templates-main
set +x;
Expand Down
18 changes: 18 additions & 0 deletions api/k0smotron.io/v1beta1/k0smotroncluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import (

// ClusterSpec defines the desired state of K0smotronCluster
type ClusterSpec struct {
// KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
// This kubeconfig will be used to deploy the k0s control plane.
//+kubebuilder:validation:Optional
KubeconfigRef *KubeconfigRef `json:"kubeconfigRef,omitempty"`
// Replicas is the desired number of replicas of the k0s control planes.
// If unspecified, defaults to 1. If the value is above 1, k0smotron requires kine datasource URL to be set.
// Recommended value is 3.
Expand Down Expand Up @@ -324,6 +328,20 @@ type CertificateRef struct {
Name string `json:"name,omitempty"`
}

// KubeconfigRef defines the reference to the kubeconfig of the hosting cluster.
type KubeconfigRef struct {
// Name is the name of the secret containing the kubeconfig of the hosting cluster.
//+kubebuilder:validation:Required
Name string `json:"name"`
// Namespace is the namespace of the secret containing the kubeconfig of the hosting cluster.
//+kubebuilder:validation:Optional
Namespace string `json:"namespace,omitempty"`
// Key is the key in the secret containing the kubeconfig of the hosting cluster.
//+kubebuilder:validation:Optional
//+kubebuilder:default="value"
Key string `json:"key,omitempty"`
}

func init() {
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
}
Expand Down
20 changes: 20 additions & 0 deletions api/k0smotron.io/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,27 @@ spec:
kineDataSourceURL:
description: KineDataSourceURL defines the kine datasource URL.
type: string
kubeconfigRef:
description: |-
KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
This kubeconfig will be used to deploy the k0s control plane.
properties:
key:
default: value
description: Key is the key in the secret containing the kubeconfig
of the hosting cluster.
type: string
name:
description: Name is the name of the secret containing the kubeconfig
of the hosting cluster.
type: string
namespace:
description: Namespace is the namespace of the secret containing
the kubeconfig of the hosting cluster.
type: string
required:
- name
type: object
manifests:
description: |-
Manifests allows to specify list of volumes with manifests to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,27 @@ spec:
description: KineDataSourceURL defines the kine datasource
URL.
type: string
kubeconfigRef:
description: |-
KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
This kubeconfig will be used to deploy the k0s control plane.
properties:
key:
default: value
description: Key is the key in the secret containing the
kubeconfig of the hosting cluster.
type: string
name:
description: Name is the name of the secret containing
the kubeconfig of the hosting cluster.
type: string
namespace:
description: Namespace is the namespace of the secret
containing the kubeconfig of the hosting cluster.
type: string
required:
- name
type: object
manifests:
description: |-
Manifests allows to specify list of volumes with manifests to be
Expand Down
21 changes: 21 additions & 0 deletions config/clusterapi/k0smotron.io/bases/k0smotron.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,27 @@ spec:
kineDataSourceURL:
description: KineDataSourceURL defines the kine datasource URL.
type: string
kubeconfigRef:
description: |-
KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
This kubeconfig will be used to deploy the k0s control plane.
properties:
key:
default: value
description: Key is the key in the secret containing the kubeconfig
of the hosting cluster.
type: string
name:
description: Name is the name of the secret containing the kubeconfig
of the hosting cluster.
type: string
namespace:
description: Namespace is the namespace of the secret containing
the kubeconfig of the hosting cluster.
type: string
required:
- name
type: object
manifests:
description: |-
Manifests allows to specify list of volumes with manifests to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,27 @@ spec:
kineDataSourceURL:
description: KineDataSourceURL defines the kine datasource URL.
type: string
kubeconfigRef:
description: |-
KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
This kubeconfig will be used to deploy the k0s control plane.
properties:
key:
default: value
description: Key is the key in the secret containing the kubeconfig
of the hosting cluster.
type: string
name:
description: Name is the name of the secret containing the kubeconfig
of the hosting cluster.
type: string
namespace:
description: Namespace is the namespace of the secret containing
the kubeconfig of the hosting cluster.
type: string
required:
- name
type: object
manifests:
description: |-
Manifests allows to specify list of volumes with manifests to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,27 @@ spec:
description: KineDataSourceURL defines the kine datasource
URL.
type: string
kubeconfigRef:
description: |-
KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
This kubeconfig will be used to deploy the k0s control plane.
properties:
key:
default: value
description: Key is the key in the secret containing the
kubeconfig of the hosting cluster.
type: string
name:
description: Name is the name of the secret containing
the kubeconfig of the hosting cluster.
type: string
namespace:
description: Namespace is the namespace of the secret
containing the kubeconfig of the hosting cluster.
type: string
required:
- name
type: object
manifests:
description: |-
Manifests allows to specify list of volumes with manifests to be
Expand Down
21 changes: 21 additions & 0 deletions config/crd/bases/k0smotron.io/k0smotron.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,27 @@ spec:
kineDataSourceURL:
description: KineDataSourceURL defines the kine datasource URL.
type: string
kubeconfigRef:
description: |-
KubeconfigRef is the reference to the kubeconfig of the hosting cluster.
This kubeconfig will be used to deploy the k0s control plane.
properties:
key:
default: value
description: Key is the key in the secret containing the kubeconfig
of the hosting cluster.
type: string
name:
description: Name is the name of the secret containing the kubeconfig
of the hosting cluster.
type: string
namespace:
description: Namespace is the namespace of the secret containing
the kubeconfig of the hosting cluster.
type: string
required:
- name
type: object
manifests:
description: |-
Manifests allows to specify list of volumes with manifests to be
Expand Down
6 changes: 6 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- apiGroups:
- ""
resources:
Expand Down
Loading
Loading