Skip to content

Commit

Permalink
Added metricsPort to hostplumber plugin (#230)
Browse files Browse the repository at this point in the history
* Added metrics_bind_address

* using a const

---------

Co-authored-by: Jayanth Reddy <[email protected]>
  • Loading branch information
2 people authored and cruizen committed Nov 25, 2024
1 parent 855f892 commit ad55051
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/crd/bases/plumber.k8s.pf9.io_networkplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ spec:
type: string
namespace:
type: string
metricsPort:
type: string
type: object
multus:
properties:
Expand Down
7 changes: 7 additions & 0 deletions v2/controllers/networkplugins_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (

const (
DefaultNamespace = "default"
DefaultMetricsPort = "8080"
MultusImage = "docker.io/platform9/multus:v3.7.2-pmk-2573338"
WhereaboutsImage = "docker.io/platform9/whereabouts:v0.6-pmk-2754876"
SriovCniImage = "docker.io/platform9/sriov-cni:v2.6.2-pmk-2877848"
Expand Down Expand Up @@ -198,6 +199,12 @@ func (hostPlumberConfig *HostPlumberT) WriteConfigToTemplate(outputDir, registry
config["HostPlumberImage"] = ReplaceContainerRegistry(HostPlumberImage, registry)
}

if hostPlumberConfig.MetricsPort != "" {
config["MetricsPort"] = hostPlumberConfig.MetricsPort
} else {
config["MetricsPort"] = DefaultMetricsPort
}

config["KubeRbacProxyImage"] = ReplaceContainerRegistry(KubeRbacProxyImage, registry)

t, err := template.ParseFiles(filepath.Join(TemplateDir, "pf9-hostplumber", "hostplumber.yaml"))
Expand Down

0 comments on commit ad55051

Please sign in to comment.