Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

machinepool capi #28

Merged
merged 1 commit into from
Jan 4, 2023
Merged

machinepool capi #28

merged 1 commit into from
Jan 4, 2023

Conversation

bavarianbidi
Copy link
Contributor

@bavarianbidi bavarianbidi commented Jan 4, 2023

Towards https://github.com/giantswarm/giantswarm/issues/25185, this PR adds initial support for Cluster API machinePools.

For now please ignore the version label when the value is v1beta1.
The KSM implementation has changed and depending on the result of kubernetes/kube-state-metrics#1942 and kubernetes/kube-state-metrics#1943 i will change the label name to kubernetes_version (or whatever make sense after discussing this with CAPI upstream)

# HELP capi_machinepool_status_condition The condition of a machinepool.
# TYPE capi_machinepool_status_condition gauge
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="False",type="BootstrapReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="False",type="InfrastructureReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="False",type="Ready",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="False",type="ReplicasReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="True",type="BootstrapReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="True",type="InfrastructureReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="True",type="Ready",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="True",type="ReplicasReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="Unknown",type="BootstrapReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="Unknown",type="InfrastructureReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="Unknown",type="Ready",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_condition{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",status="Unknown",type="ReplicasReady",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
# HELP capi_machinepool_spec_replicas The number of desired machines for a machinepool.
# TYPE capi_machinepool_spec_replicas gauge
capi_machinepool_spec_replicas{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
# HELP capi_machinepool_status_replicas The number of replicas per machinepool.
# TYPE capi_machinepool_status_replicas gauge
capi_machinepool_status_replicas{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
# HELP capi_machinepool_status_replicas_ready The number of ready replicas per machinepool.
# TYPE capi_machinepool_status_replicas_ready gauge
capi_machinepool_status_replicas_ready{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
# HELP capi_machinepool_status_replicas_available The number of available replicas per machinepool.
# TYPE capi_machinepool_status_replicas_available gauge
capi_machinepool_status_replicas_available{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
# HELP capi_machinepool_status_replicas_unavailable The number of unavailable replicas per machinepool.
# TYPE capi_machinepool_status_replicas_unavailable gauge
capi_machinepool_status_replicas_unavailable{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
# HELP capi_machinepool_info 
# TYPE capi_machinepool_info gauge
capi_machinepool_info{bootstrap_configuration_reference_kind="KubeadmConfig",bootstrap_configuration_reference_name="marioc1-def00-b78dd5d7",cluster_name="marioc1",group="cluster.x-k8s.io",infrastructure_reference_kind="AzureMachinePool",infrastructure_reference_name="marioc1-def00-3830f64e",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1.24.8"} 1
# HELP capi_machinepool_status_phase The machinepools current phase.
# TYPE capi_machinepool_status_phase gauge
capi_machinepool_status_phase{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",phase="Failed",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_phase{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",phase="Running",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
capi_machinepool_status_phase{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",phase="ScalingDown",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_phase{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",phase="ScalingUp",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
capi_machinepool_status_phase{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",phase="Unknown",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 0
# HELP capi_machinepool_created Unix creation timestamp.
# TYPE capi_machinepool_created gauge
capi_machinepool_created{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1.672752467e+09
# HELP capi_machinepool_annotation_paused Whether the machinepool is paused and any of its resources will not be processed by the controllers.
# TYPE capi_machinepool_annotation_paused gauge
capi_machinepool_annotation_paused{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",paused_value="true",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1
# HELP capi_machinepool_owner Owner references.
# TYPE capi_machinepool_owner gauge
capi_machinepool_owner{cluster_name="marioc1",group="cluster.x-k8s.io",kind="MachinePool",name="marioc1-def00",namespace="org-multi-project",owner_kind="Cluster",owner_name="marioc1",owner_uid="dd5ed135-1a9a-4687-97da-8133af09cf13",uid="a0265b96-6b70-4a9a-b72b-9a4c2d3587d3",version="v1beta1"} 1

Checklist

  • Update changelog in CHANGELOG.md.
  • Make sure values.yaml and values.schema.json are valid.
  • metric name change doesn't affect existing alerts

@bavarianbidi bavarianbidi requested a review from a team as a code owner January 4, 2023 05:48
@bavarianbidi bavarianbidi removed the request for review from a team January 4, 2023 05:48
@bavarianbidi bavarianbidi requested review from a team January 4, 2023 06:11
@bavarianbidi bavarianbidi merged commit fccd99a into main Jan 4, 2023
@bavarianbidi bavarianbidi deleted the add_capi_machinepool_support branch January 4, 2023 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants