Expose Felix metrics

* Exposes Felix prometheus endpoint
* Same as `networking.projectcalico.org.canal`
This commit is contained in:
Aleksandar Topuzovic 2018-02-26 15:23:51 +00:00
parent b2c161111f
commit dd5713d5b4
No known key found for this signature in database
GPG Key ID: 8D7CDD3C562180B7
8 changed files with 74 additions and 0 deletions

View File

@ -70,6 +70,16 @@ type FlannelNetworkingSpec struct {
// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
CrossSubnet bool `json:"crossSubnet,omitempty"` // Enables Calico's cross-subnet mode when set to true
// PrometheusMetricsEnabled can be set to enable the experimental Prometheus
// metrics server (default: false)
PrometheusMetricsEnabled bool `json:"prometheusMetricsEnabled,omitempty"`
// PrometheusMetricsPort is the TCP port that the experimental Prometheus
// metrics server should bind to (default: 9091)
PrometheusMetricsPort int32 `json:"prometheusMetricsPort,omitempty"`
// PrometheusGoMetricsEnabled enables Prometheus Go runtime metrics collection
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
}
// CanalNetworkingSpec declares that we want Canal networking

View File

@ -70,6 +70,16 @@ type FlannelNetworkingSpec struct {
// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
CrossSubnet bool `json:"crossSubnet,omitempty"` // Enables Calico's cross-subnet mode when set to true
// PrometheusMetricsEnabled can be set to enable the experimental Prometheus
// metrics server (default: false)
PrometheusMetricsEnabled bool `json:"prometheusMetricsEnabled,omitempty"`
// PrometheusMetricsPort is the TCP port that the experimental Prometheus
// metrics server should bind to (default: 9091)
PrometheusMetricsPort int32 `json:"prometheusMetricsPort,omitempty"`
// PrometheusGoMetricsEnabled enables Prometheus Go runtime metrics collection
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
}
// CanalNetworkingSpec declares that we want Canal networking

View File

@ -380,6 +380,10 @@ func Convert_v1alpha1_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *Cali
func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha1_CalicoNetworkingSpec(in *kops.CalicoNetworkingSpec, out *CalicoNetworkingSpec, s conversion.Scope) error {
out.CrossSubnet = in.CrossSubnet
out.PrometheusMetricsEnabled = in.PrometheusMetricsEnabled
out.PrometheusMetricsPort = in.PrometheusMetricsPort
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
return nil
}

View File

@ -70,6 +70,16 @@ type FlannelNetworkingSpec struct {
// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
CrossSubnet bool `json:"crossSubnet,omitempty"` // Enables Calico's cross-subnet mode when set to true
// PrometheusMetricsEnabled can be set to enable the experimental Prometheus
// metrics server (default: false)
PrometheusMetricsEnabled bool `json:"prometheusMetricsEnabled,omitempty"`
// PrometheusMetricsPort is the TCP port that the experimental Prometheus
// metrics server should bind to (default: 9091)
PrometheusMetricsPort int32 `json:"prometheusMetricsPort,omitempty"`
// PrometheusGoMetricsEnabled enables Prometheus Go runtime metrics collection
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
}
// CanalNetworkingSpec declares that we want Canal networking

View File

@ -416,6 +416,10 @@ func Convert_v1alpha2_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *Cali
func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha2_CalicoNetworkingSpec(in *kops.CalicoNetworkingSpec, out *CalicoNetworkingSpec, s conversion.Scope) error {
out.CrossSubnet = in.CrossSubnet
out.PrometheusMetricsEnabled = in.PrometheusMetricsEnabled
out.PrometheusMetricsPort = in.PrometheusMetricsPort
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
return nil
}

View File

@ -182,6 +182,18 @@ spec:
# Set Felix logging to "info"
- name: FELIX_LOGSEVERITYSCREEN
value: "info"
# Set to enable the experimental Prometheus metrics server
- name: FELIX_PROMETHEUSMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusMetricsEnabled "false" }}"
# TCP port that the Prometheus metrics server should bind to
- name: FELIX_PROMETHEUSMETRICSPORT
value: "{{- or .Networking.Calico.PrometheusMetricsPort "9091" }}"
# Enable Prometheus Go runtime metrics collection
- name: FELIX_PROMETHEUSGOMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusGoMetricsEnabled "true" }}"
# Enable Prometheus process metrics collection
- name: FELIX_PROMETHEUSPROCESSMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusProcessMetricsEnabled "true" }}"
- name: FELIX_HEALTHENABLED
value: "true"
securityContext:

View File

@ -193,6 +193,18 @@ spec:
# Set Felix logging to "info"
- name: FELIX_LOGSEVERITYSCREEN
value: "info"
# Set to enable the experimental Prometheus metrics server
- name: FELIX_PROMETHEUSMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusMetricsEnabled "false" }}"
# TCP port that the Prometheus metrics server should bind to
- name: FELIX_PROMETHEUSMETRICSPORT
value: "{{- or .Networking.Calico.PrometheusMetricsPort "9091" }}"
# Enable Prometheus Go runtime metrics collection
- name: FELIX_PROMETHEUSGOMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusGoMetricsEnabled "true" }}"
# Enable Prometheus process metrics collection
- name: FELIX_PROMETHEUSPROCESSMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusProcessMetricsEnabled "true" }}"
- name: FELIX_HEALTHENABLED
value: "true"
securityContext:

View File

@ -100,6 +100,18 @@ spec:
# Auto-detect the BGP IP address.
- name: IP
value: ""
# Set to enable the experimental Prometheus metrics server
- name: FELIX_PROMETHEUSMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusMetricsEnabled "false" }}"
# TCP port that the Prometheus metrics server should bind to
- name: FELIX_PROMETHEUSMETRICSPORT
value: "{{- or .Networking.Calico.PrometheusMetricsPort "9091" }}"
# Enable Prometheus Go runtime metrics collection
- name: FELIX_PROMETHEUSGOMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusGoMetricsEnabled "true" }}"
# Enable Prometheus process metrics collection
- name: FELIX_PROMETHEUSPROCESSMETRICSENABLED
value: "{{- or .Networking.Calico.PrometheusProcessMetricsEnabled "true" }}"
securityContext:
privileged: true
volumeMounts: