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

add csi cinder metrics #15341

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ spec:
type: boolean
ignore-volume-microversion:
type: boolean
metricsEnabled:
type: boolean
override-volume-az:
type: string
type: object
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ type OpenstackBlockStorageConfig struct {
IgnoreAZ *bool `json:"ignore-volume-az,omitempty"`
OverrideAZ *string `json:"override-volume-az,omitempty"`
IgnoreVolumeMicroVersion *bool `json:"ignore-volume-microversion,omitempty"`
MetricsEnabled *bool `json:"metricsEnabled,omitempty"`
// CreateStorageClass provisions a default class for the Cinder plugin
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ type OpenstackBlockStorageConfig struct {
IgnoreAZ *bool `json:"ignore-volume-az,omitempty"`
OverrideAZ *string `json:"override-volume-az,omitempty"`
IgnoreVolumeMicroVersion *bool `json:"ignore-volume-microversion,omitempty"`
MetricsEnabled *bool `json:"metricsEnabled,omitempty"`
// CreateStorageClass provisions a default class for the Cinder plugin
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/kops/v1alpha3/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ type OpenstackBlockStorageConfig struct {
IgnoreAZ *bool `json:"ignore-volume-az,omitempty"`
OverrideAZ *string `json:"override-volume-az,omitempty"`
IgnoreVolumeMicroVersion *bool `json:"ignore-volume-microversion,omitempty"`
MetricsEnabled *bool `json:"metricsEnabled,omitempty"`
// CreateStorageClass provisions a default class for the Cinder plugin
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions pkg/model/openstackmodel/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,20 @@ func (b *FirewallModelBuilder) addNodeExporterAndOccmRules(c *fi.CloudupModelBui
PortRangeMax: i(10258),
}
b.addDirectionalGroupRule(c, masterSG, nodeSG, occmMetrics)

if fi.ValueOf(b.Cluster.Spec.CloudProvider.Openstack.BlockStorage.MetricsEnabled) {
csiMetrics := &openstacktasks.SecurityGroupRule{
Lifecycle: b.Lifecycle,
Direction: s(string(rules.DirIngress)),
Protocol: s(IPProtocolTCP),
EtherType: s(IPV4),
PortRangeMin: i(9809),
PortRangeMax: i(9809),
}
// allow 9809 port from nodeSG & masterSG
b.addDirectionalGroupRule(c, masterSG, nodeSG, csiMetrics)
b.addDirectionalGroupRule(c, nodeSG, nodeSG, csiMetrics)
}
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ spec:
serviceAccount: csi-cinder-controller-sa
containers:
- name: csi-attacher
image: registry.k8s.io/sig-storage/csi-attacher:v3.4.0
image: registry.k8s.io/sig-storage/csi-attacher:v4.2.0
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
Expand All @@ -263,7 +263,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.1.0
image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.1
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
Expand All @@ -282,7 +282,7 @@ spec:
mountPath: /var/lib/csi/sockets/pluginproxy/
{{ if HasSnapshotController }}
- name: csi-snapshotter
image: registry.k8s.io/sig-storage/csi-snapshotter:v5.0.1
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.2.1
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
Expand All @@ -297,7 +297,7 @@ spec:
name: socket-dir
{{ end }}
- name: csi-resizer
image: registry.k8s.io/sig-storage/csi-resizer:v1.4.0
image: registry.k8s.io/sig-storage/csi-resizer:v1.7.0
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
Expand All @@ -311,7 +311,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: liveness-probe
image: registry.k8s.io/sig-storage/livenessprobe:v2.6.0
image: registry.k8s.io/sig-storage/livenessprobe:v2.9.0
args:
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -327,6 +327,9 @@ spec:
- "--endpoint=$(CSI_ENDPOINT)"
- "--cloud-config=$(CLOUD_CONFIG)"
- "--cluster=$(CLUSTER_NAME)"
{{- if WithDefaultBool .CloudProvider.Openstack.BlockStorage.MetricsEnabled false }}
- "--http-endpoint=:9809"
{{- end }}
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
Expand All @@ -339,6 +342,11 @@ spec:
- containerPort: 9808
name: healthz
protocol: TCP
{{- if WithDefaultBool .CloudProvider.Openstack.BlockStorage.MetricsEnabled false }}
- containerPort: 9809
name: metrics
protocol: TCP
{{- end }}
livenessProbe:
failureThreshold: 5
httpGet:
Expand Down Expand Up @@ -426,7 +434,7 @@ spec:
hostNetwork: true
containers:
- name: node-driver-registrar
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.0
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.6.3
args:
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
Expand All @@ -446,7 +454,7 @@ spec:
- name: registration-dir
mountPath: /registration
- name: liveness-probe
image: registry.k8s.io/sig-storage/livenessprobe:v2.6.0
image: registry.k8s.io/sig-storage/livenessprobe:v2.9.0
args:
- --csi-address=/csi/csi.sock
volumeMounts:
Expand All @@ -467,6 +475,9 @@ spec:
- "--cloud-config=$(CLOUD_CONFIG)"
{{- if .CloudProvider.Openstack.BlockStorage.ClusterName }}
- "--cluster=$(CLUSTER_NAME)"
{{- end }}
{{- if WithDefaultBool .CloudProvider.Openstack.BlockStorage.MetricsEnabled false }}
- "--http-endpoint=:9809"
{{- end }}
env:
- name: CSI_ENDPOINT
Expand All @@ -482,6 +493,11 @@ spec:
- containerPort: 9808
name: healthz
protocol: TCP
{{- if WithDefaultBool .CloudProvider.Openstack.BlockStorage.MetricsEnabled false }}
- containerPort: 9809
name: metrics
protocol: TCP
{{- end }}
livenessProbe:
failureThreshold: 5
httpGet:
Expand Down
Loading