Coverage for ocp_resources/prometheus.py: 0%

320 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-30 10:48 +0200

1# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md 

2 

3from typing import Any, Dict, List, Optional 

4from ocp_resources.resource import NamespacedResource 

5 

6 

7class Prometheus(NamespacedResource): 

8 """ 

9 Prometheus defines a Prometheus deployment. 

10 """ 

11 

12 api_group: str = NamespacedResource.ApiGroup.MONITORING_COREOS_COM 

13 

14 def __init__( 

15 self, 

16 additional_alert_manager_configs: Optional[Dict[str, Any]] = None, 

17 additional_alert_relabel_configs: Optional[Dict[str, Any]] = None, 

18 additional_args: Optional[List[Any]] = None, 

19 additional_scrape_configs: Optional[Dict[str, Any]] = None, 

20 affinity: Optional[Dict[str, Any]] = None, 

21 alerting: Optional[Dict[str, Any]] = None, 

22 allow_overlapping_blocks: Optional[bool] = None, 

23 apiserver_config: Optional[Dict[str, Any]] = None, 

24 arbitrary_fs_access_through_sms: Optional[Dict[str, Any]] = None, 

25 automount_service_account_token: Optional[bool] = None, 

26 base_image: Optional[str] = "", 

27 body_size_limit: Optional[str] = "", 

28 config_maps: Optional[List[Any]] = None, 

29 containers: Optional[List[Any]] = None, 

30 disable_compaction: Optional[bool] = None, 

31 enable_admin_api: Optional[bool] = None, 

32 enable_features: Optional[List[Any]] = None, 

33 enable_remote_write_receiver: Optional[bool] = None, 

34 enforced_body_size_limit: Optional[str] = "", 

35 enforced_keep_dropped_targets: Optional[int] = None, 

36 enforced_label_limit: Optional[int] = None, 

37 enforced_label_name_length_limit: Optional[int] = None, 

38 enforced_label_value_length_limit: Optional[int] = None, 

39 enforced_namespace_label: Optional[str] = "", 

40 enforced_sample_limit: Optional[int] = None, 

41 enforced_target_limit: Optional[int] = None, 

42 evaluation_interval: Optional[str] = "", 

43 excluded_from_enforcement: Optional[List[Any]] = None, 

44 exemplars: Optional[Dict[str, Any]] = None, 

45 external_labels: Optional[Dict[str, Any]] = None, 

46 external_url: Optional[str] = "", 

47 host_aliases: Optional[List[Any]] = None, 

48 host_network: Optional[bool] = None, 

49 ignore_namespace_selectors: Optional[bool] = None, 

50 image: Optional[str] = "", 

51 image_pull_policy: Optional[str] = "", 

52 image_pull_secrets: Optional[List[Any]] = None, 

53 init_containers: Optional[List[Any]] = None, 

54 keep_dropped_targets: Optional[int] = None, 

55 label_limit: Optional[int] = None, 

56 label_name_length_limit: Optional[int] = None, 

57 label_value_length_limit: Optional[int] = None, 

58 listen_local: Optional[bool] = None, 

59 log_format: Optional[str] = "", 

60 log_level: Optional[str] = "", 

61 maximum_startup_duration_seconds: Optional[int] = None, 

62 min_ready_seconds: Optional[int] = None, 

63 node_selector: Optional[Dict[str, Any]] = None, 

64 override_honor_labels: Optional[bool] = None, 

65 override_honor_timestamps: Optional[bool] = None, 

66 paused: Optional[bool] = None, 

67 persistent_volume_claim_retention_policy: Optional[Dict[str, Any]] = None, 

68 pod_metadata: Optional[Dict[str, Any]] = None, 

69 pod_monitor_namespace_selector: Optional[Dict[str, Any]] = None, 

70 pod_monitor_selector: Optional[Dict[str, Any]] = None, 

71 pod_target_labels: Optional[List[Any]] = None, 

72 port_name: Optional[str] = "", 

73 priority_class_name: Optional[str] = "", 

74 probe_namespace_selector: Optional[Dict[str, Any]] = None, 

75 probe_selector: Optional[Dict[str, Any]] = None, 

76 prometheus_external_label_name: Optional[str] = "", 

77 prometheus_rules_excluded_from_enforce: Optional[List[Any]] = None, 

78 query: Optional[Dict[str, Any]] = None, 

79 query_log_file: Optional[str] = "", 

80 reload_strategy: Optional[str] = "", 

81 remote_read: Optional[List[Any]] = None, 

82 remote_write: Optional[List[Any]] = None, 

83 replica_external_label_name: Optional[str] = "", 

84 replicas: Optional[int] = None, 

85 resources: Optional[Dict[str, Any]] = None, 

86 retention: Optional[str] = "", 

87 retention_size: Optional[str] = "", 

88 route_prefix: Optional[str] = "", 

89 rule_namespace_selector: Optional[Dict[str, Any]] = None, 

90 rule_selector: Optional[Dict[str, Any]] = None, 

91 rules: Optional[Dict[str, Any]] = None, 

92 sample_limit: Optional[int] = None, 

93 scrape_classes: Optional[List[Any]] = None, 

94 scrape_config_namespace_selector: Optional[Dict[str, Any]] = None, 

95 scrape_config_selector: Optional[Dict[str, Any]] = None, 

96 scrape_interval: Optional[str] = "", 

97 scrape_protocols: Optional[List[Any]] = None, 

98 scrape_timeout: Optional[str] = "", 

99 secrets: Optional[List[Any]] = None, 

100 security_context: Optional[Dict[str, Any]] = None, 

101 service_account_name: Optional[str] = "", 

102 service_monitor_namespace_selector: Optional[Dict[str, Any]] = None, 

103 service_monitor_selector: Optional[Dict[str, Any]] = None, 

104 sha: Optional[str] = "", 

105 shards: Optional[int] = None, 

106 storage: Optional[Dict[str, Any]] = None, 

107 tag: Optional[str] = "", 

108 target_limit: Optional[int] = None, 

109 thanos: Optional[Dict[str, Any]] = None, 

110 tolerations: Optional[List[Any]] = None, 

111 topology_spread_constraints: Optional[List[Any]] = None, 

112 tracing_config: Optional[Dict[str, Any]] = None, 

113 tsdb: Optional[Dict[str, Any]] = None, 

114 version: Optional[str] = "", 

115 volume_mounts: Optional[List[Any]] = None, 

116 volumes: Optional[List[Any]] = None, 

117 wal_compression: Optional[bool] = None, 

118 web: Optional[Dict[str, Any]] = None, 

119 **kwargs: Any, 

120 ) -> None: 

121 """ 

122 Args: 

123 additional_alert_manager_configs (Dict[str, Any]): AdditionalAlertManagerConfigs specifies a key of a Secret containing 

124 additional Prometheus Alertmanager configurations. The 

125 Alertmanager configurations are appended to the configuration 

126 generated by the Prometheus Operator. They must be formatted 

127 according to the official Prometheus documentation: https://prom 

128 etheus.io/docs/prometheus/latest/configuration/configuration/#aler 

129 tmanager_config The user is responsible for making sure that the 

130 configurations are valid Note that using this feature may expose 

131 the possibility to break upgrades of Prometheus. It is advised to 

132 review Prometheus release notes to ensure that no incompatible 

133 AlertManager configs are going to break Prometheus after the 

134 upgrade. 

135 

136 additional_alert_relabel_configs (Dict[str, Any]): AdditionalAlertRelabelConfigs specifies a key of a Secret containing 

137 additional Prometheus alert relabel configurations. The alert 

138 relabel configurations are appended to the configuration generated 

139 by the Prometheus Operator. They must be formatted according to 

140 the official Prometheus documentation: https://prometheus.io/doc 

141 s/prometheus/latest/configuration/configuration/#alert_relabel_con 

142 figs The user is responsible for making sure that the 

143 configurations are valid Note that using this feature may expose 

144 the possibility to break upgrades of Prometheus. It is advised to 

145 review Prometheus release notes to ensure that no incompatible 

146 alert relabel configs are going to break Prometheus after the 

147 upgrade. 

148 

149 additional_args (List[Any]): AdditionalArgs allows setting additional arguments for the 

150 'prometheus' container. It is intended for e.g. activating 

151 hidden flags which are not supported by the dedicated 

152 configuration options yet. The arguments are passed as-is to the 

153 Prometheus container which may cause issues if they are invalid or 

154 not supported by the given Prometheus version. In case of an 

155 argument conflict (e.g. an argument which is already set by the 

156 operator itself) or when providing an invalid argument, the 

157 reconciliation will fail and an error will be logged. 

158 

159 additional_scrape_configs (Dict[str, Any]): AdditionalScrapeConfigs allows specifying a key of a Secret containing 

160 additional Prometheus scrape configurations. Scrape configurations 

161 specified are appended to the configurations generated by the 

162 Prometheus Operator. Job configurations specified must have the 

163 form as specified in the official Prometheus documentation: https: 

164 //prometheus.io/docs/prometheus/latest/configuration/configuration 

165 /#scrape_config. As scrape configs are appended, the user is 

166 responsible to make sure it is valid. Note that using this feature 

167 may expose the possibility to break upgrades of Prometheus. It is 

168 advised to review Prometheus release notes to ensure that no 

169 incompatible scrape configs are going to break Prometheus after 

170 the upgrade. 

171 

172 affinity (Dict[str, Any]): Defines the Pods' affinity scheduling rules if specified. 

173 

174 alerting (Dict[str, Any]): Defines the settings related to Alertmanager. 

175 

176 allow_overlapping_blocks (bool): AllowOverlappingBlocks enables vertical compaction and vertical query 

177 merge in Prometheus. Deprecated: this flag has no effect for 

178 Prometheus >= 2.39.0 where overlapping blocks are enabled by 

179 default. 

180 

181 apiserver_config (Dict[str, Any]): APIServerConfig allows specifying a host and auth methods to access 

182 the Kuberntees API server. If null, Prometheus is assumed to run 

183 inside of the cluster: it will discover the API servers 

184 automatically and use the Pod's CA certificate and bearer token 

185 file at /var/run/secrets/kubernetes.io/serviceaccount/. 

186 

187 arbitrary_fs_access_through_sms (Dict[str, Any]): When true, ServiceMonitor, PodMonitor and Probe object are forbidden 

188 to reference arbitrary files on the file system of the 

189 'prometheus' container. When a ServiceMonitor's endpoint specifies 

190 a `bearerTokenFile` value (e.g. 

191 '/var/run/secrets/kubernetes.io/serviceaccount/token'), a 

192 malicious target can get access to the Prometheus service 

193 account's token in the Prometheus' scrape request. Setting 

194 `spec.arbitraryFSAccessThroughSM` to 'true' would prevent the 

195 attack. Users should instead provide the credentials using the 

196 `spec.bearerTokenSecret` field. 

197 

198 automount_service_account_token (bool): AutomountServiceAccountToken indicates whether a service account token 

199 should be automatically mounted in the pod. If the field isn't 

200 set, the operator mounts the service account token by default. 

201 **Warning:** be aware that by default, Prometheus requires the 

202 service account token for Kubernetes service discovery. It is 

203 possible to use strategic merge patch to project the service 

204 account token into the 'prometheus' container. 

205 

206 base_image (str): Deprecated: use 'spec.image' instead. 

207 

208 body_size_limit (str): BodySizeLimit defines per-scrape on response body size. Only valid in 

209 Prometheus versions 2.45.0 and newer. Note that the global limit 

210 only applies to scrape objects that don't specify an explicit 

211 limit value. If you want to enforce a maximum limit for all scrape 

212 objects, refer to enforcedBodySizeLimit. 

213 

214 config_maps (List[Any]): ConfigMaps is a list of ConfigMaps in the same namespace as the 

215 Prometheus object, which shall be mounted into the Prometheus 

216 Pods. Each ConfigMap is added to the StatefulSet definition as a 

217 volume named `configmap-<configmap-name>`. The ConfigMaps are 

218 mounted into /etc/prometheus/configmaps/<configmap-name> in the 

219 'prometheus' container. 

220 

221 containers (List[Any]): Containers allows injecting additional containers or modifying 

222 operator generated containers. This can be used to allow adding an 

223 authentication proxy to the Pods or to change the behavior of an 

224 operator generated container. Containers described here modify an 

225 operator generated container if they share the same name and 

226 modifications are done via a strategic merge patch. The names of 

227 containers managed by the operator are: * `prometheus` * `config- 

228 reloader` * `thanos-sidecar` Overriding containers is entirely 

229 outside the scope of what the maintainers will support and by 

230 doing so, you accept that this behaviour may break at any time 

231 without notice. 

232 

233 disable_compaction (bool): When true, the Prometheus compaction is disabled. 

234 

235 enable_admin_api (bool): Enables access to the Prometheus web admin API. WARNING: Enabling 

236 the admin APIs enables mutating endpoints, to delete data, 

237 shutdown Prometheus, and more. Enabling this should be done with 

238 care and the user is advised to add additional authentication 

239 authorization via a proxy to ensure only clients authorized to 

240 perform these actions can do so. For more information: 

241 https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb- 

242 admin-apis 

243 

244 enable_features (List[Any]): Enable access to Prometheus feature flags. By default, no features are 

245 enabled. Enabling features which are disabled by default is 

246 entirely outside the scope of what the maintainers will support 

247 and by doing so, you accept that this behaviour may break at any 

248 time without notice. For more information see 

249 https://prometheus.io/docs/prometheus/latest/feature_flags/ 

250 

251 enable_remote_write_receiver (bool): Enable Prometheus to be used as a receiver for the Prometheus remote 

252 write protocol. WARNING: This is not considered an efficient way 

253 of ingesting samples. Use it with caution for specific low-volume 

254 use cases. It is not suitable for replacing the ingestion via 

255 scraping and turning Prometheus into a push-based metrics 

256 collection system. For more information see 

257 https://prometheus.io/docs/prometheus/latest/querying/api/#remote- 

258 write-receiver It requires Prometheus >= v2.33.0. 

259 

260 enforced_body_size_limit (str): When defined, enforcedBodySizeLimit specifies a global limit on the 

261 size of uncompressed response body that will be accepted by 

262 Prometheus. Targets responding with a body larger than this many 

263 bytes will cause the scrape to fail. It requires Prometheus >= 

264 v2.28.0. When both `enforcedBodySizeLimit` and `bodySizeLimit` 

265 are defined and greater than zero, the following rules apply: * 

266 Scrape objects without a defined bodySizeLimit value will inherit 

267 the global bodySizeLimit value (Prometheus >= 2.45.0) or the 

268 enforcedBodySizeLimit value (Prometheus < v2.45.0). If 

269 Prometheus version is >= 2.45.0 and the `enforcedBodySizeLimit` is 

270 greater than the `bodySizeLimit`, the `bodySizeLimit` will be set 

271 to `enforcedBodySizeLimit`. * Scrape objects with a bodySizeLimit 

272 value less than or equal to enforcedBodySizeLimit keep their 

273 specific value. * Scrape objects with a bodySizeLimit value 

274 greater than enforcedBodySizeLimit are set to 

275 enforcedBodySizeLimit. 

276 

277 enforced_keep_dropped_targets (int): When defined, enforcedKeepDroppedTargets specifies a global limit on 

278 the number of targets dropped by relabeling that will be kept in 

279 memory. The value overrides any `spec.keepDroppedTargets` set by 

280 ServiceMonitor, PodMonitor, Probe objects unless 

281 `spec.keepDroppedTargets` is greater than zero and less than 

282 `spec.enforcedKeepDroppedTargets`. It requires Prometheus >= 

283 v2.47.0. When both `enforcedKeepDroppedTargets` and 

284 `keepDroppedTargets` are defined and greater than zero, the 

285 following rules apply: * Scrape objects without a defined 

286 keepDroppedTargets value will inherit the global 

287 keepDroppedTargets value (Prometheus >= 2.45.0) or the 

288 enforcedKeepDroppedTargets value (Prometheus < v2.45.0). If 

289 Prometheus version is >= 2.45.0 and the 

290 `enforcedKeepDroppedTargets` is greater than the 

291 `keepDroppedTargets`, the `keepDroppedTargets` will be set to 

292 `enforcedKeepDroppedTargets`. * Scrape objects with a 

293 keepDroppedTargets value less than or equal to 

294 enforcedKeepDroppedTargets keep their specific value. * Scrape 

295 objects with a keepDroppedTargets value greater than 

296 enforcedKeepDroppedTargets are set to enforcedKeepDroppedTargets. 

297 

298 enforced_label_limit (int): When defined, enforcedLabelLimit specifies a global limit on the 

299 number of labels per sample. The value overrides any 

300 `spec.labelLimit` set by ServiceMonitor, PodMonitor, Probe objects 

301 unless `spec.labelLimit` is greater than zero and less than 

302 `spec.enforcedLabelLimit`. It requires Prometheus >= v2.27.0. 

303 When both `enforcedLabelLimit` and `labelLimit` are defined and 

304 greater than zero, the following rules apply: * Scrape objects 

305 without a defined labelLimit value will inherit the global 

306 labelLimit value (Prometheus >= 2.45.0) or the enforcedLabelLimit 

307 value (Prometheus < v2.45.0). If Prometheus version is >= 2.45.0 

308 and the `enforcedLabelLimit` is greater than the `labelLimit`, the 

309 `labelLimit` will be set to `enforcedLabelLimit`. * Scrape objects 

310 with a labelLimit value less than or equal to enforcedLabelLimit 

311 keep their specific value. * Scrape objects with a labelLimit 

312 value greater than enforcedLabelLimit are set to 

313 enforcedLabelLimit. 

314 

315 enforced_label_name_length_limit (int): When defined, enforcedLabelNameLengthLimit specifies a global limit on 

316 the length of labels name per sample. The value overrides any 

317 `spec.labelNameLengthLimit` set by ServiceMonitor, PodMonitor, 

318 Probe objects unless `spec.labelNameLengthLimit` is greater than 

319 zero and less than `spec.enforcedLabelNameLengthLimit`. It 

320 requires Prometheus >= v2.27.0. When both 

321 `enforcedLabelNameLengthLimit` and `labelNameLengthLimit` are 

322 defined and greater than zero, the following rules apply: * Scrape 

323 objects without a defined labelNameLengthLimit value will inherit 

324 the global labelNameLengthLimit value (Prometheus >= 2.45.0) or 

325 the enforcedLabelNameLengthLimit value (Prometheus < v2.45.0). 

326 If Prometheus version is >= 2.45.0 and the 

327 `enforcedLabelNameLengthLimit` is greater than the 

328 `labelNameLengthLimit`, the `labelNameLengthLimit` will be set to 

329 `enforcedLabelNameLengthLimit`. * Scrape objects with a 

330 labelNameLengthLimit value less than or equal to 

331 enforcedLabelNameLengthLimit keep their specific value. * Scrape 

332 objects with a labelNameLengthLimit value greater than 

333 enforcedLabelNameLengthLimit are set to 

334 enforcedLabelNameLengthLimit. 

335 

336 enforced_label_value_length_limit (int): When not null, enforcedLabelValueLengthLimit defines a global limit on 

337 the length of labels value per sample. The value overrides any 

338 `spec.labelValueLengthLimit` set by ServiceMonitor, PodMonitor, 

339 Probe objects unless `spec.labelValueLengthLimit` is greater than 

340 zero and less than `spec.enforcedLabelValueLengthLimit`. It 

341 requires Prometheus >= v2.27.0. When both 

342 `enforcedLabelValueLengthLimit` and `labelValueLengthLimit` are 

343 defined and greater than zero, the following rules apply: * Scrape 

344 objects without a defined labelValueLengthLimit value will inherit 

345 the global labelValueLengthLimit value (Prometheus >= 2.45.0) or 

346 the enforcedLabelValueLengthLimit value (Prometheus < v2.45.0). 

347 If Prometheus version is >= 2.45.0 and the 

348 `enforcedLabelValueLengthLimit` is greater than the 

349 `labelValueLengthLimit`, the `labelValueLengthLimit` will be set 

350 to `enforcedLabelValueLengthLimit`. * Scrape objects with a 

351 labelValueLengthLimit value less than or equal to 

352 enforcedLabelValueLengthLimit keep their specific value. * Scrape 

353 objects with a labelValueLengthLimit value greater than 

354 enforcedLabelValueLengthLimit are set to 

355 enforcedLabelValueLengthLimit. 

356 

357 enforced_namespace_label (str): When not empty, a label will be added to: 1. All metrics scraped 

358 from `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` 

359 objects. 2. All metrics generated from recording rules defined in 

360 `PrometheusRule` objects. 3. All alerts generated from alerting 

361 rules defined in `PrometheusRule` objects. 4. All vector selectors 

362 of PromQL expressions defined in `PrometheusRule` objects. The 

363 label will not added for objects referenced in 

364 `spec.excludedFromEnforcement`. The label's name is this field's 

365 value. The label's value is the namespace of the `ServiceMonitor`, 

366 `PodMonitor`, `Probe`, `PrometheusRule` or `ScrapeConfig` object. 

367 

368 enforced_sample_limit (int): When defined, enforcedSampleLimit specifies a global limit on the 

369 number of scraped samples that will be accepted. This overrides 

370 any `spec.sampleLimit` set by ServiceMonitor, PodMonitor, Probe 

371 objects unless `spec.sampleLimit` is greater than zero and less 

372 than `spec.enforcedSampleLimit`. It is meant to be used by 

373 admins to keep the overall number of samples/series under a 

374 desired limit. When both `enforcedSampleLimit` and `sampleLimit` 

375 are defined and greater than zero, the following rules apply: * 

376 Scrape objects without a defined sampleLimit value will inherit 

377 the global sampleLimit value (Prometheus >= 2.45.0) or the 

378 enforcedSampleLimit value (Prometheus < v2.45.0). If Prometheus 

379 version is >= 2.45.0 and the `enforcedSampleLimit` is greater than 

380 the `sampleLimit`, the `sampleLimit` will be set to 

381 `enforcedSampleLimit`. * Scrape objects with a sampleLimit value 

382 less than or equal to enforcedSampleLimit keep their specific 

383 value. * Scrape objects with a sampleLimit value greater than 

384 enforcedSampleLimit are set to enforcedSampleLimit. 

385 

386 enforced_target_limit (int): When defined, enforcedTargetLimit specifies a global limit on the 

387 number of scraped targets. The value overrides any 

388 `spec.targetLimit` set by ServiceMonitor, PodMonitor, Probe 

389 objects unless `spec.targetLimit` is greater than zero and less 

390 than `spec.enforcedTargetLimit`. It is meant to be used by 

391 admins to to keep the overall number of targets under a desired 

392 limit. When both `enforcedTargetLimit` and `targetLimit` are 

393 defined and greater than zero, the following rules apply: * Scrape 

394 objects without a defined targetLimit value will inherit the 

395 global targetLimit value (Prometheus >= 2.45.0) or the 

396 enforcedTargetLimit value (Prometheus < v2.45.0). If Prometheus 

397 version is >= 2.45.0 and the `enforcedTargetLimit` is greater than 

398 the `targetLimit`, the `targetLimit` will be set to 

399 `enforcedTargetLimit`. * Scrape objects with a targetLimit value 

400 less than or equal to enforcedTargetLimit keep their specific 

401 value. * Scrape objects with a targetLimit value greater than 

402 enforcedTargetLimit are set to enforcedTargetLimit. 

403 

404 evaluation_interval (str): Interval between rule evaluations. Default: "30s" 

405 

406 excluded_from_enforcement (List[Any]): List of references to PodMonitor, ServiceMonitor, Probe and 

407 PrometheusRule objects to be excluded from enforcing a namespace 

408 label of origin. It is only applicable if 

409 `spec.enforcedNamespaceLabel` set to true. 

410 

411 exemplars (Dict[str, Any]): Exemplars related settings that are runtime reloadable. It requires to 

412 enable the `exemplar-storage` feature flag to be effective. 

413 

414 external_labels (Dict[str, Any]): The labels to add to any time series or alerts when communicating with 

415 external systems (federation, remote storage, Alertmanager). 

416 Labels defined by `spec.replicaExternalLabelName` and 

417 `spec.prometheusExternalLabelName` take precedence over this list. 

418 

419 external_url (str): The external URL under which the Prometheus service is externally 

420 available. This is necessary to generate correct URLs (for 

421 instance if Prometheus is accessible behind an Ingress resource). 

422 

423 host_aliases (List[Any]): Optional list of hosts and IPs that will be injected into the Pod's 

424 hosts file if specified. 

425 

426 host_network (bool): Use the host's network namespace if true. Make sure to understand 

427 the security implications if you want to enable it 

428 (https://kubernetes.io/docs/concepts/configuration/overview/). 

429 When hostNetwork is enabled, this will set the DNS policy to 

430 `ClusterFirstWithHostNet` automatically. 

431 

432 ignore_namespace_selectors (bool): When true, `spec.namespaceSelector` from all PodMonitor, 

433 ServiceMonitor and Probe objects will be ignored. They will only 

434 discover targets within the namespace of the PodMonitor, 

435 ServiceMonitor and Probe object. 

436 

437 image (str): Container image name for Prometheus. If specified, it takes precedence 

438 over the `spec.baseImage`, `spec.tag` and `spec.sha` fields. 

439 Specifying `spec.version` is still necessary to ensure the 

440 Prometheus Operator knows which version of Prometheus is being 

441 configured. If neither `spec.image` nor `spec.baseImage` are 

442 defined, the operator will use the latest upstream version of 

443 Prometheus available at the time when the operator was released. 

444 

445 image_pull_policy (str): Image pull policy for the 'prometheus', 'init-config-reloader' and 

446 'config-reloader' containers. See 

447 https://kubernetes.io/docs/concepts/containers/images/#image-pull- 

448 policy for more details. 

449 

450 image_pull_secrets (List[Any]): An optional list of references to Secrets in the same namespace to use 

451 for pulling images from registries. See 

452 http://kubernetes.io/docs/user-guide/images#specifying- 

453 imagepullsecrets-on-a-pod 

454 

455 init_containers (List[Any]): InitContainers allows injecting initContainers to the Pod definition. 

456 Those can be used to e.g. fetch secrets for injection into the 

457 Prometheus configuration from external sources. Any errors during 

458 the execution of an initContainer will lead to a restart of the 

459 Pod. More info: 

460 https://kubernetes.io/docs/concepts/workloads/pods/init- 

461 containers/ InitContainers described here modify an operator 

462 generated init containers if they share the same name and 

463 modifications are done via a strategic merge patch. The names of 

464 init container name managed by the operator are: * `init-config- 

465 reloader`. Overriding init containers is entirely outside the 

466 scope of what the maintainers will support and by doing so, you 

467 accept that this behaviour may break at any time without notice. 

468 

469 keep_dropped_targets (int): Per-scrape limit on the number of targets dropped by relabeling that 

470 will be kept in memory. 0 means no limit. It requires Prometheus 

471 >= v2.47.0. Note that the global limit only applies to scrape 

472 objects that don't specify an explicit limit value. If you want to 

473 enforce a maximum limit for all scrape objects, refer to 

474 enforcedKeepDroppedTargets. 

475 

476 label_limit (int): Per-scrape limit on number of labels that will be accepted for a 

477 sample. Only valid in Prometheus versions 2.45.0 and newer. Note 

478 that the global limit only applies to scrape objects that don't 

479 specify an explicit limit value. If you want to enforce a maximum 

480 limit for all scrape objects, refer to enforcedLabelLimit. 

481 

482 label_name_length_limit (int): Per-scrape limit on length of labels name that will be accepted for a 

483 sample. Only valid in Prometheus versions 2.45.0 and newer. Note 

484 that the global limit only applies to scrape objects that don't 

485 specify an explicit limit value. If you want to enforce a maximum 

486 limit for all scrape objects, refer to 

487 enforcedLabelNameLengthLimit. 

488 

489 label_value_length_limit (int): Per-scrape limit on length of labels value that will be accepted for a 

490 sample. Only valid in Prometheus versions 2.45.0 and newer. Note 

491 that the global limit only applies to scrape objects that don't 

492 specify an explicit limit value. If you want to enforce a maximum 

493 limit for all scrape objects, refer to 

494 enforcedLabelValueLengthLimit. 

495 

496 listen_local (bool): When true, the Prometheus server listens on the loopback address 

497 instead of the Pod IP's address. 

498 

499 log_format (str): Log format for Log level for Prometheus and the config-reloader 

500 sidecar. 

501 

502 log_level (str): Log level for Prometheus and the config-reloader sidecar. 

503 

504 maximum_startup_duration_seconds (int): Defines the maximum time that the `prometheus` container's startup 

505 probe will wait before being considered failed. The startup probe 

506 will return success after the WAL replay is complete. If set, the 

507 value should be greater than 60 (seconds). Otherwise it will be 

508 equal to 600 seconds (15 minutes). 

509 

510 min_ready_seconds (int): Minimum number of seconds for which a newly created Pod should be 

511 ready without any of its container crashing for it to be 

512 considered available. Defaults to 0 (pod will be considered 

513 available as soon as it is ready) This is an alpha field from 

514 kubernetes 1.22 until 1.24 which requires enabling the 

515 StatefulSetMinReadySeconds feature gate. 

516 

517 node_selector (Dict[str, Any]): Defines on which Nodes the Pods are scheduled. 

518 

519 override_honor_labels (bool): When true, Prometheus resolves label conflicts by renaming the labels 

520 in the scraped data to “exported_” for all targets created from 

521 ServiceMonitor, PodMonitor and ScrapeConfig objects. Otherwise the 

522 HonorLabels field of the service or pod monitor applies. In 

523 practice,`overrideHonorLaels:true` enforces `honorLabels:false` 

524 for all ServiceMonitor, PodMonitor and ScrapeConfig objects. 

525 

526 override_honor_timestamps (bool): When true, Prometheus ignores the timestamps for all the targets 

527 created from service and pod monitors. Otherwise the 

528 HonorTimestamps field of the service or pod monitor applies. 

529 

530 paused (bool): When a Prometheus deployment is paused, no actions except for deletion 

531 will be performed on the underlying objects. 

532 

533 persistent_volume_claim_retention_policy (Dict[str, Any]): The field controls if and how PVCs are deleted during the lifecycle of 

534 a StatefulSet. The default behavior is all PVCs are retained. This 

535 is an alpha field from kubernetes 1.23 until 1.26 and a beta field 

536 from 1.26. It requires enabling the StatefulSetAutoDeletePVC 

537 feature gate. 

538 

539 pod_metadata (Dict[str, Any]): PodMetadata configures labels and annotations which are propagated to 

540 the Prometheus pods. The following items are reserved and cannot 

541 be overridden: * "prometheus" label, set to the name of the 

542 Prometheus object. * "app.kubernetes.io/instance" label, set to 

543 the name of the Prometheus object. * "app.kubernetes.io/managed- 

544 by" label, set to "prometheus-operator". * 

545 "app.kubernetes.io/name" label, set to "prometheus". * 

546 "app.kubernetes.io/version" label, set to the Prometheus version. 

547 * "operator.prometheus.io/name" label, set to the name of the 

548 Prometheus object. * "operator.prometheus.io/shard" label, set to 

549 the shard number of the Prometheus object. * 

550 "kubectl.kubernetes.io/default-container" annotation, set to 

551 "prometheus". 

552 

553 pod_monitor_namespace_selector (Dict[str, Any]): Namespaces to match for PodMonitors discovery. An empty label selector 

554 matches all namespaces. A null label selector (default value) 

555 matches the current namespace only. 

556 

557 pod_monitor_selector (Dict[str, Any]): PodMonitors to be selected for target discovery. An empty label 

558 selector matches all objects. A null label selector matches no 

559 objects. If `spec.serviceMonitorSelector`, 

560 `spec.podMonitorSelector`, `spec.probeSelector` and 

561 `spec.scrapeConfigSelector` are null, the Prometheus configuration 

562 is unmanaged. The Prometheus operator will ensure that the 

563 Prometheus configuration's Secret exists, but it is the 

564 responsibility of the user to provide the raw gzipped Prometheus 

565 configuration under the `prometheus.yaml.gz` key. This behavior is 

566 *deprecated* and will be removed in the next major version of the 

567 custom resource definition. It is recommended to use 

568 `spec.additionalScrapeConfigs` instead. 

569 

570 pod_target_labels (List[Any]): PodTargetLabels are appended to the `spec.podTargetLabels` field of 

571 all PodMonitor and ServiceMonitor objects. 

572 

573 port_name (str): Port name used for the pods and governing service. Default: "web" 

574 

575 priority_class_name (str): Priority class assigned to the Pods. 

576 

577 probe_namespace_selector (Dict[str, Any]): Namespaces to match for Probe discovery. An empty label selector 

578 matches all namespaces. A null label selector matches the current 

579 namespace only. 

580 

581 probe_selector (Dict[str, Any]): Probes to be selected for target discovery. An empty label selector 

582 matches all objects. A null label selector matches no objects. 

583 If `spec.serviceMonitorSelector`, `spec.podMonitorSelector`, 

584 `spec.probeSelector` and `spec.scrapeConfigSelector` are null, the 

585 Prometheus configuration is unmanaged. The Prometheus operator 

586 will ensure that the Prometheus configuration's Secret exists, but 

587 it is the responsibility of the user to provide the raw gzipped 

588 Prometheus configuration under the `prometheus.yaml.gz` key. This 

589 behavior is *deprecated* and will be removed in the next major 

590 version of the custom resource definition. It is recommended to 

591 use `spec.additionalScrapeConfigs` instead. 

592 

593 prometheus_external_label_name (str): Name of Prometheus external label used to denote the Prometheus 

594 instance name. The external label will _not_ be added when the 

595 field is set to the empty string (`""`). Default: "prometheus" 

596 

597 prometheus_rules_excluded_from_enforce (List[Any]): Defines the list of PrometheusRule objects to which the namespace 

598 label enforcement doesn't apply. This is only relevant when 

599 `spec.enforcedNamespaceLabel` is set to true. Deprecated: use 

600 `spec.excludedFromEnforcement` instead. 

601 

602 query (Dict[str, Any]): QuerySpec defines the configuration of the Promethus query service. 

603 

604 query_log_file (str): queryLogFile specifies where the file to which PromQL queries are 

605 logged. If the filename has an empty path, e.g. 'query.log', The 

606 Prometheus Pods will mount the file into an emptyDir volume at 

607 `/var/log/prometheus`. If a full path is provided, e.g. 

608 '/var/log/prometheus/query.log', you must mount a volume in the 

609 specified directory and it must be writable. This is because the 

610 prometheus container runs with a read-only root filesystem for 

611 security reasons. Alternatively, the location can be set to a 

612 standard I/O stream, e.g. `/dev/stdout`, to log query information 

613 to the default Prometheus log stream. 

614 

615 reload_strategy (str): Defines the strategy used to reload the Prometheus configuration. If 

616 not specified, the configuration is reloaded using the /-/reload 

617 HTTP endpoint. 

618 

619 remote_read (List[Any]): Defines the list of remote read configurations. 

620 

621 remote_write (List[Any]): Defines the list of remote write configurations. 

622 

623 replica_external_label_name (str): Name of Prometheus external label used to denote the replica name. The 

624 external label will _not_ be added when the field is set to the 

625 empty string (`""`). Default: "prometheus_replica" 

626 

627 replicas (int): Number of replicas of each shard to deploy for a Prometheus 

628 deployment. `spec.replicas` multiplied by `spec.shards` is the 

629 total number of Pods created. Default: 1 

630 

631 resources (Dict[str, Any]): Defines the resources requests and limits of the 'prometheus' 

632 container. 

633 

634 retention (str): How long to retain the Prometheus data. Default: "24h" if 

635 `spec.retention` and `spec.retentionSize` are empty. 

636 

637 retention_size (str): Maximum number of bytes used by the Prometheus data. 

638 

639 route_prefix (str): The route prefix Prometheus registers HTTP handlers for. This is 

640 useful when using `spec.externalURL`, and a proxy is rewriting 

641 HTTP routes of a request, and the actual ExternalURL is still 

642 true, but the server serves requests under a different route 

643 prefix. For example for use with `kubectl proxy`. 

644 

645 rule_namespace_selector (Dict[str, Any]): Namespaces to match for PrometheusRule discovery. An empty label 

646 selector matches all namespaces. A null label selector matches the 

647 current namespace only. 

648 

649 rule_selector (Dict[str, Any]): PrometheusRule objects to be selected for rule evaluation. An empty 

650 label selector matches all objects. A null label selector matches 

651 no objects. 

652 

653 rules (Dict[str, Any]): Defines the configuration of the Prometheus rules' engine. 

654 

655 sample_limit (int): SampleLimit defines per-scrape limit on number of scraped samples that 

656 will be accepted. Only valid in Prometheus versions 2.45.0 and 

657 newer. Note that the global limit only applies to scrape objects 

658 that don't specify an explicit limit value. If you want to enforce 

659 a maximum limit for all scrape objects, refer to 

660 enforcedSampleLimit. 

661 

662 scrape_classes (List[Any]): List of scrape classes to expose to scraping objects such as 

663 PodMonitors, ServiceMonitors, Probes and ScrapeConfigs. This is 

664 an *experimental feature*, it may change in any upcoming release 

665 in a breaking way. 

666 

667 scrape_config_namespace_selector (Dict[str, Any]): Namespaces to match for ScrapeConfig discovery. An empty label 

668 selector matches all namespaces. A null label selector matches the 

669 current namespace only. Note that the ScrapeConfig custom 

670 resource definition is currently at Alpha level. 

671 

672 scrape_config_selector (Dict[str, Any]): ScrapeConfigs to be selected for target discovery. An empty label 

673 selector matches all objects. A null label selector matches no 

674 objects. If `spec.serviceMonitorSelector`, 

675 `spec.podMonitorSelector`, `spec.probeSelector` and 

676 `spec.scrapeConfigSelector` are null, the Prometheus configuration 

677 is unmanaged. The Prometheus operator will ensure that the 

678 Prometheus configuration's Secret exists, but it is the 

679 responsibility of the user to provide the raw gzipped Prometheus 

680 configuration under the `prometheus.yaml.gz` key. This behavior is 

681 *deprecated* and will be removed in the next major version of the 

682 custom resource definition. It is recommended to use 

683 `spec.additionalScrapeConfigs` instead. Note that the 

684 ScrapeConfig custom resource definition is currently at Alpha 

685 level. 

686 

687 scrape_interval (str): Interval between consecutive scrapes. Default: "30s" 

688 

689 scrape_protocols (List[Any]): The protocols to negotiate during a scrape. It tells clients the 

690 protocols supported by Prometheus in order of preference (from 

691 most to least preferred). If unset, Prometheus uses its default 

692 value. It requires Prometheus >= v2.49.0. 

693 

694 scrape_timeout (str): Number of seconds to wait until a scrape request times out. 

695 

696 secrets (List[Any]): Secrets is a list of Secrets in the same namespace as the Prometheus 

697 object, which shall be mounted into the Prometheus Pods. Each 

698 Secret is added to the StatefulSet definition as a volume named 

699 `secret-<secret-name>`. The Secrets are mounted into 

700 /etc/prometheus/secrets/<secret-name> in the 'prometheus' 

701 container. 

702 

703 security_context (Dict[str, Any]): SecurityContext holds pod-level security attributes and common 

704 container settings. This defaults to the default 

705 PodSecurityContext. 

706 

707 service_account_name (str): ServiceAccountName is the name of the ServiceAccount to use to run the 

708 Prometheus Pods. 

709 

710 service_monitor_namespace_selector (Dict[str, Any]): Namespaces to match for ServicedMonitors discovery. An empty label 

711 selector matches all namespaces. A null label selector (default 

712 value) matches the current namespace only. 

713 

714 service_monitor_selector (Dict[str, Any]): ServiceMonitors to be selected for target discovery. An empty label 

715 selector matches all objects. A null label selector matches no 

716 objects. If `spec.serviceMonitorSelector`, 

717 `spec.podMonitorSelector`, `spec.probeSelector` and 

718 `spec.scrapeConfigSelector` are null, the Prometheus configuration 

719 is unmanaged. The Prometheus operator will ensure that the 

720 Prometheus configuration's Secret exists, but it is the 

721 responsibility of the user to provide the raw gzipped Prometheus 

722 configuration under the `prometheus.yaml.gz` key. This behavior is 

723 *deprecated* and will be removed in the next major version of the 

724 custom resource definition. It is recommended to use 

725 `spec.additionalScrapeConfigs` instead. 

726 

727 sha (str): Deprecated: use 'spec.image' instead. The image's digest can be 

728 specified as part of the image name. 

729 

730 shards (int): Number of shards to distribute targets onto. `spec.replicas` 

731 multiplied by `spec.shards` is the total number of Pods created. 

732 Note that scaling down shards will not reshard data onto remaining 

733 instances, it must be manually moved. Increasing shards will not 

734 reshard data either but it will continue to be available from the 

735 same instances. To query globally, use Thanos sidecar and Thanos 

736 querier or remote write data to a central location. Sharding is 

737 performed on the content of the `__address__` target meta-label 

738 for PodMonitors and ServiceMonitors and `__param_target__` for 

739 Probes. Default: 1 

740 

741 storage (Dict[str, Any]): Storage defines the storage used by Prometheus. 

742 

743 tag (str): Deprecated: use 'spec.image' instead. The image's tag can be specified 

744 as part of the image name. 

745 

746 target_limit (int): TargetLimit defines a limit on the number of scraped targets that will 

747 be accepted. Only valid in Prometheus versions 2.45.0 and newer. 

748 Note that the global limit only applies to scrape objects that 

749 don't specify an explicit limit value. If you want to enforce a 

750 maximum limit for all scrape objects, refer to 

751 enforcedTargetLimit. 

752 

753 thanos (Dict[str, Any]): Defines the configuration of the optional Thanos sidecar. 

754 

755 tolerations (List[Any]): Defines the Pods' tolerations if specified. 

756 

757 topology_spread_constraints (List[Any]): Defines the pod's topology spread constraints if specified. 

758 

759 tracing_config (Dict[str, Any]): TracingConfig configures tracing in Prometheus. This is an 

760 *experimental feature*, it may change in any upcoming release in a 

761 breaking way. 

762 

763 tsdb (Dict[str, Any]): Defines the runtime reloadable configuration of the timeseries 

764 database (TSDB). 

765 

766 version (str): Version of Prometheus being deployed. The operator uses this 

767 information to generate the Prometheus StatefulSet + configuration 

768 files. If not specified, the operator assumes the latest 

769 upstream version of Prometheus available at the time when the 

770 version of the operator was released. 

771 

772 volume_mounts (List[Any]): VolumeMounts allows the configuration of additional VolumeMounts. 

773 VolumeMounts will be appended to other VolumeMounts in the 

774 'prometheus' container, that are generated as a result of 

775 StorageSpec objects. 

776 

777 volumes (List[Any]): Volumes allows the configuration of additional volumes on the output 

778 StatefulSet definition. Volumes specified will be appended to 

779 other volumes that are generated as a result of StorageSpec 

780 objects. 

781 

782 wal_compression (bool): Configures compression of the write-ahead log (WAL) using Snappy. 

783 WAL compression is enabled by default for Prometheus >= 2.20.0 

784 Requires Prometheus v2.11.0 and above. 

785 

786 web (Dict[str, Any]): Defines the configuration of the Prometheus web server. 

787 

788 """ 

789 super().__init__(**kwargs) 

790 

791 self.additional_alert_manager_configs = additional_alert_manager_configs 

792 self.additional_alert_relabel_configs = additional_alert_relabel_configs 

793 self.additional_args = additional_args 

794 self.additional_scrape_configs = additional_scrape_configs 

795 self.affinity = affinity 

796 self.alerting = alerting 

797 self.allow_overlapping_blocks = allow_overlapping_blocks 

798 self.apiserver_config = apiserver_config 

799 self.arbitrary_fs_access_through_sms = arbitrary_fs_access_through_sms 

800 self.automount_service_account_token = automount_service_account_token 

801 self.base_image = base_image 

802 self.body_size_limit = body_size_limit 

803 self.config_maps = config_maps 

804 self.containers = containers 

805 self.disable_compaction = disable_compaction 

806 self.enable_admin_api = enable_admin_api 

807 self.enable_features = enable_features 

808 self.enable_remote_write_receiver = enable_remote_write_receiver 

809 self.enforced_body_size_limit = enforced_body_size_limit 

810 self.enforced_keep_dropped_targets = enforced_keep_dropped_targets 

811 self.enforced_label_limit = enforced_label_limit 

812 self.enforced_label_name_length_limit = enforced_label_name_length_limit 

813 self.enforced_label_value_length_limit = enforced_label_value_length_limit 

814 self.enforced_namespace_label = enforced_namespace_label 

815 self.enforced_sample_limit = enforced_sample_limit 

816 self.enforced_target_limit = enforced_target_limit 

817 self.evaluation_interval = evaluation_interval 

818 self.excluded_from_enforcement = excluded_from_enforcement 

819 self.exemplars = exemplars 

820 self.external_labels = external_labels 

821 self.external_url = external_url 

822 self.host_aliases = host_aliases 

823 self.host_network = host_network 

824 self.ignore_namespace_selectors = ignore_namespace_selectors 

825 self.image = image 

826 self.image_pull_policy = image_pull_policy 

827 self.image_pull_secrets = image_pull_secrets 

828 self.init_containers = init_containers 

829 self.keep_dropped_targets = keep_dropped_targets 

830 self.label_limit = label_limit 

831 self.label_name_length_limit = label_name_length_limit 

832 self.label_value_length_limit = label_value_length_limit 

833 self.listen_local = listen_local 

834 self.log_format = log_format 

835 self.log_level = log_level 

836 self.maximum_startup_duration_seconds = maximum_startup_duration_seconds 

837 self.min_ready_seconds = min_ready_seconds 

838 self.node_selector = node_selector 

839 self.override_honor_labels = override_honor_labels 

840 self.override_honor_timestamps = override_honor_timestamps 

841 self.paused = paused 

842 self.persistent_volume_claim_retention_policy = persistent_volume_claim_retention_policy 

843 self.pod_metadata = pod_metadata 

844 self.pod_monitor_namespace_selector = pod_monitor_namespace_selector 

845 self.pod_monitor_selector = pod_monitor_selector 

846 self.pod_target_labels = pod_target_labels 

847 self.port_name = port_name 

848 self.priority_class_name = priority_class_name 

849 self.probe_namespace_selector = probe_namespace_selector 

850 self.probe_selector = probe_selector 

851 self.prometheus_external_label_name = prometheus_external_label_name 

852 self.prometheus_rules_excluded_from_enforce = prometheus_rules_excluded_from_enforce 

853 self.query = query 

854 self.query_log_file = query_log_file 

855 self.reload_strategy = reload_strategy 

856 self.remote_read = remote_read 

857 self.remote_write = remote_write 

858 self.replica_external_label_name = replica_external_label_name 

859 self.replicas = replicas 

860 self.resources = resources 

861 self.retention = retention 

862 self.retention_size = retention_size 

863 self.route_prefix = route_prefix 

864 self.rule_namespace_selector = rule_namespace_selector 

865 self.rule_selector = rule_selector 

866 self.rules = rules 

867 self.sample_limit = sample_limit 

868 self.scrape_classes = scrape_classes 

869 self.scrape_config_namespace_selector = scrape_config_namespace_selector 

870 self.scrape_config_selector = scrape_config_selector 

871 self.scrape_interval = scrape_interval 

872 self.scrape_protocols = scrape_protocols 

873 self.scrape_timeout = scrape_timeout 

874 self.secrets = secrets 

875 self.security_context = security_context 

876 self.service_account_name = service_account_name 

877 self.service_monitor_namespace_selector = service_monitor_namespace_selector 

878 self.service_monitor_selector = service_monitor_selector 

879 self.sha = sha 

880 self.shards = shards 

881 self.storage = storage 

882 self.tag = tag 

883 self.target_limit = target_limit 

884 self.thanos = thanos 

885 self.tolerations = tolerations 

886 self.topology_spread_constraints = topology_spread_constraints 

887 self.tracing_config = tracing_config 

888 self.tsdb = tsdb 

889 self.version = version 

890 self.volume_mounts = volume_mounts 

891 self.volumes = volumes 

892 self.wal_compression = wal_compression 

893 self.web = web 

894 

895 def to_dict(self) -> None: 

896 super().to_dict() 

897 

898 if not self.kind_dict and not self.yaml_file: 

899 self.res["spec"] = {} 

900 _spec = self.res["spec"] 

901 

902 if self.additional_alert_manager_configs: 

903 _spec["additionalAlertManagerConfigs"] = self.additional_alert_manager_configs 

904 

905 if self.additional_alert_relabel_configs: 

906 _spec["additionalAlertRelabelConfigs"] = self.additional_alert_relabel_configs 

907 

908 if self.additional_args: 

909 _spec["additionalArgs"] = self.additional_args 

910 

911 if self.additional_scrape_configs: 

912 _spec["additionalScrapeConfigs"] = self.additional_scrape_configs 

913 

914 if self.affinity: 

915 _spec["affinity"] = self.affinity 

916 

917 if self.alerting: 

918 _spec["alerting"] = self.alerting 

919 

920 if self.allow_overlapping_blocks is not None: 

921 _spec["allowOverlappingBlocks"] = self.allow_overlapping_blocks 

922 

923 if self.apiserver_config: 

924 _spec["apiserverConfig"] = self.apiserver_config 

925 

926 if self.arbitrary_fs_access_through_sms: 

927 _spec["arbitraryFSAccessThroughSMs"] = self.arbitrary_fs_access_through_sms 

928 

929 if self.automount_service_account_token is not None: 

930 _spec["automountServiceAccountToken"] = self.automount_service_account_token 

931 

932 if self.base_image: 

933 _spec["baseImage"] = self.base_image 

934 

935 if self.body_size_limit: 

936 _spec["bodySizeLimit"] = self.body_size_limit 

937 

938 if self.config_maps: 

939 _spec["configMaps"] = self.config_maps 

940 

941 if self.containers: 

942 _spec["containers"] = self.containers 

943 

944 if self.disable_compaction is not None: 

945 _spec["disableCompaction"] = self.disable_compaction 

946 

947 if self.enable_admin_api is not None: 

948 _spec["enableAdminAPI"] = self.enable_admin_api 

949 

950 if self.enable_features: 

951 _spec["enableFeatures"] = self.enable_features 

952 

953 if self.enable_remote_write_receiver is not None: 

954 _spec["enableRemoteWriteReceiver"] = self.enable_remote_write_receiver 

955 

956 if self.enforced_body_size_limit: 

957 _spec["enforcedBodySizeLimit"] = self.enforced_body_size_limit 

958 

959 if self.enforced_keep_dropped_targets: 

960 _spec["enforcedKeepDroppedTargets"] = self.enforced_keep_dropped_targets 

961 

962 if self.enforced_label_limit: 

963 _spec["enforcedLabelLimit"] = self.enforced_label_limit 

964 

965 if self.enforced_label_name_length_limit: 

966 _spec["enforcedLabelNameLengthLimit"] = self.enforced_label_name_length_limit 

967 

968 if self.enforced_label_value_length_limit: 

969 _spec["enforcedLabelValueLengthLimit"] = self.enforced_label_value_length_limit 

970 

971 if self.enforced_namespace_label: 

972 _spec["enforcedNamespaceLabel"] = self.enforced_namespace_label 

973 

974 if self.enforced_sample_limit: 

975 _spec["enforcedSampleLimit"] = self.enforced_sample_limit 

976 

977 if self.enforced_target_limit: 

978 _spec["enforcedTargetLimit"] = self.enforced_target_limit 

979 

980 if self.evaluation_interval: 

981 _spec["evaluationInterval"] = self.evaluation_interval 

982 

983 if self.excluded_from_enforcement: 

984 _spec["excludedFromEnforcement"] = self.excluded_from_enforcement 

985 

986 if self.exemplars: 

987 _spec["exemplars"] = self.exemplars 

988 

989 if self.external_labels: 

990 _spec["externalLabels"] = self.external_labels 

991 

992 if self.external_url: 

993 _spec["externalUrl"] = self.external_url 

994 

995 if self.host_aliases: 

996 _spec["hostAliases"] = self.host_aliases 

997 

998 if self.host_network is not None: 

999 _spec["hostNetwork"] = self.host_network 

1000 

1001 if self.ignore_namespace_selectors is not None: 

1002 _spec["ignoreNamespaceSelectors"] = self.ignore_namespace_selectors 

1003 

1004 if self.image: 

1005 _spec["image"] = self.image 

1006 

1007 if self.image_pull_policy: 

1008 _spec["imagePullPolicy"] = self.image_pull_policy 

1009 

1010 if self.image_pull_secrets: 

1011 _spec["imagePullSecrets"] = self.image_pull_secrets 

1012 

1013 if self.init_containers: 

1014 _spec["initContainers"] = self.init_containers 

1015 

1016 if self.keep_dropped_targets: 

1017 _spec["keepDroppedTargets"] = self.keep_dropped_targets 

1018 

1019 if self.label_limit: 

1020 _spec["labelLimit"] = self.label_limit 

1021 

1022 if self.label_name_length_limit: 

1023 _spec["labelNameLengthLimit"] = self.label_name_length_limit 

1024 

1025 if self.label_value_length_limit: 

1026 _spec["labelValueLengthLimit"] = self.label_value_length_limit 

1027 

1028 if self.listen_local is not None: 

1029 _spec["listenLocal"] = self.listen_local 

1030 

1031 if self.log_format: 

1032 _spec["logFormat"] = self.log_format 

1033 

1034 if self.log_level: 

1035 _spec["logLevel"] = self.log_level 

1036 

1037 if self.maximum_startup_duration_seconds: 

1038 _spec["maximumStartupDurationSeconds"] = self.maximum_startup_duration_seconds 

1039 

1040 if self.min_ready_seconds: 

1041 _spec["minReadySeconds"] = self.min_ready_seconds 

1042 

1043 if self.node_selector: 

1044 _spec["nodeSelector"] = self.node_selector 

1045 

1046 if self.override_honor_labels is not None: 

1047 _spec["overrideHonorLabels"] = self.override_honor_labels 

1048 

1049 if self.override_honor_timestamps is not None: 

1050 _spec["overrideHonorTimestamps"] = self.override_honor_timestamps 

1051 

1052 if self.paused is not None: 

1053 _spec["paused"] = self.paused 

1054 

1055 if self.persistent_volume_claim_retention_policy: 

1056 _spec["persistentVolumeClaimRetentionPolicy"] = self.persistent_volume_claim_retention_policy 

1057 

1058 if self.pod_metadata: 

1059 _spec["podMetadata"] = self.pod_metadata 

1060 

1061 if self.pod_monitor_namespace_selector: 

1062 _spec["podMonitorNamespaceSelector"] = self.pod_monitor_namespace_selector 

1063 

1064 if self.pod_monitor_selector: 

1065 _spec["podMonitorSelector"] = self.pod_monitor_selector 

1066 

1067 if self.pod_target_labels: 

1068 _spec["podTargetLabels"] = self.pod_target_labels 

1069 

1070 if self.port_name: 

1071 _spec["portName"] = self.port_name 

1072 

1073 if self.priority_class_name: 

1074 _spec["priorityClassName"] = self.priority_class_name 

1075 

1076 if self.probe_namespace_selector: 

1077 _spec["probeNamespaceSelector"] = self.probe_namespace_selector 

1078 

1079 if self.probe_selector: 

1080 _spec["probeSelector"] = self.probe_selector 

1081 

1082 if self.prometheus_external_label_name: 

1083 _spec["prometheusExternalLabelName"] = self.prometheus_external_label_name 

1084 

1085 if self.prometheus_rules_excluded_from_enforce: 

1086 _spec["prometheusRulesExcludedFromEnforce"] = self.prometheus_rules_excluded_from_enforce 

1087 

1088 if self.query: 

1089 _spec["query"] = self.query 

1090 

1091 if self.query_log_file: 

1092 _spec["queryLogFile"] = self.query_log_file 

1093 

1094 if self.reload_strategy: 

1095 _spec["reloadStrategy"] = self.reload_strategy 

1096 

1097 if self.remote_read: 

1098 _spec["remoteRead"] = self.remote_read 

1099 

1100 if self.remote_write: 

1101 _spec["remoteWrite"] = self.remote_write 

1102 

1103 if self.replica_external_label_name: 

1104 _spec["replicaExternalLabelName"] = self.replica_external_label_name 

1105 

1106 if self.replicas: 

1107 _spec["replicas"] = self.replicas 

1108 

1109 if self.resources: 

1110 _spec["resources"] = self.resources 

1111 

1112 if self.retention: 

1113 _spec["retention"] = self.retention 

1114 

1115 if self.retention_size: 

1116 _spec["retentionSize"] = self.retention_size 

1117 

1118 if self.route_prefix: 

1119 _spec["routePrefix"] = self.route_prefix 

1120 

1121 if self.rule_namespace_selector: 

1122 _spec["ruleNamespaceSelector"] = self.rule_namespace_selector 

1123 

1124 if self.rule_selector: 

1125 _spec["ruleSelector"] = self.rule_selector 

1126 

1127 if self.rules: 

1128 _spec["rules"] = self.rules 

1129 

1130 if self.sample_limit: 

1131 _spec["sampleLimit"] = self.sample_limit 

1132 

1133 if self.scrape_classes: 

1134 _spec["scrapeClasses"] = self.scrape_classes 

1135 

1136 if self.scrape_config_namespace_selector: 

1137 _spec["scrapeConfigNamespaceSelector"] = self.scrape_config_namespace_selector 

1138 

1139 if self.scrape_config_selector: 

1140 _spec["scrapeConfigSelector"] = self.scrape_config_selector 

1141 

1142 if self.scrape_interval: 

1143 _spec["scrapeInterval"] = self.scrape_interval 

1144 

1145 if self.scrape_protocols: 

1146 _spec["scrapeProtocols"] = self.scrape_protocols 

1147 

1148 if self.scrape_timeout: 

1149 _spec["scrapeTimeout"] = self.scrape_timeout 

1150 

1151 if self.secrets: 

1152 _spec["secrets"] = self.secrets 

1153 

1154 if self.security_context: 

1155 _spec["securityContext"] = self.security_context 

1156 

1157 if self.service_account_name: 

1158 _spec["serviceAccountName"] = self.service_account_name 

1159 

1160 if self.service_monitor_namespace_selector: 

1161 _spec["serviceMonitorNamespaceSelector"] = self.service_monitor_namespace_selector 

1162 

1163 if self.service_monitor_selector: 

1164 _spec["serviceMonitorSelector"] = self.service_monitor_selector 

1165 

1166 if self.sha: 

1167 _spec["sha"] = self.sha 

1168 

1169 if self.shards: 

1170 _spec["shards"] = self.shards 

1171 

1172 if self.storage: 

1173 _spec["storage"] = self.storage 

1174 

1175 if self.tag: 

1176 _spec["tag"] = self.tag 

1177 

1178 if self.target_limit: 

1179 _spec["targetLimit"] = self.target_limit 

1180 

1181 if self.thanos: 

1182 _spec["thanos"] = self.thanos 

1183 

1184 if self.tolerations: 

1185 _spec["tolerations"] = self.tolerations 

1186 

1187 if self.topology_spread_constraints: 

1188 _spec["topologySpreadConstraints"] = self.topology_spread_constraints 

1189 

1190 if self.tracing_config: 

1191 _spec["tracingConfig"] = self.tracing_config 

1192 

1193 if self.tsdb: 

1194 _spec["tsdb"] = self.tsdb 

1195 

1196 if self.version: 

1197 _spec["version"] = self.version 

1198 

1199 if self.volume_mounts: 

1200 _spec["volumeMounts"] = self.volume_mounts 

1201 

1202 if self.volumes: 

1203 _spec["volumes"] = self.volumes 

1204 

1205 if self.wal_compression is not None: 

1206 _spec["walCompression"] = self.wal_compression 

1207 

1208 if self.web: 

1209 _spec["web"] = self.web 

1210 

1211 # End of generated code