Skip to content

Commit

Permalink
Merge pull request #1578 from 24sama/cluster-api-provider
Browse files Browse the repository at this point in the history
K3sControlPlane adds a scale subresource and additional printer columns
  • Loading branch information
pixiake authored Nov 7, 2022
2 parents 393cc10 + bbd2ee1 commit e387f88
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cmd/kk/pkg/files/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ var (
"v1.19.0": "88ce7dc5302d8847f6e679aab9e4fa642a819e8a33d70731fb7bc8e110d8659f",
"v1.19.8": "9c6646cdf03efc3194afc178647205195da4a43f58d0b70954953f566fa15c76",
"v1.19.9": "917712bbd38b625aca456ffa78bf134d64f0efb186cc5772c9844ba6d74fd920",
"v1.19.15": "7fd8558856497d563a4e9ee0235183d2887751e68b11296b1064c32273933cf7",
"v1.20.4": "dcc5629da2c31a000b9b50db077b1cd51a6840e08233fd64b67e37f3f098c392",
"v1.20.6": "ff6fca46edeccd8a4dbf162079d0b3d27841b04885b3f47f80377b3a93ab1533",
"v1.20.10": "da5864968a38e0bf2317965e87b5425e1b9101a49dd5178f2e967c0a46547270",
Expand Down Expand Up @@ -383,6 +384,7 @@ var (
"v1.19.0": "db1c432646e6e6484989b6f7191f3610996ac593409f12574290bfc008ea11f5",
"v1.19.8": "dfb838ffb88d79e4d881326f611ae5e5999accb54cdd666c75664da264b5d58e",
"v1.19.9": "403c767bef0d681aebc45d5643787fc8c0b9344866cbd339368637a05ea1d11c",
"v1.19.15": "44bbd07a5fc048bccfe4c0e7efd8abb9bd8daa420898bbe8519da91cebadf483",
"v1.20.4": "c3ff7f944826889a23a002c85e8f9f9d9a8bc95e9083fbdda59831e3e34245a7",
"v1.20.6": "33837e290bd76fcb16af27db0e814ec023c25e6c41f25a0907b48756d4a2ffc2",
"v1.20.10": "ec1f8df0f57b8aa6bddce2d6bb8d0503e016b022ba8a5f113ddf412d9a99c03c",
Expand Down Expand Up @@ -450,6 +452,7 @@ var (
"v1.19.0": "3f03e5c160a8b658d30b34824a1c00abadbac96e62c4d01bf5c9271a2debc3ab",
"v1.19.8": "f5cad5260c29584dd370ec13e525c945866957b1aaa719f1b871c31dc30bcb3f",
"v1.19.9": "296e72c395f030209e712167fc5f6d2fdfe3530ca4c01bcd9bfb8c5e727c3d8d",
"v1.19.15": "c949b5a3fc6135b9747b592402a615ebd24791b087b3212f29248ea3ec7c62ed",
"v1.20.4": "a9f28ac492b3cbf75dee284576b2e1681e67170cd36f3f5cdc31495f1bdbf809",
"v1.20.6": "7688a663dd06222d337c8fdb5b05e1d9377e6d64aa048c6acf484bc3f2a596a8",
"v1.20.10": "de1b24f33d47cc4dc14a10f051d7d6fbbcf3800d3a07ddb45fc83660183c3a73",
Expand Down Expand Up @@ -515,6 +518,7 @@ var (
"v1.19.0": "d8fa5a9739ecc387dfcc55afa91ac6f4b0ccd01f1423c423dbd312d787bbb6bf",
"v1.19.8": "a00146c16266d54f961c40fc67f92c21967596c2d730fa3dc95868d4efb44559",
"v1.19.9": "796f080c53ec50b11152558b4a744432349b800e37b80516bcdc459152766a4f",
"v1.19.15": "19c2d3c8861eeebdcdeb5f84462267b6cf0584acaf8dff2f805938375c076b96",
"v1.20.4": "66bcdc7521e226e4acaa93c08e5ea7b2f57829e1a5b9decfd2b91d237e216e1d",
"v1.20.6": "6e7b44d1ca65f970b0646f7d093dcf0cfefc44d4a67f29d542fe1b7ca6dcf715",
"v1.20.10": "5107a4b2eb017039dda900cf263ec19484eee8bec070fc88803d3d9d4cc9fb18",
Expand Down Expand Up @@ -582,6 +586,7 @@ var (
"v1.19.0": "79bb0d2f05487ff533999a639c075043c70a0a1ba25c1629eb1eef6ebe3ba70f",
"v1.19.8": "a0737d3a15ca177816b6fb1fd59bdd5a3751bfdc66de4e08dffddba84e38bf3f",
"v1.19.9": "7128c9e38ab9c445a3b02d3d0b3f0f15fe7fbca56fd87b84e575d7b29e999ad9",
"v1.19.15": "6f2ac7db8cfd59f660abc9891c1bb7da2dabd1cf5e114d836f2ffd39ee677d04",
"v1.20.4": "98e8aea149b00f653beeb53d4bd27edda9e73b48fed156c4a0aa1dabe4b1794c",
"v1.20.6": "89ae000df6bbdf38ae4307cc4ecc0347d5c871476862912c0a765db9bf05284e",
"v1.20.10": "1e87edb99b7a92a142b458976ae75412d3ee22421793968b03213ddd007c0530",
Expand Down Expand Up @@ -647,6 +652,7 @@ var (
"v1.19.0": "d4adf1b6b97252025cb2f7febf55daa3f42dc305822e3da133f77fd33071ec2f",
"v1.19.8": "8f037ab2aa798bbc66ebd1d52653f607f223b07813bcf98d9c1d0c0e136910ec",
"v1.19.9": "628627d01c9eaf624ffe3cf1195947a256ea5f842851e42682057e4233a9e283",
"v1.19.15": "3c3179888b516a4dadf7aa25e5c93577a2f763031e615c56c78f8413bc706f4d",
"v1.20.4": "0fd64b3e5d3fda4637c174a5aea0119b46d6cbede591a4dc9130a81481fc952f",
"v1.20.6": "1d0a29420c4488b15adb44044b193588989b95515cd6c8c03907dafe9b3d53f3",
"v1.20.10": "e559bcf16c824a2337125f20a2d64bfbf3959c713aa4f711871a694e2f58d4d8",
Expand Down
1 change: 1 addition & 0 deletions cmd/kk/pkg/version/kubernetes/version_enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func SupportedK8sVersionList() []string {
"v1.19.0",
"v1.19.8",
"v1.19.9",
"v1.19.15",
"v1.20.4",
"v1.20.6",
"v1.20.10",
Expand Down
11 changes: 11 additions & 0 deletions controlplane/k3s/api/v1beta1/k3scontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ type K3sControlPlaneStatus struct {
// +kubebuilder:resource:path=k3scontrolplanes,shortName=k3scp,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster"
// +kubebuilder:printcolumn:name="Initialized",type=boolean,JSONPath=".status.initialized",description="This denotes whether or not the control plane has the uploaded k3s-config configmap"
// +kubebuilder:printcolumn:name="API Server Available",type=boolean,JSONPath=".status.ready",description="K3sControlPlane API Server is ready to receive requests"
// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this control plane",priority=10
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this control plane"
// +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=".status.readyReplicas",description="Total number of fully running and ready control plane machines"
// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this control plane that have the desired template spec"
// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this control plane"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmControlPlane"
// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=".spec.version",description="Kubernetes version associated with this control plane"

// K3sControlPlane is the Schema for the k3scontrolplanes API
type K3sControlPlane struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,52 @@ spec:
singular: k3scontrolplane
scope: Namespaced
versions:
- name: v1beta1
- additionalPrinterColumns:
- description: Cluster
jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name']
name: Cluster
type: string
- description: This denotes whether or not the control plane has the uploaded
k3s-config configmap
jsonPath: .status.initialized
name: Initialized
type: boolean
- description: K3sControlPlane API Server is ready to receive requests
jsonPath: .status.ready
name: API Server Available
type: boolean
- description: Total number of machines desired by this control plane
jsonPath: .spec.replicas
name: Desired
priority: 10
type: integer
- description: Total number of non-terminated machines targeted by this control
plane
jsonPath: .status.replicas
name: Replicas
type: integer
- description: Total number of fully running and ready control plane machines
jsonPath: .status.readyReplicas
name: Ready
type: integer
- description: Total number of non-terminated machines targeted by this control
plane that have the desired template spec
jsonPath: .status.updatedReplicas
name: Updated
type: integer
- description: Total number of unavailable machines targeted by this control plane
jsonPath: .status.unavailableReplicas
name: Unavailable
type: integer
- description: Time duration since creation of KubeadmControlPlane
jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: Kubernetes version associated with this control plane
jsonPath: .spec.version
name: Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: K3sControlPlane is the Schema for the k3scontrolplanes API
Expand Down Expand Up @@ -658,4 +703,8 @@ spec:
served: true
storage: true
subresources:
scale:
labelSelectorPath: .status.selector
specReplicasPath: .spec.replicas
statusReplicasPath: .status.replicas
status: {}
1 change: 1 addition & 0 deletions docs/kubernetes-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
| v1.19.0 | :white_check_mark: |
| v1.19.8 | :white_check_mark: |
| v1.19.9 | :white_check_mark: |
| v1.19.15 | :white_check_mark: |
| v1.20.4 | :white_check_mark: |
| v1.20.6 | :white_check_mark: |
| v1.20.10 | :white_check_mark: |
Expand Down
6 changes: 6 additions & 0 deletions pkg/service/operation/file/checksum/internal_checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var (
"v1.19.0": "88ce7dc5302d8847f6e679aab9e4fa642a819e8a33d70731fb7bc8e110d8659f",
"v1.19.8": "9c6646cdf03efc3194afc178647205195da4a43f58d0b70954953f566fa15c76",
"v1.19.9": "917712bbd38b625aca456ffa78bf134d64f0efb186cc5772c9844ba6d74fd920",
"v1.19.15": "7fd8558856497d563a4e9ee0235183d2887751e68b11296b1064c32273933cf7",
"v1.20.4": "dcc5629da2c31a000b9b50db077b1cd51a6840e08233fd64b67e37f3f098c392",
"v1.20.6": "ff6fca46edeccd8a4dbf162079d0b3d27841b04885b3f47f80377b3a93ab1533",
"v1.20.10": "da5864968a38e0bf2317965e87b5425e1b9101a49dd5178f2e967c0a46547270",
Expand Down Expand Up @@ -145,6 +146,7 @@ var (
"v1.19.0": "db1c432646e6e6484989b6f7191f3610996ac593409f12574290bfc008ea11f5",
"v1.19.8": "dfb838ffb88d79e4d881326f611ae5e5999accb54cdd666c75664da264b5d58e",
"v1.19.9": "403c767bef0d681aebc45d5643787fc8c0b9344866cbd339368637a05ea1d11c",
"v1.19.15": "44bbd07a5fc048bccfe4c0e7efd8abb9bd8daa420898bbe8519da91cebadf483",
"v1.20.4": "c3ff7f944826889a23a002c85e8f9f9d9a8bc95e9083fbdda59831e3e34245a7",
"v1.20.6": "33837e290bd76fcb16af27db0e814ec023c25e6c41f25a0907b48756d4a2ffc2",
"v1.20.10": "ec1f8df0f57b8aa6bddce2d6bb8d0503e016b022ba8a5f113ddf412d9a99c03c",
Expand Down Expand Up @@ -212,6 +214,7 @@ var (
"v1.19.0": "3f03e5c160a8b658d30b34824a1c00abadbac96e62c4d01bf5c9271a2debc3ab",
"v1.19.8": "f5cad5260c29584dd370ec13e525c945866957b1aaa719f1b871c31dc30bcb3f",
"v1.19.9": "296e72c395f030209e712167fc5f6d2fdfe3530ca4c01bcd9bfb8c5e727c3d8d",
"v1.19.15": "c949b5a3fc6135b9747b592402a615ebd24791b087b3212f29248ea3ec7c62ed",
"v1.20.4": "a9f28ac492b3cbf75dee284576b2e1681e67170cd36f3f5cdc31495f1bdbf809",
"v1.20.6": "7688a663dd06222d337c8fdb5b05e1d9377e6d64aa048c6acf484bc3f2a596a8",
"v1.20.10": "de1b24f33d47cc4dc14a10f051d7d6fbbcf3800d3a07ddb45fc83660183c3a73",
Expand Down Expand Up @@ -277,6 +280,7 @@ var (
"v1.19.0": "d8fa5a9739ecc387dfcc55afa91ac6f4b0ccd01f1423c423dbd312d787bbb6bf",
"v1.19.8": "a00146c16266d54f961c40fc67f92c21967596c2d730fa3dc95868d4efb44559",
"v1.19.9": "796f080c53ec50b11152558b4a744432349b800e37b80516bcdc459152766a4f",
"v1.19.15": "19c2d3c8861eeebdcdeb5f84462267b6cf0584acaf8dff2f805938375c076b96",
"v1.20.4": "66bcdc7521e226e4acaa93c08e5ea7b2f57829e1a5b9decfd2b91d237e216e1d",
"v1.20.6": "6e7b44d1ca65f970b0646f7d093dcf0cfefc44d4a67f29d542fe1b7ca6dcf715",
"v1.20.10": "5107a4b2eb017039dda900cf263ec19484eee8bec070fc88803d3d9d4cc9fb18",
Expand Down Expand Up @@ -344,6 +348,7 @@ var (
"v1.19.0": "79bb0d2f05487ff533999a639c075043c70a0a1ba25c1629eb1eef6ebe3ba70f",
"v1.19.8": "a0737d3a15ca177816b6fb1fd59bdd5a3751bfdc66de4e08dffddba84e38bf3f",
"v1.19.9": "7128c9e38ab9c445a3b02d3d0b3f0f15fe7fbca56fd87b84e575d7b29e999ad9",
"v1.19.15": "6f2ac7db8cfd59f660abc9891c1bb7da2dabd1cf5e114d836f2ffd39ee677d04",
"v1.20.4": "98e8aea149b00f653beeb53d4bd27edda9e73b48fed156c4a0aa1dabe4b1794c",
"v1.20.6": "89ae000df6bbdf38ae4307cc4ecc0347d5c871476862912c0a765db9bf05284e",
"v1.20.10": "1e87edb99b7a92a142b458976ae75412d3ee22421793968b03213ddd007c0530",
Expand Down Expand Up @@ -409,6 +414,7 @@ var (
"v1.19.0": "d4adf1b6b97252025cb2f7febf55daa3f42dc305822e3da133f77fd33071ec2f",
"v1.19.8": "8f037ab2aa798bbc66ebd1d52653f607f223b07813bcf98d9c1d0c0e136910ec",
"v1.19.9": "628627d01c9eaf624ffe3cf1195947a256ea5f842851e42682057e4233a9e283",
"v1.19.15": "3c3179888b516a4dadf7aa25e5c93577a2f763031e615c56c78f8413bc706f4d",
"v1.20.4": "0fd64b3e5d3fda4637c174a5aea0119b46d6cbede591a4dc9130a81481fc952f",
"v1.20.6": "1d0a29420c4488b15adb44044b193588989b95515cd6c8c03907dafe9b3d53f3",
"v1.20.10": "e559bcf16c824a2337125f20a2d64bfbf3959c713aa4f711871a694e2f58d4d8",
Expand Down

0 comments on commit e387f88

Please sign in to comment.