From 47e64d8a175d654fde7f564437dff20289444ef6 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Thu, 18 Jul 2024 06:59:51 +0000 Subject: [PATCH] update kubeadm, add more fields for v1beta3. Signed-off-by: Lan Liang --- kind/kcl.mod.lock | 0 kubeadm/1.29/v1beta3/cluster_configuration.k | 30 ----------- kubeadm/1.29/v1beta3/kubelet_configuration.k | 3 -- kubeadm/README.md | 9 ++++ kubeadm/{1.29 => }/artifacthub-pkg.yaml | 10 ++-- kubeadm/{1.29 => }/kcl.mod | 2 +- kubeadm/v1beta3/cluster_configuration.k | 54 +++++++++++++++++++ .../{1.29 => }/v1beta3/init_configuration.k | 11 ++-- kubeadm/v1beta3/kubelet_configuration.k | 8 +++ kubeadm/v1beta3/reset_configuration.k | 5 ++ 10 files changed, 89 insertions(+), 43 deletions(-) delete mode 100644 kind/kcl.mod.lock delete mode 100644 kubeadm/1.29/v1beta3/cluster_configuration.k delete mode 100644 kubeadm/1.29/v1beta3/kubelet_configuration.k create mode 100644 kubeadm/README.md rename kubeadm/{1.29 => }/artifacthub-pkg.yaml (69%) rename kubeadm/{1.29 => }/kcl.mod (77%) create mode 100644 kubeadm/v1beta3/cluster_configuration.k rename kubeadm/{1.29 => }/v1beta3/init_configuration.k (75%) create mode 100644 kubeadm/v1beta3/kubelet_configuration.k create mode 100644 kubeadm/v1beta3/reset_configuration.k diff --git a/kind/kcl.mod.lock b/kind/kcl.mod.lock deleted file mode 100644 index e69de29b..00000000 diff --git a/kubeadm/1.29/v1beta3/cluster_configuration.k b/kubeadm/1.29/v1beta3/cluster_configuration.k deleted file mode 100644 index 2fd2377f..00000000 --- a/kubeadm/1.29/v1beta3/cluster_configuration.k +++ /dev/null @@ -1,30 +0,0 @@ - -schema ClusterConfiguration: - apiVersion: str = "kubeadm.k8s.io/v1beta3" - kind: str = "ClusterConfiguration" - certificatesDir: str = "/etc/kubernetes/pki" - clusterName: str = "kubernetes" - imageRepository: str = "registry.k8s.io" - kubernetesVersion: str = "1.29.0" - etcd: Etcd={} - networking: Networking={} - apiServer: ApiServer={} - -schema Networking: - dnsDomain: str = "cluster.local" - serviceSubnet: str = "10.96.0.0/12" - podSubnet: str = "10.244.0.0/16" - -schema Etcd: - local: LocalEtcd = {} - -schema LocalEtcd: - dataDir: str = "/var/lib/etcd" - -schema ExternalEtcd: - endpoints = [] - -schema ApiServer: - timeoutForControlPlane: str = "4m0s" - certSANs = ["127.0.0.1","100.90.54.35"] - extraArgs = {"event-ttl": "99999h"} diff --git a/kubeadm/1.29/v1beta3/kubelet_configuration.k b/kubeadm/1.29/v1beta3/kubelet_configuration.k deleted file mode 100644 index 3bb447bc..00000000 --- a/kubeadm/1.29/v1beta3/kubelet_configuration.k +++ /dev/null @@ -1,3 +0,0 @@ -schema KubeletConfiguration: -apiVersion: str = "kubeadm.k8s.io/v1beta3" -kind: str = "KubeletConfiguration" diff --git a/kubeadm/README.md b/kubeadm/README.md new file mode 100644 index 00000000..398ab084 --- /dev/null +++ b/kubeadm/README.md @@ -0,0 +1,9 @@ +## Introduction + +`kubeadm` is the kubeadm spec definition + + + +## Resource + +Code source and document is [here](https://github.com/kcl-lang/artifacthub/tree/main/kubeadm) diff --git a/kubeadm/1.29/artifacthub-pkg.yaml b/kubeadm/artifacthub-pkg.yaml similarity index 69% rename from kubeadm/1.29/artifacthub-pkg.yaml rename to kubeadm/artifacthub-pkg.yaml index e2c9d3a4..66494225 100644 --- a/kubeadm/1.29/artifacthub-pkg.yaml +++ b/kubeadm/artifacthub-pkg.yaml @@ -1,4 +1,4 @@ -version: 1.29.0+kcl0 +version: 0.0.1 name: kubeadm displayName: kubeadm createdAt: "2024-03-08T04:14:30Z" @@ -9,14 +9,14 @@ links: - name: kubeadm repo url: https://github.com/kubernetes/kubeadm install: | - #### Add `kubeadm` with tag `1.29.0+kcl0` as dependency + #### Add `kubeadm` with tag `0.0.1` as dependency ``` - kcl mod add kubeadm:1.29.0+kcl0 + kcl mod add kubeadm:0.0.1 ``` - #### Pull `kubeadm` with tag `1.29.0+kcl0` to local + #### Pull `kubeadm` with tag `0.0.1` to local ``` - kcl mod pull kubeadm:1.29.0+kcl0 + kcl mod pull kubeadm:0.0.1 ``` maintainers: - name: kcl-lang.io diff --git a/kubeadm/1.29/kcl.mod b/kubeadm/kcl.mod similarity index 77% rename from kubeadm/1.29/kcl.mod rename to kubeadm/kcl.mod index f767f350..0ee30c0c 100644 --- a/kubeadm/1.29/kcl.mod +++ b/kubeadm/kcl.mod @@ -1,5 +1,5 @@ [package] name = "kubeadm" edition = "*" -version = "1.29.0+kcl0" +version = "0.0.1" description = "`kubeadm` is a KCL module." diff --git a/kubeadm/v1beta3/cluster_configuration.k b/kubeadm/v1beta3/cluster_configuration.k new file mode 100644 index 00000000..75925d77 --- /dev/null +++ b/kubeadm/v1beta3/cluster_configuration.k @@ -0,0 +1,54 @@ + +schema ClusterConfiguration: + apiVersion: str = "kubeadm.k8s.io/v1beta3" + kind: str = "ClusterConfiguration" + featureGates?: {str:bool} + controlPlaneEndpoint?: str + certificatesDir: str = "/etc/kubernetes/pki" + clusterName: str = "kubernetes" + imageRepository: str = "registry.k8s.io" + kubernetesVersion: str = "1.30.3" + etcd?: Etcd + networking?: Networking + apiServer?: ApiServer + controllerManager?: ControllerManager + scheduler?: Scheduler + dns?: Dns + +schema Networking: + dnsDomain: str = "cluster.local" + serviceSubnet: str = "10.96.0.0/12" + podSubnet: str = "10.244.0.0/16" + +schema Etcd: + local?: LocalEtcd + external?: ExternalEtcd + + check: + local !=None and external !=None + +schema LocalEtcd: + dataDir: str = "/var/lib/etcd" + +schema ExternalEtcd: + endpoints: [str] + +schema ApiServer: + timeoutForControlPlane: str = "4m0s" + certSANs = ["127.0.0.1"] + extraArgs?: {str:str} + extraVolumes?: [ExtraVolumeItem] + +schema ExtraVolumeItem: + name: str + hostPath: str + mountPath: str + +schema ControllerManager: + extraArgs?: {str:str} + +schema Scheduler: + extraArgs?: {str:str} + +schema Dns: + imageRepository?: str diff --git a/kubeadm/1.29/v1beta3/init_configuration.k b/kubeadm/v1beta3/init_configuration.k similarity index 75% rename from kubeadm/1.29/v1beta3/init_configuration.k rename to kubeadm/v1beta3/init_configuration.k index feaaa4aa..11606d83 100644 --- a/kubeadm/1.29/v1beta3/init_configuration.k +++ b/kubeadm/v1beta3/init_configuration.k @@ -1,13 +1,13 @@ schema InitConfiguration: apiVersion: str = "kubeadm.k8s.io/v1beta3" kind: str = "InitConfiguration" - localAPIEndpoint: LocalAPIEndpoint = {} - nodeRegistration: NodeRegistration = {} + localAPIEndpoint?: LocalAPIEndpoint + nodeRegistration?: NodeRegistration + patches?: PatcheItem schema NodeRegistration: criSocket: str = "unix:///var/run/containerd/containerd.sock" imagePullPolicy: str = "IfNotPresent" - taints = [] schema LocalAPIEndpoint: advertiseAddress: str = "127.0.0.1" @@ -15,6 +15,9 @@ schema LocalAPIEndpoint: schema BootstrapTokens: groups = ["system:bootstrappers:kubeadm:default-node-token" ] - token: str + token?: str ttl: str = "24h0m0s" usages = ["signing","authentication"] + +schema PatcheItem: + directory?: str diff --git a/kubeadm/v1beta3/kubelet_configuration.k b/kubeadm/v1beta3/kubelet_configuration.k new file mode 100644 index 00000000..49e6b7d5 --- /dev/null +++ b/kubeadm/v1beta3/kubelet_configuration.k @@ -0,0 +1,8 @@ +schema KubeletConfiguration: + apiVersion: str = "kubelet.config.k8s.io/v1beta1" + kind: str = "KubeletConfiguration" + maxParallelImagePulls?: int + serializeImagePulls?: bool + podPidsLimit?: int + featureGates?: {str:bool} + address?: str diff --git a/kubeadm/v1beta3/reset_configuration.k b/kubeadm/v1beta3/reset_configuration.k new file mode 100644 index 00000000..1630e6de --- /dev/null +++ b/kubeadm/v1beta3/reset_configuration.k @@ -0,0 +1,5 @@ +schema ResetConfiguration: + apiVersion: str = "kubeadm.k8s.io/v1beta3" + kind: str = "ResetConfiguration" + certificatesDir?: str + criSocket?: str