mirror of https://github.com/kubernetes/kops.git
Make it possible to enable Prometheus metrics for Cilium
This commit is contained in:
parent
051ceeea70
commit
eed15b471a
|
|
@ -2547,6 +2547,8 @@ spec:
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
agentPrometheusPort:
|
||||||
|
type: integer
|
||||||
allowLocalhost:
|
allowLocalhost:
|
||||||
type: string
|
type: string
|
||||||
autoDirectNodeRoutes:
|
autoDirectNodeRoutes:
|
||||||
|
|
@ -2593,6 +2595,8 @@ spec:
|
||||||
type: boolean
|
type: boolean
|
||||||
enablePolicy:
|
enablePolicy:
|
||||||
type: string
|
type: string
|
||||||
|
enablePrometheusMetrics:
|
||||||
|
type: boolean
|
||||||
enableTracing:
|
enableTracing:
|
||||||
type: boolean
|
type: boolean
|
||||||
enableipv4:
|
enableipv4:
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,7 @@ type CiliumNetworkingSpec struct {
|
||||||
|
|
||||||
AccessLog string `json:"accessLog,omitempty"`
|
AccessLog string `json:"accessLog,omitempty"`
|
||||||
AgentLabels []string `json:"agentLabels,omitempty"`
|
AgentLabels []string `json:"agentLabels,omitempty"`
|
||||||
|
AgentPrometheusPort int `json:"agentPrometheusPort,omitempty"`
|
||||||
AllowLocalhost string `json:"allowLocalhost,omitempty"`
|
AllowLocalhost string `json:"allowLocalhost,omitempty"`
|
||||||
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
|
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
|
||||||
BPFRoot string `json:"bpfRoot,omitempty"`
|
BPFRoot string `json:"bpfRoot,omitempty"`
|
||||||
|
|
@ -213,6 +214,7 @@ type CiliumNetworkingSpec struct {
|
||||||
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
|
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
|
||||||
EnablePolicy string `json:"enablePolicy,omitempty"`
|
EnablePolicy string `json:"enablePolicy,omitempty"`
|
||||||
EnableTracing bool `json:"enableTracing,omitempty"`
|
EnableTracing bool `json:"enableTracing,omitempty"`
|
||||||
|
EnablePrometheusMetrics bool `json:"enablePrometheusMetrics,omitempty"`
|
||||||
EnvoyLog string `json:"envoyLog,omitempty"`
|
EnvoyLog string `json:"envoyLog,omitempty"`
|
||||||
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
|
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
|
||||||
Ipv4Node string `json:"ipv4Node,omitempty"`
|
Ipv4Node string `json:"ipv4Node,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ type CiliumNetworkingSpec struct {
|
||||||
|
|
||||||
AccessLog string `json:"accessLog,omitempty"`
|
AccessLog string `json:"accessLog,omitempty"`
|
||||||
AgentLabels []string `json:"agentLabels,omitempty"`
|
AgentLabels []string `json:"agentLabels,omitempty"`
|
||||||
|
AgentPrometheusPort int `json:"agentPrometheusPort,omitempty"`
|
||||||
AllowLocalhost string `json:"allowLocalhost,omitempty"`
|
AllowLocalhost string `json:"allowLocalhost,omitempty"`
|
||||||
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
|
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
|
||||||
BPFRoot string `json:"bpfRoot,omitempty"`
|
BPFRoot string `json:"bpfRoot,omitempty"`
|
||||||
|
|
@ -209,6 +210,7 @@ type CiliumNetworkingSpec struct {
|
||||||
DisableIpv4 bool `json:"disableIpv4,omitempty"`
|
DisableIpv4 bool `json:"disableIpv4,omitempty"`
|
||||||
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
|
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
|
||||||
EnablePolicy string `json:"enablePolicy,omitempty"`
|
EnablePolicy string `json:"enablePolicy,omitempty"`
|
||||||
|
EnablePrometheusMetrics bool `json:"enablePrometheusMetrics,omitempty"`
|
||||||
EnableTracing bool `json:"enableTracing,omitempty"`
|
EnableTracing bool `json:"enableTracing,omitempty"`
|
||||||
EnvoyLog string `json:"envoyLog,omitempty"`
|
EnvoyLog string `json:"envoyLog,omitempty"`
|
||||||
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
|
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -1250,6 +1250,7 @@ func autoConvert_v1alpha1_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
|
||||||
out.Version = in.Version
|
out.Version = in.Version
|
||||||
out.AccessLog = in.AccessLog
|
out.AccessLog = in.AccessLog
|
||||||
out.AgentLabels = in.AgentLabels
|
out.AgentLabels = in.AgentLabels
|
||||||
|
out.AgentPrometheusPort = in.AgentPrometheusPort
|
||||||
out.AllowLocalhost = in.AllowLocalhost
|
out.AllowLocalhost = in.AllowLocalhost
|
||||||
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
||||||
out.BPFRoot = in.BPFRoot
|
out.BPFRoot = in.BPFRoot
|
||||||
|
|
@ -1262,6 +1263,7 @@ func autoConvert_v1alpha1_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
|
||||||
out.DisableIpv4 = in.DisableIpv4
|
out.DisableIpv4 = in.DisableIpv4
|
||||||
out.DisableK8sServices = in.DisableK8sServices
|
out.DisableK8sServices = in.DisableK8sServices
|
||||||
out.EnablePolicy = in.EnablePolicy
|
out.EnablePolicy = in.EnablePolicy
|
||||||
|
out.EnablePrometheusMetrics = in.EnablePrometheusMetrics
|
||||||
out.EnableTracing = in.EnableTracing
|
out.EnableTracing = in.EnableTracing
|
||||||
out.EnvoyLog = in.EnvoyLog
|
out.EnvoyLog = in.EnvoyLog
|
||||||
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
||||||
|
|
@ -1326,6 +1328,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha1_CiliumNetworkingSpec(in *
|
||||||
out.Version = in.Version
|
out.Version = in.Version
|
||||||
out.AccessLog = in.AccessLog
|
out.AccessLog = in.AccessLog
|
||||||
out.AgentLabels = in.AgentLabels
|
out.AgentLabels = in.AgentLabels
|
||||||
|
out.AgentPrometheusPort = in.AgentPrometheusPort
|
||||||
out.AllowLocalhost = in.AllowLocalhost
|
out.AllowLocalhost = in.AllowLocalhost
|
||||||
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
||||||
out.BPFRoot = in.BPFRoot
|
out.BPFRoot = in.BPFRoot
|
||||||
|
|
@ -1339,6 +1342,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha1_CiliumNetworkingSpec(in *
|
||||||
out.DisableK8sServices = in.DisableK8sServices
|
out.DisableK8sServices = in.DisableK8sServices
|
||||||
out.EnablePolicy = in.EnablePolicy
|
out.EnablePolicy = in.EnablePolicy
|
||||||
out.EnableTracing = in.EnableTracing
|
out.EnableTracing = in.EnableTracing
|
||||||
|
out.EnablePrometheusMetrics = in.EnablePrometheusMetrics
|
||||||
out.EnvoyLog = in.EnvoyLog
|
out.EnvoyLog = in.EnvoyLog
|
||||||
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
||||||
out.Ipv4Node = in.Ipv4Node
|
out.Ipv4Node = in.Ipv4Node
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,7 @@ type CiliumNetworkingSpec struct {
|
||||||
|
|
||||||
AccessLog string `json:"accessLog,omitempty"`
|
AccessLog string `json:"accessLog,omitempty"`
|
||||||
AgentLabels []string `json:"agentLabels,omitempty"`
|
AgentLabels []string `json:"agentLabels,omitempty"`
|
||||||
|
AgentPrometheusPort int `json:"agentPrometheusPort,omitempty"`
|
||||||
AllowLocalhost string `json:"allowLocalhost,omitempty"`
|
AllowLocalhost string `json:"allowLocalhost,omitempty"`
|
||||||
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
|
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
|
||||||
BPFRoot string `json:"bpfRoot,omitempty"`
|
BPFRoot string `json:"bpfRoot,omitempty"`
|
||||||
|
|
@ -210,6 +211,7 @@ type CiliumNetworkingSpec struct {
|
||||||
DisableIpv4 bool `json:"disableIpv4,omitempty"`
|
DisableIpv4 bool `json:"disableIpv4,omitempty"`
|
||||||
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
|
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
|
||||||
EnablePolicy string `json:"enablePolicy,omitempty"`
|
EnablePolicy string `json:"enablePolicy,omitempty"`
|
||||||
|
EnablePrometheusMetrics bool `json:"enablePrometheusMetrics,omitempty"`
|
||||||
EnableTracing bool `json:"enableTracing,omitempty"`
|
EnableTracing bool `json:"enableTracing,omitempty"`
|
||||||
EnvoyLog string `json:"envoyLog,omitempty"`
|
EnvoyLog string `json:"envoyLog,omitempty"`
|
||||||
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
|
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -1292,6 +1292,7 @@ func autoConvert_v1alpha2_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
|
||||||
out.Version = in.Version
|
out.Version = in.Version
|
||||||
out.AccessLog = in.AccessLog
|
out.AccessLog = in.AccessLog
|
||||||
out.AgentLabels = in.AgentLabels
|
out.AgentLabels = in.AgentLabels
|
||||||
|
out.AgentPrometheusPort = in.AgentPrometheusPort
|
||||||
out.AllowLocalhost = in.AllowLocalhost
|
out.AllowLocalhost = in.AllowLocalhost
|
||||||
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
||||||
out.BPFRoot = in.BPFRoot
|
out.BPFRoot = in.BPFRoot
|
||||||
|
|
@ -1304,6 +1305,7 @@ func autoConvert_v1alpha2_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
|
||||||
out.DisableIpv4 = in.DisableIpv4
|
out.DisableIpv4 = in.DisableIpv4
|
||||||
out.DisableK8sServices = in.DisableK8sServices
|
out.DisableK8sServices = in.DisableK8sServices
|
||||||
out.EnablePolicy = in.EnablePolicy
|
out.EnablePolicy = in.EnablePolicy
|
||||||
|
out.EnablePrometheusMetrics = in.EnablePrometheusMetrics
|
||||||
out.EnableTracing = in.EnableTracing
|
out.EnableTracing = in.EnableTracing
|
||||||
out.EnvoyLog = in.EnvoyLog
|
out.EnvoyLog = in.EnvoyLog
|
||||||
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
||||||
|
|
@ -1368,6 +1370,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha2_CiliumNetworkingSpec(in *
|
||||||
out.Version = in.Version
|
out.Version = in.Version
|
||||||
out.AccessLog = in.AccessLog
|
out.AccessLog = in.AccessLog
|
||||||
out.AgentLabels = in.AgentLabels
|
out.AgentLabels = in.AgentLabels
|
||||||
|
out.AgentPrometheusPort = in.AgentPrometheusPort
|
||||||
out.AllowLocalhost = in.AllowLocalhost
|
out.AllowLocalhost = in.AllowLocalhost
|
||||||
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
||||||
out.BPFRoot = in.BPFRoot
|
out.BPFRoot = in.BPFRoot
|
||||||
|
|
@ -1381,6 +1384,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha2_CiliumNetworkingSpec(in *
|
||||||
out.DisableK8sServices = in.DisableK8sServices
|
out.DisableK8sServices = in.DisableK8sServices
|
||||||
out.EnablePolicy = in.EnablePolicy
|
out.EnablePolicy = in.EnablePolicy
|
||||||
out.EnableTracing = in.EnableTracing
|
out.EnableTracing = in.EnableTracing
|
||||||
|
out.EnablePrometheusMetrics = in.EnablePrometheusMetrics
|
||||||
out.EnvoyLog = in.EnvoyLog
|
out.EnvoyLog = in.EnvoyLog
|
||||||
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
out.Ipv4ClusterCIDRMaskSize = in.Ipv4ClusterCIDRMaskSize
|
||||||
out.Ipv4Node = in.Ipv4Node
|
out.Ipv4Node = in.Ipv4Node
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,15 @@ data:
|
||||||
identity-allocation-mode: crd
|
identity-allocation-mode: crd
|
||||||
# If you want to run cilium in debug mode change this value to true
|
# If you want to run cilium in debug mode change this value to true
|
||||||
debug: "{{- if .Debug -}}true{{- else -}}false{{- end -}}"
|
debug: "{{- if .Debug -}}true{{- else -}}false{{- end -}}"
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
# If you want metrics enabled in all of your Cilium agents, set the port for
|
||||||
|
# which the Cilium agents will have their metrics exposed.
|
||||||
|
# This option deprecates the "prometheus-serve-addr" in the
|
||||||
|
# "cilium-metrics-config" ConfigMap
|
||||||
|
# NOTE that this will open the port on ALL nodes where Cilium pods are
|
||||||
|
# scheduled.
|
||||||
|
prometheus-serve-addr: ":{{- or .AgentPrometheusPort "9090" }}"
|
||||||
|
{{ end }}
|
||||||
# Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
|
# Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
|
||||||
# address.
|
# address.
|
||||||
enable-ipv4: "{{- if or (.EnableIpv4) (and (not (.EnableIpv4)) (not (.EnableIpv6))) -}}true{{- else -}}false{{- end -}}"
|
enable-ipv4: "{{- if or (.EnableIpv4) (and (not (.EnableIpv4)) (not (.EnableIpv6))) -}}true{{- else -}}false{{- end -}}"
|
||||||
|
|
@ -385,6 +394,13 @@ spec:
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
name: cilium-agent
|
name: cilium-agent
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ or .AgentPrometheusPort "9090" }}
|
||||||
|
hostPort: {{ or .AgentPrometheusPort "9090" }}
|
||||||
|
name: prometheus
|
||||||
|
protocol: TCP
|
||||||
|
{{ end }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
|
|
@ -543,6 +559,10 @@ spec:
|
||||||
- args:
|
- args:
|
||||||
- --debug=$(CILIUM_DEBUG)
|
- --debug=$(CILIUM_DEBUG)
|
||||||
- --identity-allocation-mode=$(CILIUM_IDENTITY_ALLOCATION_MODE)
|
- --identity-allocation-mode=$(CILIUM_IDENTITY_ALLOCATION_MODE)
|
||||||
|
{{ with .Networking.Cilium }}
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
- --enable-metrics
|
||||||
|
{{ end }}
|
||||||
command:
|
command:
|
||||||
- cilium-operator
|
- cilium-operator
|
||||||
env:
|
env:
|
||||||
|
|
@ -622,12 +642,17 @@ spec:
|
||||||
key: AWS_DEFAULT_REGION
|
key: AWS_DEFAULT_REGION
|
||||||
name: cilium-aws
|
name: cilium-aws
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
{{ with .Networking.Cilium }}
|
|
||||||
image: "docker.io/cilium/operator:{{ .Version }}"
|
image: "docker.io/cilium/operator:{{ .Version }}"
|
||||||
{{ end }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: cilium-operator
|
name: cilium-operator
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
ports:
|
||||||
|
- containerPort: 6942
|
||||||
|
hostPort: 6942
|
||||||
|
name: prometheus
|
||||||
|
protocol: TCP
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,15 @@ data:
|
||||||
identity-allocation-mode: crd
|
identity-allocation-mode: crd
|
||||||
# If you want to run cilium in debug mode change this value to true
|
# If you want to run cilium in debug mode change this value to true
|
||||||
debug: "{{- if .Debug -}}true{{- else -}}false{{- end -}}"
|
debug: "{{- if .Debug -}}true{{- else -}}false{{- end -}}"
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
# If you want metrics enabled in all of your Cilium agents, set the port for
|
||||||
|
# which the Cilium agents will have their metrics exposed.
|
||||||
|
# This option deprecates the "prometheus-serve-addr" in the
|
||||||
|
# "cilium-metrics-config" ConfigMap
|
||||||
|
# NOTE that this will open the port on ALL nodes where Cilium pods are
|
||||||
|
# scheduled.
|
||||||
|
prometheus-serve-addr: ":{{- or .AgentPrometheusPort "9090" }}"
|
||||||
|
{{ end }}
|
||||||
# Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
|
# Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4
|
||||||
# address.
|
# address.
|
||||||
enable-ipv4: "{{- if or (.EnableIpv4) (and (not (.EnableIpv4)) (not (.EnableIpv6))) -}}true{{- else -}}false{{- end -}}"
|
enable-ipv4: "{{- if or (.EnableIpv4) (and (not (.EnableIpv4)) (not (.EnableIpv6))) -}}true{{- else -}}false{{- end -}}"
|
||||||
|
|
@ -385,6 +394,13 @@ spec:
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
name: cilium-agent
|
name: cilium-agent
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ or .AgentPrometheusPort "9090" }}
|
||||||
|
hostPort: {{ or .AgentPrometheusPort "9090" }}
|
||||||
|
name: prometheus
|
||||||
|
protocol: TCP
|
||||||
|
{{ end }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
|
|
@ -541,6 +557,10 @@ spec:
|
||||||
containers:
|
containers:
|
||||||
- args:
|
- args:
|
||||||
- --debug=$(CILIUM_DEBUG)
|
- --debug=$(CILIUM_DEBUG)
|
||||||
|
{{ with .Networking.Cilium }}
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
- --enable-metrics
|
||||||
|
{{ end }}
|
||||||
command:
|
command:
|
||||||
- cilium-operator
|
- cilium-operator
|
||||||
env:
|
env:
|
||||||
|
|
@ -614,12 +634,17 @@ spec:
|
||||||
key: AWS_DEFAULT_REGION
|
key: AWS_DEFAULT_REGION
|
||||||
name: cilium-aws
|
name: cilium-aws
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
{{ with .Networking.Cilium }}
|
|
||||||
image: "docker.io/cilium/operator:{{ .Version }}"
|
image: "docker.io/cilium/operator:{{ .Version }}"
|
||||||
{{ end }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: cilium-operator
|
name: cilium-operator
|
||||||
|
{{ if .EnablePrometheusMetrics }}
|
||||||
|
ports:
|
||||||
|
- containerPort: 6942
|
||||||
|
hostPort: 6942
|
||||||
|
name: prometheus
|
||||||
|
protocol: TCP
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue