Skip to content

Commit

Permalink
kubeadm v1beta4 support (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpiyush17 authored Dec 17, 2024
1 parent 9d42ef4 commit 562c289
Show file tree
Hide file tree
Showing 15 changed files with 607 additions and 404 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor/
build/
build/
local/
17 changes: 17 additions & 0 deletions domain/cluster_context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package domain

type ClusterContext struct {
RootPath string `json:"rootPath" yaml:"rootPath"`
NodeRole string `json:"nodeRole" yaml:"nodeRole"`
ClusterCidr string `json:"clusterCidr" yaml:"clusterCidr"`
ServiceCidr string `json:"serviceCidr" yaml:"serviceCidr"`
KubeletArgs string `json:"kubeletArgs" yaml:"kubeletArgs"`
CertSansRevision string `json:"certSans" yaml:"certSans"`
ControlPlaneHost string `json:"controlPlaneHost" yaml:"controlPlaneHost"`
ClusterToken string `json:"clusterToken" yaml:"clusterToken"`
UserOptions string `json:"userOptions" yaml:"userOptions"`
LocalImagesPath string `json:"localImagesPath" yaml:"localImagesPath"`
ContainerdServiceFolderName string `json:"containerdServiceFolderName" yaml:"containerdServiceFolderName"`

EnvConfig map[string]string `json:"envConfig" yaml:"envConfig"`
}
10 changes: 9 additions & 1 deletion domain/kubeadm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ package domain
import (
kubeletv1beta1 "k8s.io/kubelet/config/v1beta1"
kubeadmapiv3 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
kubeadmapiv4 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta4"
)

type KubeadmConfig struct {
type KubeadmConfigBeta4 struct {
ClusterConfiguration kubeadmapiv4.ClusterConfiguration `json:"clusterConfiguration,omitempty" yaml:"clusterConfiguration,omitempty"`
InitConfiguration kubeadmapiv4.InitConfiguration `json:"initConfiguration,omitempty" yaml:"initConfiguration,omitempty"`
JoinConfiguration kubeadmapiv4.JoinConfiguration `json:"joinConfiguration,omitempty" yaml:"joinConfiguration,omitempty"`
KubeletConfiguration kubeletv1beta1.KubeletConfiguration `json:"kubeletConfiguration,omitempty" yaml:"kubeletConfiguration,omitempty"`
}

type KubeadmConfigBeta3 struct {
ClusterConfiguration kubeadmapiv3.ClusterConfiguration `json:"clusterConfiguration,omitempty" yaml:"clusterConfiguration,omitempty"`
InitConfiguration kubeadmapiv3.InitConfiguration `json:"initConfiguration,omitempty" yaml:"initConfiguration,omitempty"`
JoinConfiguration kubeadmapiv3.JoinConfiguration `json:"joinConfiguration,omitempty" yaml:"joinConfiguration,omitempty"`
Expand Down
52 changes: 26 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,33 @@ require (
github.com/sirupsen/logrus v1.9.3
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.27.1
k8s.io/api v0.31.2
k8s.io/apimachinery v0.31.2
k8s.io/cli-runtime v0.24.0
k8s.io/cluster-bootstrap v0.24.0
k8s.io/component-helpers v0.27.1
k8s.io/klog/v2 v2.130.1
k8s.io/kubelet v0.27.1
k8s.io/kubernetes v1.27.16
k8s.io/utils v0.0.0-20230209194617-a36077c30491
k8s.io/kubelet v0.31.2
k8s.io/kubernetes v1.31.2
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/yaml v1.4.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
Expand All @@ -49,33 +50,32 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/twpayne/go-vfs/v4 v4.3.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/api v0.27.1 // indirect
k8s.io/client-go v0.27.1 // indirect
k8s.io/component-base v0.27.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/client-go v0.31.2 // indirect
k8s.io/component-base v0.31.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Loading

0 comments on commit 562c289

Please sign in to comment.