Skip to content

Commit

Permalink
Expose metrics port for karmadactl installation
Browse files Browse the repository at this point in the history
Signed-off-by: whitewindmills <[email protected]>
  • Loading branch information
whitewindmills committed Jul 10, 2024
1 parent 7982275 commit e2afe37
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/karmadactl/addons/descheduler/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ spec:
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
ports:
- containerPort: 10358
name: metrics
protocol: TCP
volumeMounts:
- name: k8s-certs
mountPath: /etc/karmada/pki
Expand Down
4 changes: 4 additions & 0 deletions pkg/karmadactl/addons/estimator/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ spec:
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
ports:
- containerPort: 10351
name: metrics
protocol: TCP
volumeMounts:
- name: k8s-certs
mountPath: /etc/karmada/pki
Expand Down
19 changes: 19 additions & 0 deletions pkg/karmadactl/cmdinit/kubernetes/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
deploymentAPIVersion = "apps/v1"
deploymentKind = "Deployment"
portName = "server"
metricsPortName = "metrics"
defaultMetricsPort = 8080

// KubeConfigSecretAndMountName is the secret and volume mount name of karmada kubeconfig
KubeConfigSecretAndMountName = "kubeconfig"
Expand Down Expand Up @@ -461,6 +463,13 @@ func (i *CommandInitOption) makeKarmadaSchedulerDeployment() *appsv1.Deployment
"--v=4",
},
LivenessProbe: livenessProbe,
Ports: []corev1.ContainerPort{
{
Name: metricsPortName,
ContainerPort: 10351,
Protocol: corev1.ProtocolTCP,
},
},
VolumeMounts: []corev1.VolumeMount{
{
Name: KubeConfigSecretAndMountName,
Expand Down Expand Up @@ -595,6 +604,11 @@ func (i *CommandInitOption) makeKarmadaControllerManagerDeployment() *appsv1.Dep
ContainerPort: controllerManagerSecurePort,
Protocol: corev1.ProtocolTCP,
},
{
Name: metricsPortName,
ContainerPort: defaultMetricsPort,
Protocol: corev1.ProtocolTCP,
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -712,6 +726,11 @@ func (i *CommandInitOption) makeKarmadaWebhookDeployment() *appsv1.Deployment {
ContainerPort: webhookTargetPort,
Protocol: corev1.ProtocolTCP,
},
{
Name: metricsPortName,
ContainerPort: defaultMetricsPort,
Protocol: corev1.ProtocolTCP,
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down
7 changes: 7 additions & 0 deletions pkg/karmadactl/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,13 @@ func (o *CommandRegisterOption) makeKarmadaAgentDeployment() *appsv1.Deployment
"--secure-port=10357",
"--v=4",
},
Ports: []corev1.ContainerPort{
{
Name: "metrics",
ContainerPort: 8080,
Protocol: corev1.ProtocolTCP,
},
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "kubeconfig",
Expand Down

0 comments on commit e2afe37

Please sign in to comment.