Skip to content

Commit

Permalink
Merge pull request #171 from liangyuanpeng/kubeadm_update
Browse files Browse the repository at this point in the history
update kubeadm, add more fields for v1beta3.
  • Loading branch information
Peefy authored Jul 18, 2024
2 parents e21f60e + 47e64d8 commit 50c81a2
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 43 deletions.
Empty file removed kind/kcl.mod.lock
Empty file.
30 changes: 0 additions & 30 deletions kubeadm/1.29/v1beta3/cluster_configuration.k

This file was deleted.

3 changes: 0 additions & 3 deletions kubeadm/1.29/v1beta3/kubelet_configuration.k

This file was deleted.

9 changes: 9 additions & 0 deletions kubeadm/README.md
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.29.0+kcl0
version: 0.0.1
name: kubeadm
displayName: kubeadm
createdAt: "2024-03-08T04:14:30Z"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kubeadm/1.29/kcl.mod → kubeadm/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "kubeadm"
edition = "*"
version = "1.29.0+kcl0"
version = "0.0.1"
description = "`kubeadm` is a KCL module."
54 changes: 54 additions & 0 deletions kubeadm/v1beta3/cluster_configuration.k
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
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"
bindPort: int = 6443

schema BootstrapTokens:
groups = ["system:bootstrappers:kubeadm:default-node-token" ]
token: str
token?: str
ttl: str = "24h0m0s"
usages = ["signing","authentication"]

schema PatcheItem:
directory?: str
8 changes: 8 additions & 0 deletions kubeadm/v1beta3/kubelet_configuration.k
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions kubeadm/v1beta3/reset_configuration.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
schema ResetConfiguration:
apiVersion: str = "kubeadm.k8s.io/v1beta3"
kind: str = "ResetConfiguration"
certificatesDir?: str
criSocket?: str

0 comments on commit 50c81a2

Please sign in to comment.