From da40f0aa3d07106d8d3ba8955b2428cf13c1a383 Mon Sep 17 00:00:00 2001 From: howieyuen Date: Thu, 3 Nov 2022 17:43:50 +0800 Subject: [PATCH 001/104] chore: fix inconsistency between schema field property and comment --- .../kube/frontend/common/metadata.k | 2 +- .../kube/frontend/container/container.k | 6 +++ .../frontend/container/port/container_port.k | 2 +- .../kube/frontend/container/probe/probe.k | 2 +- .../kube/frontend/ingress/ingress.k | 43 +++---------------- base/pkg/kusion_models/kube/frontend/job.k | 14 +++--- .../kube/frontend/rbac/cluster_role.k | 4 +- .../kube/frontend/rbac/cluster_role_binding.k | 4 +- .../kusion_models/kube/frontend/rbac/role.k | 4 +- .../kube/frontend/rbac/role_binding.k | 4 +- .../kube/frontend/resource/resource.k | 6 +-- .../kube/frontend/secret/secret.k | 12 +++--- base/pkg/kusion_models/kube/frontend/server.k | 12 +++--- .../kube/frontend/service/service.k | 12 ++---- .../frontend/serviceaccount/service_account.k | 2 +- .../kube/frontend/sidecar/sidecar.k | 14 +++--- .../kube/frontend/volume/volume.k | 4 +- 17 files changed, 61 insertions(+), 86 deletions(-) diff --git a/base/pkg/kusion_models/kube/frontend/common/metadata.k b/base/pkg/kusion_models/kube/frontend/common/metadata.k index 5e30f830..011925a3 100644 --- a/base/pkg/kusion_models/kube/frontend/common/metadata.k +++ b/base/pkg/kusion_models/kube/frontend/common/metadata.k @@ -4,7 +4,7 @@ schema Metadata: Attributes ---------- - name: str, default is Undefined, required. + name: str, default is Undefined, optional. The name of the resource. Name must be unique within a namespace. It's required when creating resources, although some resources may allow a client to request the diff --git a/base/pkg/kusion_models/kube/frontend/container/container.k b/base/pkg/kusion_models/kube/frontend/container/container.k index 1ff8e408..c2346d79 100644 --- a/base/pkg/kusion_models/kube/frontend/container/container.k +++ b/base/pkg/kusion_models/kube/frontend/container/container.k @@ -38,6 +38,12 @@ schema Main: startupProbe: p.Probe, default is Undefined, optional. A Container-level attribute. The probe to indicates that the Pod has successfully initialized. + lifecycle: lc.Lifecycle, default is Undefined, optional + Actions that the management system should take in response to container lifecycle events. Cannot be updated. + securityContext: {str:any}, default is Undefined, optional + SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + workingDir: str, default is Undefined, optional + Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. Examples -------- diff --git a/base/pkg/kusion_models/kube/frontend/container/port/container_port.k b/base/pkg/kusion_models/kube/frontend/container/port/container_port.k index 39653745..09862421 100644 --- a/base/pkg/kusion_models/kube/frontend/container/port/container_port.k +++ b/base/pkg/kusion_models/kube/frontend/container/port/container_port.k @@ -10,7 +10,7 @@ schema ContainerPort: protocol: "TCP" | "UDP" | "SCTP", default is "TCP", required. A Container-level attribute. The protocol for port. Must be UDP, TCP or SCTP. Default is TCP. - containerPort: int, default is Undefined, optional. + containerPort: int, default is Undefined, required. A Container-level attribute. The number of port to expose on the container's IP address. diff --git a/base/pkg/kusion_models/kube/frontend/container/probe/probe.k b/base/pkg/kusion_models/kube/frontend/container/probe/probe.k index d2d1ed3c..2cf4285c 100644 --- a/base/pkg/kusion_models/kube/frontend/container/probe/probe.k +++ b/base/pkg/kusion_models/kube/frontend/container/probe/probe.k @@ -55,7 +55,7 @@ schema Exec: Attributes ---------- - command: str, default is Undefined, required. + command: [str], default is Undefined, required. A Container-level attribute. The command line to execute inside the container. """ diff --git a/base/pkg/kusion_models/kube/frontend/ingress/ingress.k b/base/pkg/kusion_models/kube/frontend/ingress/ingress.k index 9defb776..ae04332c 100644 --- a/base/pkg/kusion_models/kube/frontend/ingress/ingress.k +++ b/base/pkg/kusion_models/kube/frontend/ingress/ingress.k @@ -1,5 +1,5 @@ import base.pkg.kusion_models.kube.frontend.common -import base.pkg.kusion_kubernetes.api.networking.v1 as networking_v1 +import base.pkg.kusion_kubernetes.api.networking.v1 as networkingv1 schema Ingress(common.Metadata): """Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. @@ -7,38 +7,9 @@ schema Ingress(common.Metadata): Attributes ---------- - name: str - The name of the resource. - Name must be unique within a namespace. It's required when creating - resources, although some resources may allow a client to request the - generation of an appropriate name automatically. - Name is primarily intended for creation idempotence and configuration - definition. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/identifiers#names - Required. - labels: {str:str} - Labels is a map of string keys and values that can be used to - organize and categorize (scope and select) objects. - May match selectors of replication controllers and services. - More info: http://kubernetes.io/docs/user-guide/labels - Optional. - annotations: {str:str} - Annotations is an unstructured key value map stored with a - resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. - More info: http://kubernetes.io/docs/user-guide/annotations - Optional. - namespace: str - Namespaces are intended for use in environments with many users spread - across multiple teams, or projects. - For clusters with a few to tens of users, you should not need to create - or think about namespaces at all. Start using namespaces when you need the features they provide. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - Optional. - rules: [networking_v1beta1.IngressRule] + rules: [networkingv1.IngressRule], default is Undefined, optional A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. - tls: [IngressTLS], default is Undefined, optional + tls: [networkingv1.IngressTLS], default is Undefined, optional TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI. Examples @@ -62,11 +33,11 @@ schema Ingress(common.Metadata): ] tls = [ { - hosts = ["your-domain.com"] - secretName = "example-ingress-tls" + hosts = ["your-domain.com"] + secretName = "example-ingress-tls" } ] } """ - rules?: [networking_v1.IngressRule] - tls?: [networking_v1.IngressTLS] + rules?: [networkingv1.IngressRule] + tls?: [networkingv1.IngressTLS] diff --git a/base/pkg/kusion_models/kube/frontend/job.k b/base/pkg/kusion_models/kube/frontend/job.k index 63b1b2f3..89422d2e 100644 --- a/base/pkg/kusion_models/kube/frontend/job.k +++ b/base/pkg/kusion_models/kube/frontend/job.k @@ -18,7 +18,7 @@ schema Job: before the system tries to terminate it; value must be positive integer backoffLimit: int, default is 6, optional. Specifies the number of retries before marking this job failed. Defaults to 6 - completionMode: str, default is Undefined, optional + completionMode: "NonIndexed" | "Indexed", default is NonIndexed, optional CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. completions: int, default is Undefined, optional. Specifies the desired number of successfully finished pods the job should be run with. @@ -33,7 +33,7 @@ schema Job: Suspend specifies whether the Job controller should create Pods or not. ttlSecondsAfterFinished: int, default is Undefined, optional. ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). - selector: apis.LabelSelector, default is Undefined, optional. + selector: {str:str}, default is Undefined, optional. A label query over pods that should match the pod count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors podMetadata: apis.ObjectMeta, default is Undefined, optional. @@ -44,20 +44,20 @@ schema Job: annotations: {str:str}, default is Undefined, optional. Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations - restartPolicy: str, default is Never, optional. + restartPolicy: "Never" | "OnFailure", default is Never, optional. Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy mainContainer: container.Main, default is Undefined, required. MainContainer describes the main container configuration that is expected to be run on the host. - image: str, default is Undefined, optional. - Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images - schedulingStrategy: strategy.SchedulingStrategy, default is Undefined, required. + image: str, default is Undefined, required. + Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + schedulingStrategy: strategy.SchedulingStrategy, default is Undefined, optional. SchedulingStrategy represents scheduling strategy. sidecarContainers: [s.Sidecar], default is Undefined, optional. SidecarContainers describes the list of sidecar container configuration that is expected to be run on the host. initContainers: [s.Sidecar], default is Undefined, optional. InitContainers describes the list of sidecar container configuration that is expected to be run on the host. - needNamespace: bool,default is True, optional. + needNamespace: bool, default is True, optional. NeedNamespace mark server is namespace scoped or not. volumes: [volume.Volume], default is Undefined, optional. Volumes represents a named volume and corresponding mounts in containers. diff --git a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k b/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k index a336938b..a8b78c5c 100644 --- a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k +++ b/base/pkg/kusion_models/kube/frontend/rbac/cluster_role.k @@ -4,9 +4,9 @@ import base.pkg.kusion_models.kube.mixins schema ClusterRole(common.Metadata): """ - rules : [PolicyRule], default is Undefined, optional + rules: [PolicyRule], default is Undefined, optional Rules holds all the PolicyRules for this ClusterRole - aggregationRule : AggregationRule, default is Undefined, optional + aggregationRule: AggregationRule, default is Undefined, optional AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller. """ mixin [ diff --git a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k b/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k index 1de02b3f..cf0856e3 100644 --- a/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k +++ b/base/pkg/kusion_models/kube/frontend/rbac/cluster_role_binding.k @@ -4,9 +4,9 @@ import base.pkg.kusion_models.kube.mixins schema ClusterRoleBinding(common.Metadata): """ - subjects : [Subject], default is Undefined, optional + subjects: [Subject], default is Undefined, optional Subjects holds references to the objects the role applies to. - roleRef : ClusterRole, default is Undefined, required + roleRef: ClusterRole, default is Undefined, required RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. """ mixin [ diff --git a/base/pkg/kusion_models/kube/frontend/rbac/role.k b/base/pkg/kusion_models/kube/frontend/rbac/role.k index b3588411..2f3a403f 100644 --- a/base/pkg/kusion_models/kube/frontend/rbac/role.k +++ b/base/pkg/kusion_models/kube/frontend/rbac/role.k @@ -4,8 +4,8 @@ import base.pkg.kusion_models.kube.mixins schema Role(common.Metadata): """ - rules : [PolicyRule], default is Undefined, optional - Rules holds all the PolicyRules for this ClusterRole + rules: [PolicyRule], default is Undefined, optional + Rules holds all the PolicyRules for this ClusterRole """ mixin [ mixins.MetadataMixin diff --git a/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k b/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k index a3655a9d..6619dc34 100644 --- a/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k +++ b/base/pkg/kusion_models/kube/frontend/rbac/role_binding.k @@ -4,9 +4,9 @@ import base.pkg.kusion_models.kube.mixins schema RoleBinding(common.Metadata): """ - subjects : [Subject], default is Undefined, optional + subjects: [Subject], default is Undefined, optional Subjects holds references to the objects the role applies to. - roleRef : RoleRef, default is Undefined, required + roleRef: RoleRef, default is Undefined, required RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. """ mixin [ diff --git a/base/pkg/kusion_models/kube/frontend/resource/resource.k b/base/pkg/kusion_models/kube/frontend/resource/resource.k index 7d2ca2b2..7b1f24c1 100644 --- a/base/pkg/kusion_models/kube/frontend/resource/resource.k +++ b/base/pkg/kusion_models/kube/frontend/resource/resource.k @@ -7,13 +7,13 @@ schema Resource: Attributes ---------- - cpu: int | Unit, default is 1, required. + cpu: int | Unit, default is 1, optional. A Container-level attribute. CPU, in cores, default 1 core. (500m = .5 cores) - memory: Unit, default is 1024Mi, required. + memory: Unit, default is 1024Mi, optional. A Container-level attribute. Memory, in bytes, default 1024Mi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) - disk: Unit, default is 10Gi, required. + disk: Unit, default is 10Gi, optional. A Container-level attribute. Local disk storage, in bytes, default 10Gi. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) diff --git a/base/pkg/kusion_models/kube/frontend/secret/secret.k b/base/pkg/kusion_models/kube/frontend/secret/secret.k index babf0812..125fc66a 100644 --- a/base/pkg/kusion_models/kube/frontend/secret/secret.k +++ b/base/pkg/kusion_models/kube/frontend/secret/secret.k @@ -8,14 +8,14 @@ schema Secret(common.Metadata): Attributes ---------- data: {str:str}, default is Undefined, optional - Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. - More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data + Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. + More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data stringData: {str:str}, default is Undefined, optional - stringData allows specifying non-binary secret data in string form. - More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data + stringData allows specifying non-binary secret data in string form. + More info: https://kubernetes.io/docs/concepts/configuration/secret/#restriction-names-data type: str, default is Undefined, optional - Used to facilitate programmatic handling of secret data. - More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types + Used to facilitate programmatic handling of secret data. + More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types Examples -------- diff --git a/base/pkg/kusion_models/kube/frontend/server.k b/base/pkg/kusion_models/kube/frontend/server.k index 306e7ccd..19bb6e63 100644 --- a/base/pkg/kusion_models/kube/frontend/server.k +++ b/base/pkg/kusion_models/kube/frontend/server.k @@ -14,12 +14,12 @@ schema Server: Attributes ---------- - workloadType: str, default is "Deployment", required. + workloadType: "Deployment" | "StatefulSet", default is "Deployment", required. Application workload type, default to 'Deployment' replicas: int, default is 1, required. Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. - image: str, default is Undefined, optional. - Docker image name. + image: str, default is Undefined, required. + Container image name. More info: https://kubernetes.io/docs/concepts/containers/images schedulingStrategy: strategy.SchedulingStrategy, default is Undefined, required. SchedulingStrategy represents scheduling strategy. @@ -34,7 +34,7 @@ schema Server: labels: {str:str}, default is Undefined, optional. Labels is a map of string keys and values that can be used to organize and categorize (scope and select) objects. More info: http://kubernetes.io/docs/user-guide/labels - annotations: {str:str}, default is Undefined, optional. + annotations: {str:str}, default is Undefined, optional Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations useBuiltInSelector: bool, default is False, optional. @@ -45,9 +45,9 @@ schema Server: PodMetadata is metadata that all persisted resources must have, which includes all objects users must create. volumes: [volume.Volume], default is Undefined, optional. Volumes represents a named volume and corresponding mounts in containers. - needNamespace: bool,default is True, optional. + needNamespace: bool, default is True, optional. NeedNamespace mark server is namespace scoped or not. - enableMonitoring: bool,default is False, optional. + enableMonitoring: bool, default is False, optional. EnableMonitoring mark server is enable monitor or not. configMaps: [configmap.ConfigMap], default is Undefined, optional. ConfigMaps is a list of ConfigMap which holds configuration data for server to consume. diff --git a/base/pkg/kusion_models/kube/frontend/service/service.k b/base/pkg/kusion_models/kube/frontend/service/service.k index fb30f999..5eed819f 100644 --- a/base/pkg/kusion_models/kube/frontend/service/service.k +++ b/base/pkg/kusion_models/kube/frontend/service/service.k @@ -27,10 +27,6 @@ schema Service(common.Metadata): externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. healthCheckNodePort: int, default is Undefined, optional healthCheckNodePort specifies the healthcheck nodePort for the service. - internalTrafficPolicy: str, default is Undefined, optional - InternalTrafficPolicy specifies if the cluster internal traffic should be routed to all endpoints or node-local endpoints only. - ipFamilies: [str], default is Undefined, optional - ipFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this service, and is gated by the "IPv6DualStack" feature gate. ipFamilyPolicy: str, default is Undefined, optional ipFamilyPolicy represents the dual-stack-ness requested or required by this Service, and is gated by the "IPv6DualStack" feature gate. loadBalancerIP: str, default is Undefined, optional @@ -39,16 +35,16 @@ schema Service(common.Metadata): If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature. More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/ - ports: [ServicePort], default is Undefined, optional + ports: [corev1.ServicePort], default is Undefined, optional The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies publishNotReadyAddresses: bool, default is Undefined, optional publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. - sessionAffinity : str, default is Undefined, optional + sessionAffinity: str, default is Undefined, optional Supports "ClientIP" and "None". Used to maintain session affinity. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - sessionAffinityConfig : SessionAffinityConfig, default is Undefined, optional - sessionAffinityConfig contains the configurations of session affinity. + sessionAffinityConfig: {str:}, default is Undefined, optional + sessionAffinityConfig contains the configurations of session affinity. Examples -------- diff --git a/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k b/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k index 5856108b..6aa5a20f 100644 --- a/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k +++ b/base/pkg/kusion_models/kube/frontend/serviceaccount/service_account.k @@ -2,7 +2,7 @@ import base.pkg.kusion_models.kube.frontend.common schema ServiceAccount(common.Metadata): """A service account provides an identity for processes that run in a Pod. - ServiceAccount binds together: + ServiceAccount binds together: - a name, understood by users, and perhaps by peripheral systems, for an identity - a principal that can be authenticated and authorized - a set of secrets diff --git a/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k b/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k index fc9eb911..ff6780d0 100644 --- a/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k +++ b/base/pkg/kusion_models/kube/frontend/sidecar/sidecar.k @@ -21,12 +21,12 @@ schema Sidecar: env: [e.Env], default is Undefined, optional. A Container-level attribute. List of environment variables in the container. - envFrom: [EnvFromSource], default is Undefined, optional + envFrom: [e.EnvFromSource], default is Undefined, optional A Container-level attribute. List of sources to populate environment variables in the container. - image: str, default is Undefined, optional + image: str, default is Undefined, required A Container-level attribute. - Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images + Container image name. More info: https://kubernetes.io/docs/concepts/containers/images livenessProbe: p.Probe, default is Undefined, optional. A Container-level attribute. The probe to check whether container is live or not. @@ -36,19 +36,21 @@ schema Sidecar: startupProbe: p.Probe, default is Undefined, optional. A Container-level attribute. The probe to indicates that the Pod has successfully initialized. - resource: str, default is "1 Date: Fri, 4 Nov 2022 16:55:03 +0800 Subject: [PATCH 002/104] cleancode: base/pkg/kusion_prometheus/monitoring/v1 --- .../monitoring/v1/alerting_spec.k | 4 +- .../monitoring/v1/alertmanager.k | 14 +- .../v1/alertmanager_configuration.k | 10 +- .../monitoring/v1/alertmanager_endpoints.k | 36 ++-- .../v1/alertmanager_global_config.k | 6 +- .../monitoring/v1/alertmanager_spec.k | 162 +++++++++--------- .../monitoring/v1/alertmanager_status.k | 20 +-- .../monitoring/v1/alertmanager_web_spec.k | 4 +- .../monitoring/v1/api_server_config.k | 18 +- .../arbitrary_fs_access_through_sms_config.k | 2 +- .../monitoring/v1/argument.k | 8 +- .../monitoring/v1/attach_metadata.k | 4 +- .../monitoring/v1/authorization.k | 2 +- .../monitoring/v1/basic_auth.k | 4 +- .../monitoring/v1/common_prometheus_fields.k | 132 +++++++------- .../monitoring/v1/embedded_object_metadata.k | 12 +- .../v1/embedded_persistent_volume_claim.k | 12 +- .../monitoring/v1/endpoint.k | 70 ++++---- .../monitoring/v1/exemplars.k | 4 +- .../monitoring/v1/host_alias.k | 8 +- .../monitoring/v1/http_config.k | 18 +- .../monitoring/v1/metadata_config.k | 8 +- .../monitoring/v1/namespace_selector.k | 8 +- .../kusion_prometheus/monitoring/v1/oauth2.k | 16 +- .../monitoring/v1/object_reference.k | 16 +- .../monitoring/v1/pod_metadata.k | 6 +- .../monitoring/v1/pod_metrics_endpoint.k | 66 +++---- .../monitoring/v1/pod_monitor.k | 12 +- .../monitoring/v1/pod_monitor_spec.k | 38 ++-- .../kusion_prometheus/monitoring/v1/probe.k | 12 +- .../monitoring/v1/probe_spec.k | 54 +++--- .../monitoring/v1/probe_target_ingress.k | 8 +- .../v1/probe_target_static_config.k | 12 +- .../monitoring/v1/probe_targets.k | 4 +- .../monitoring/v1/probe_tls_config.k | 14 +- .../monitoring/v1/prober_spec.k | 16 +- .../monitoring/v1/prometheus.k | 14 +- .../monitoring/v1/prometheus_condition.k | 24 +-- .../monitoring/v1/prometheus_rule.k | 12 +- .../v1/prometheus_rule_exclude_config.k | 8 +- .../monitoring/v1/prometheus_rule_spec.k | 4 +- .../monitoring/v1/prometheus_spec.k | 70 ++++---- .../monitoring/v1/prometheus_status.k | 28 +-- .../monitoring/v1/prometheus_web_spec.k | 6 +- .../monitoring/v1/query_spec.k | 16 +- .../monitoring/v1/queue_config.k | 36 ++-- .../monitoring/v1/relabel_config.k | 28 +-- .../monitoring/v1/remote_read_spec.k | 44 ++--- .../monitoring/v1/remote_write_spec.k | 50 +++--- .../kusion_prometheus/monitoring/v1/rule.k | 12 +- .../monitoring/v1/rule_group.k | 8 +- .../kusion_prometheus/monitoring/v1/rules.k | 2 +- .../monitoring/v1/rules_alert.k | 13 +- .../monitoring/v1/safe_authorization.k | 6 +- .../monitoring/v1/safe_tls_config.k | 14 +- .../monitoring/v1/secret_or_configMap.k | 4 +- .../monitoring/v1/service_monitor.k | 12 +- .../monitoring/v1/service_monitor_spec.k | 42 ++--- .../monitoring/v1/shard_status.k | 20 +-- .../kusion_prometheus/monitoring/v1/sigv4.k | 16 +- .../monitoring/v1/storage_spec.k | 10 +- .../monitoring/v1/thanos_spec.k | 62 +++---- .../monitoring/v1/tls_config.k | 26 +-- .../monitoring/v1/web_http_config.k | 6 +- .../monitoring/v1/web_http_headers.k | 20 +-- .../monitoring/v1/web_tls_config.k | 18 +- 66 files changed, 736 insertions(+), 735 deletions(-) diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k b/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k index a413fd8e..b803ecf8 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alerting_spec.k @@ -9,8 +9,8 @@ schema AlertingSpec: Attributes ---------- - alertmanagers : [AlertmanagerEndpoints], default is Undefined, required - AlertmanagerEndpoints Prometheus should fire alerts against. + alertmanagers: [AlertmanagerEndpoints], default is Undefined, required + AlertmanagerEndpoints Prometheus should fire alerts against. """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k index 34eab9f5..973a4755 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager.k @@ -10,15 +10,15 @@ schema Alertmanager: Attributes ---------- - apiVersion : str, default is "monitoring.coreos.com/v1", required - APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - kind : str, default is "Alertmanager", required - Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - metadata : apis.ObjectMeta, default is Undefined, optional + apiVersion: str, default is "monitoring.coreos.com/v1", required + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + kind: str, default is "Alertmanager", required + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + metadata: apis.ObjectMeta, default is Undefined, optional metadata - spec : AlertmanagerSpec, default is Undefined, required + spec: AlertmanagerSpec, default is Undefined, required spec - status : AlertmanagerStatus, default is Undefined, optional + status: AlertmanagerStatus, default is Undefined, optional status """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k index ebd74f79..97063ab9 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_configuration.k @@ -9,11 +9,11 @@ schema AlertmanagerConfiguration: Attributes ---------- - name : str, default is Undefined, required - The name of the AlertmanagerConfig resource which is used to generate the Alertmanager configuration. It must be defined in the same namespace as the Alertmanager object. The operator will not enforce a `namespace` label for routes and inhibition rules. - templates : [SecretOrConfigMap], default is Undefined, optional - Custom notification templates. - global : AlertmanagerGlobalConfig, default is Undefined, optional + name: str, default is Undefined, required + The name of the AlertmanagerConfig resource which is used to generate the Alertmanager configuration. It must be defined in the same namespace as the Alertmanager object. The operator will not enforce a `namespace` label for routes and inhibition rules. + templates: [SecretOrConfigMap], default is Undefined, optional + Custom notification templates. + global: AlertmanagerGlobalConfig, default is Undefined, optional global """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k index ae3d2795..9ef64f70 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_endpoints.k @@ -10,25 +10,25 @@ schema AlertmanagerEndpoints: Attributes ---------- - apiVersion : str, default is Undefined, optional - Version of the Alertmanager API that Prometheus uses to send alerts. It can be "v1" or "v2". - authorization : SafeAuthorization, default is Undefined, optional + apiVersion: str, default is Undefined, optional + Version of the Alertmanager API that Prometheus uses to send alerts. It can be "v1" or "v2". + authorization: SafeAuthorization, default is Undefined, optional authorization - bearerTokenFile : str, default is Undefined, optional - BearerTokenFile to read from filesystem to use when authenticating to Alertmanager. - name : str, default is Undefined, required - Name of Endpoints object in Namespace. - namespace : str, default is Undefined, required - Namespace of Endpoints object. - pathPrefix : str, default is Undefined, optional - Prefix for the HTTP path alerts are pushed to. - port : int or str, default is Undefined, required - Port the Alertmanager API is exposed on. - scheme : str, default is Undefined, optional - Scheme to use when firing alerts. - timeout : str, default is Undefined, optional - Timeout is a per-target Alertmanager timeout when pushing alerts. - tlsConfig : TLSConfig, default is Undefined, optional + bearerTokenFile: str, default is Undefined, optional + BearerTokenFile to read from filesystem to use when authenticating to Alertmanager. + name: str, default is Undefined, required + Name of Endpoints object in Namespace. + namespace: str, default is Undefined, required + Namespace of Endpoints object. + pathPrefix: str, default is Undefined, optional + Prefix for the HTTP path alerts are pushed to. + port: int | str, default is Undefined, required + Port the Alertmanager API is exposed on. + scheme: str, default is Undefined, optional + Scheme to use when firing alerts. + timeout: str, default is Undefined, optional + Timeout is a per-target Alertmanager timeout when pushing alerts. + tlsConfig: TLSConfig, default is Undefined, optional tls config """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k index faa2d2c6..93d134b7 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_global_config.k @@ -10,9 +10,9 @@ schema AlertmanagerGlobalConfig: Attributes ---------- - resolveTimeout : str, default is Undefined, optional - ResolveTimeout is the default value used by alertmanager if the alert does not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt. - httpConfig : HTTPConfig, default is Undefined, optional + resolveTimeout: str, default is Undefined, optional + ResolveTimeout is the default value used by alertmanager if the alert does not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt. + httpConfig: HTTPConfig, default is Undefined, optional http config """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k index e7edff7e..08f7750d 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_spec.k @@ -12,95 +12,95 @@ schema AlertmanagerSpec: Attributes ---------- - additionalPeers : [str], default is Undefined, optional - AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster. - baseImage : str, default is Undefined, optional - Base image that is used to deploy pods, without tag. Deprecated: use 'image' instead - clusterAdvertiseAddress : str, default is Undefined, optional - ClusterAdvertiseAddress is the explicit address to advertise in cluster. Needs to be provided for non RFC1918 [1] (public) addresses. [1] RFC1918: https://tools.ietf.org/html/rfc1918 - clusterGossipInterval : str, default is Undefined, optional - Interval between gossip attempts. - clusterPeerTimeout : str, default is Undefined, optional - Timeout for cluster peering. - clusterPushpullInterval : str, default is Undefined, optional - Interval between pushpull attempts. - configMaps : [str], default is Undefined, optional - ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. The ConfigMaps are mounted into /etc/alertmanager/configmaps/ in the 'alertmanager' container. - configSecret : str, default is Undefined, optional - ConfigSecret is the name of a Kubernetes Secret in the same namespace as the Alertmanager object, which contains the configuration for this Alertmanager instance. If empty, it defaults to 'alertmanager-'. - The Alertmanager configuration should be available under the `alertmanager.yaml` key. Additional keys from the original secret are copied to the generated secret. - If either the secret or the `alertmanager.yaml` key is missing, the operator provisions an Alertmanager configuration with one empty receiver (effectively dropping alert notifications). - containers : [v1.Container], default is Undefined, optional - Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to an Alertmanager pod. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `alertmanager` and `config-reloader`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - externalUrl : str, default is Undefined, optional - The external URL the Alertmanager instances will be available under. This is necessary to generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name. - forceEnableClusterMode : bool, default is Undefined, optional - ForceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica. Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each. - hostAliases : [HostAlias], default is Undefined, optional - Pods' hostAliases configuration - image : str, default is Undefined, optional - Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Alertmanager is being configured. - imagePullSecrets : [v1.LocalObjectReference], default is Undefined, optional - An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod - initContainers : [v1.Container], default is Undefined, optional - InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Alertmanager configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - listenLocal : bool, default is Undefined, optional - ListenLocal makes the Alertmanager server listen on loopback, so that it does not bind against the Pod IP. Note this is only for the Alertmanager UI, not the gossip communication. - logFormat : str, default is Undefined, optional - Log format for Alertmanager to be configured with. - logLevel : str, default is Undefined, optional - Log level for Alertmanager to be configured with. - minReadySeconds : int, default is Undefined, optional - Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. - nodeSelector : {str:str}, default is Undefined, optional - Define which Nodes the Pods are scheduled on. - paused : bool, default is Undefined, optional - If set to true all actions on the underlying managed objects are not goint to be performed, except for delete actions. - portName : str, default is Undefined, optional - Port name used for the pods and governing service. This defaults to web - priorityClassName : str, default is Undefined, optional - Priority class assigned to the Pods - replicas : int, default is Undefined, optional - Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size. - retention : str, default is "120h", optional - Time duration Alertmanager shall retain data for. Default is '120h', and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours). - routePrefix : str, default is Undefined, optional - The route prefix Alertmanager registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. - secrets : [str], default is Undefined, optional - Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-`. The Secrets are mounted into /etc/alertmanager/secrets/ in the 'alertmanager' container. - serviceAccountName : str, default is Undefined, optional - ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. - sha : str, default is Undefined, optional - SHA of Alertmanager container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set. Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. - tag : str, default is Undefined, optional - Tag of Alertmanager container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set. Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. - tolerations : [v1.Toleration], default is Undefined, optional - If specified, the pod's tolerations. - topologySpreadConstraints : [v1.TopologySpreadConstraint], default is Undefined, optional - If specified, the pod's topology spread constraints. - version : str, default is Undefined, optional - Version the cluster should be on. - volumeMounts : [v1.VolumeMount], default is Undefined, optional - VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container, that are generated as a result of StorageSpec objects. - volumes : [v1.Volume], default is Undefined, optional - Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. - affinity : v1.Affinity, default is Undefined, optional + additionalPeers: [str], default is Undefined, optional + AdditionalPeers allows injecting a set of additional Alertmanagers to peer with to form a highly available cluster. + baseImage: str, default is Undefined, optional + Base image that is used to deploy pods, without tag. Deprecated: use 'image' instead + clusterAdvertiseAddress: str, default is Undefined, optional + ClusterAdvertiseAddress is the explicit address to advertise in cluster. Needs to be provided for non RFC1918 [1] (public) addresses. [1] RFC1918: https://tools.ietf.org/html/rfc1918 + clusterGossipInterval: str, default is Undefined, optional + Interval between gossip attempts. + clusterPeerTimeout: str, default is Undefined, optional + Timeout for cluster peering. + clusterPushpullInterval: str, default is Undefined, optional + Interval between pushpull attempts. + configMaps: [str], default is Undefined, optional + ConfigMaps is a list of ConfigMaps in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. The ConfigMaps are mounted into /etc/alertmanager/configmaps/ in the 'alertmanager' container. + configSecret: str, default is Undefined, optional + ConfigSecret is the name of a Kubernetes Secret in the same namespace as the Alertmanager object, which contains the configuration for this Alertmanager instance. If empty, it defaults to 'alertmanager-'. + The Alertmanager configuration should be available under the `alertmanager.yaml` key. Additional keys from the original secret are copied to the generated secret. + If either the secret or the `alertmanager.yaml` key is missing, the operator provisions an Alertmanager configuration with one empty receiver (effectively dropping alert notifications). + containers: [v1.Container], default is Undefined, optional + Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to an Alertmanager pod. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `alertmanager` and `config-reloader`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + externalUrl: str, default is Undefined, optional + The external URL the Alertmanager instances will be available under. This is necessary to generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name. + forceEnableClusterMode: bool, default is Undefined, optional + ForceEnableClusterMode ensures Alertmanager does not deactivate the cluster mode when running with a single replica. Use case is e.g. spanning an Alertmanager cluster across Kubernetes clusters with a single replica in each. + hostAliases: [HostAlias], default is Undefined, optional + Pods' hostAliases configuration + image: str, default is Undefined, optional + Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Alertmanager is being configured. + imagePullSecrets: [v1.LocalObjectReference], default is Undefined, optional + An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + initContainers: [v1.Container], default is Undefined, optional + InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Alertmanager configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ Using initContainers for any use case other then secret fetching is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. + listenLocal: bool, default is Undefined, optional + ListenLocal makes the Alertmanager server listen on loopback, so that it does not bind against the Pod IP. Note this is only for the Alertmanager UI, not the gossip communication. + logFormat: "" | "logfmt" | "json", default is Undefined, optional + Log format for Alertmanager to be configured with. + logLevel: "" | "debug" | "info" | "warn" | "error", default is Undefined, optional + Log level for Alertmanager to be configured with. + minReadySeconds: int, default is Undefined, optional + Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. + nodeSelector: {str:str}, default is Undefined, optional + Define which Nodes the Pods are scheduled on. + paused: bool, default is Undefined, optional + If set to true all actions on the underlying managed objects are not goint to be performed, except for delete actions. + portName: str, default is Undefined, optional + Port name used for the pods and governing service. This defaults to web + priorityClassName: str, default is Undefined, optional + Priority class assigned to the Pods + replicas: int, default is Undefined, optional + Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size. + retention: str, default is "120h", optional + Time duration Alertmanager shall retain data for. Default is '120h', and must match the regular expression `[0-9]+(ms|s|m|h)` (milliseconds seconds minutes hours). + routePrefix: str, default is Undefined, optional + The route prefix Alertmanager registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. + secrets: [str], default is Undefined, optional + Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-`. The Secrets are mounted into /etc/alertmanager/secrets/ in the 'alertmanager' container. + serviceAccountName: str, default is Undefined, optional + ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. + sha: str, default is Undefined, optional + SHA of Alertmanager container image to be deployed. Defaults to the value of `version`. Similar to a tag, but the SHA explicitly deploys an immutable container image. Version and Tag are ignored if SHA is set. Deprecated: use 'image' instead. The image digest can be specified as part of the image URL. + tag: str, default is Undefined, optional + Tag of Alertmanager container image to be deployed. Defaults to the value of `version`. Version is ignored if Tag is set. Deprecated: use 'image' instead. The image tag can be specified as part of the image URL. + tolerations: [v1.Toleration], default is Undefined, optional + If specified, the pod's tolerations. + topologySpreadConstraints: [v1.TopologySpreadConstraint], default is Undefined, optional + If specified, the pod's topology spread constraints. + version: str, default is Undefined, optional + Version the cluster should be on. + volumeMounts: [v1.VolumeMount], default is Undefined, optional + VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the alertmanager container, that are generated as a result of StorageSpec objects. + volumes: [v1.Volume], default is Undefined, optional + Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. + affinity: v1.Affinity, default is Undefined, optional affinity - alertmanagerConfigNamespaceSelector : apis.LabelSelector, default is Undefined, optional + alertmanagerConfigNamespaceSelector: apis.LabelSelector, default is Undefined, optional alertmanager config namespace selector - alertmanagerConfigSelector : apis.LabelSelector, default is Undefined, optional + alertmanagerConfigSelector: apis.LabelSelector, default is Undefined, optional alertmanager config selector - alertmanagerConfiguration : AlertmanagerConfiguration, default is Undefined, optional + alertmanagerConfiguration: AlertmanagerConfiguration, default is Undefined, optional alertmanager configuration - podMetadata : EmbeddedObjectMetadata, default is Undefined, optional + podMetadata: EmbeddedObjectMetadata, default is Undefined, optional pod metadata - resources : v1.ResourceRequirements, default is Undefined, optional + resources: v1.ResourceRequirements, default is Undefined, optional resources - securityContext : v1.PodSecurityContext, default is Undefined, optional + securityContext: v1.PodSecurityContext, default is Undefined, optional security context - storage : StorageSpec, default is Undefined, optional + storage: StorageSpec, default is Undefined, optional storage - web : AlertmanagerWebSpec, default is Undefined, optional + web: AlertmanagerWebSpec, default is Undefined, optional web """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k index d32b30a9..3d746d20 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_status.k @@ -9,16 +9,16 @@ schema AlertmanagerStatus: Attributes ---------- - availableReplicas : int, default is Undefined, required - Total number of available pods (ready for at least minReadySeconds) targeted by this Alertmanager cluster. - paused : bool, default is Undefined, required - Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed. - replicas : int, default is Undefined, required - Total number of non-terminated pods targeted by this Alertmanager cluster (their labels match the selector). - unavailableReplicas : int, default is Undefined, required - Total number of unavailable pods targeted by this Alertmanager cluster. - updatedReplicas : int, default is Undefined, required - Total number of non-terminated pods targeted by this Alertmanager cluster that have the desired version spec. + availableReplicas: int, default is Undefined, required + Total number of available pods (ready for at least minReadySeconds) targeted by this Alertmanager cluster. + paused: bool, default is Undefined, required + Represents whether any actions on the underlying managed objects are being performed. Only delete actions will be performed. + replicas: int, default is Undefined, required + Total number of non-terminated pods targeted by this Alertmanager cluster (their labels match the selector). + unavailableReplicas: int, default is Undefined, required + Total number of unavailable pods targeted by this Alertmanager cluster. + updatedReplicas: int, default is Undefined, required + Total number of non-terminated pods targeted by this Alertmanager cluster that have the desired version spec. """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k index 0f597347..b93c1584 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/alertmanager_web_spec.k @@ -9,9 +9,9 @@ schema AlertmanagerWebSpec: Attributes ---------- - httpConfig : WebHTTPConfig, default is Undefined, optional + httpConfig: WebHTTPConfig, default is Undefined, optional http config - tlsConfig : WebTLSConfig, default is Undefined, optional + tlsConfig: WebTLSConfig, default is Undefined, optional tls config """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k b/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k index 4b5b8096..1fa69d10 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/api_server_config.k @@ -9,17 +9,17 @@ schema APIServerConfig: Attributes ---------- - bearerToken : str, default is Undefined, optional - Bearer token for accessing apiserver. - bearerTokenFile : str, default is Undefined, optional - File to read bearer token for accessing apiserver. - host : str, default is Undefined, required - Host of apiserver. A valid string consisting of a hostname or IP followed by an optional port number - authorization : Authorization, default is Undefined, optional + bearerToken: str, default is Undefined, optional + Bearer token for accessing apiserver. + bearerTokenFile: str, default is Undefined, optional + File to read bearer token for accessing apiserver. + host: str, default is Undefined, required + Host of apiserver. A valid string consisting of a hostname or IP followed by an optional port number + authorization: Authorization, default is Undefined, optional authorization - basicAuth : BasicAuth, default is Undefined, optional + basicAuth: BasicAuth, default is Undefined, optional basic auth - tlsConfig : TLSConfig, default is Undefined, optional + tlsConfig: TLSConfig, default is Undefined, optional tls config """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k b/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k index 7581e407..eb2a63fa 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/arbitrary_fs_access_through_sms_config.k @@ -9,7 +9,7 @@ schema ArbitraryFSAccessThroughSMsConfig: Attributes ---------- - deny : bool, default is Undefined, optional + deny: bool, default is Undefined, optional deny """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/argument.k b/base/pkg/kusion_prometheus/monitoring/v1/argument.k index 81958ca8..d07c0837 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/argument.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/argument.k @@ -9,10 +9,10 @@ schema Argument: Attributes ---------- - name : str, default is Undefined, required - Name of the argument, e.g. "scrape.discovery-reload-interval". - value : str, default is Undefined, optional - Argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile) + name: str, default is Undefined, required + Name of the argument, e.g. "scrape.discovery-reload-interval". + value: str, default is Undefined, optional + Argument value, e.g. 30s. Can be empty for name-only arguments (e.g. --storage.tsdb.no-lockfile) """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k b/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k index abf076d6..852aabd2 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/attach_metadata.k @@ -9,8 +9,8 @@ schema AttachMetadata: Attributes ---------- - node : bool, default is Undefined, optional - When set to true, Prometheus must have permissions to get Nodes. + node: bool, default is Undefined, optional + When set to true, Prometheus must have permissions to get Nodes. """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/authorization.k b/base/pkg/kusion_prometheus/monitoring/v1/authorization.k index 3f86417f..bafe7204 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/authorization.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/authorization.k @@ -9,7 +9,7 @@ schema Authorization(SafeAuthorization): Attributes ---------- - credentialsFile : str, default is Undefined, optional + credentialsFile: str, default is Undefined, optional File to read a secret from, mutually exclusive with Credentials (from SafeAuthorization) """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k b/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k index 95b1309f..abf16d7e 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/basic_auth.k @@ -10,9 +10,9 @@ schema BasicAuth: Attributes ---------- - password : v1.SecretKeySelector, default is Undefined, optional + password: v1.SecretKeySelector, default is Undefined, optional password - username : v1.SecretKeySelector, default is Undefined, optional + username: v1.SecretKeySelector, default is Undefined, optional username """ diff --git a/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k b/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k index 2c526ac7..f49e5179 100644 --- a/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k +++ b/base/pkg/kusion_prometheus/monitoring/v1/common_prometheus_fields.k @@ -12,134 +12,134 @@ schema CommonPrometheusFields: Attributes ---------- - podMetadata : PodMetadata, default is Undefined, optional + podMetadata: PodMetadata, default is Undefined, optional pod metadata - serviceMonitorSelector : apis.LabelSelector, default is Undefined, optional + serviceMonitorSelector: apis.LabelSelector, default is Undefined, optional service monitor selector - serviceMonitorNamespaceSelector : apis.LabelSelector, default is Undefined, optional + serviceMonitorNamespaceSelector: apis.LabelSelector, default is Undefined, optional service monitor namespace selector - podMonitorSelector : apis.LabelSelector, default is Undefined, optional + podMonitorSelector: apis.LabelSelector, default is Undefined, optional pod monitor selector - podMonitorNamespaceSelector : apis.LabelSelector, default is Undefined, optional + podMonitorNamespaceSelector: apis.LabelSelector, default is Undefined, optional pod monitor namespace selector - probeNamespaceSelector : apis.LabelSelector, default is Undefined, optional + probeNamespaceSelector: apis.LabelSelector, default is Undefined, optional probe namespace selector - probeSelector : apis.LabelSelector, default is Undefined, optional + probeSelector: apis.LabelSelector, default is Undefined, optional probe selector - version : str, default is Undefined, optional + version: str, default is Undefined, optional Version of Prometheus to be deployed. - paused : bool, default is Undefined, optional + paused: bool, default is Undefined, optional When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects. - image : str, default is Undefined, optional + image: str, default is Undefined, optional Image if specified has precedence over baseImage, tag and sha combinations. Specifying the version is still necessary to ensure the Prometheus Operator knows what version of Prometheus is being configured. - imagePullSecrets : [v1.LocalObjectReference], default is Undefined, optional + imagePullSecrets: [v1.LocalObjectReference], default is Undefined, optional An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod - replicas : int, default is Undefined, optional + replicas: int, default is Undefined, optional Number of replicas of each shard to deploy for a Prometheus deployment. Number of replicas multiplied by shards is the total number of Pods created. - shards : int, default is Undefined, optional + shards: int, default is Undefined, optional EXPERIMENTAL: Number of shards to distribute targets onto. Number of replicas multiplied by shards is the total number of Pods created. Note that scaling down shards will not reshard data onto remaining instances, it must be manually moved. Increasing shards will not reshard data either but it will continue to be available from the same instances. To query globally use Thanos sidecar and Thanos querier or remote write data to a central location. Sharding is done on the content of the `__address__` target meta-label. - replicaExternalLabelName : str, default is Undefined, optional + replicaExternalLabelName: str, default is Undefined, optional Name of Prometheus external label used to denote replica name. Defaults to the value of `prometheus_replica`. External label will _not_ be added when value is set to empty string (`""`). - prometheusExternalLabelName : str, default is Undefined, optional + prometheusExternalLabelName: str, default is Undefined, optional Name of Prometheus external label used to denote Prometheus instance name. Defaults to the value of `prometheus`. External label will _not_ be added when value is set to empty string (`""`). - logFormat : str, default is Undefined, optional + logFormat: str, default is Undefined, optional Log format for Prometheus to be configured with. - logLevel : str, default is Undefined, optional + logLevel: str, default is Undefined, optional Log level for Prometheus to be configured with. - scrapeInterval : str, default is "30s", optional + scrapeInterval: str, default is "30s", optional Interval between consecutive scrapes. Default: `30s` - scrapeTimeout : str, default is Undefined, optional + scrapeTimeout: str, default is Undefined, optional Number of seconds to wait for target to respond before erroring. - externalLabels : {str:str}, default is Undefined, optional + externalLabels: {str:str}, default is Undefined, optional The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager). - enableFeatures : [str], default is Undefined, optional + enableFeatures: [str], default is Undefined, optional Enable access to Prometheus disabled features. By default, no features are enabled. Enabling disabled features is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. For more information see https://prometheus.io/docs/prometheus/latest/disabled_features/ - enableRemoteWriteReceiver : bool, default is Undefined, optional + enableRemoteWriteReceiver: bool, default is Undefined, optional Enable Prometheus to be used as a receiver for the Prometheus remote write protocol. Defaults to the value of `false`. WARNING: This is not considered an efficient way of ingesting samples. Use it with caution for specific low-volume use cases. It is not suitable for replacing the ingestion via scraping and turning Prometheus into a push-based metrics collection system. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver Only valid in Prometheus versions 2.33.0 and newer. - externalUrl : str, default is Undefined, optional + externalUrl: str, default is Undefined, optional The external URL the Prometheus instances will be available under. This is necessary to generate correct URLs. This is necessary if Prometheus is not served from root of a DNS name. - routePrefix : str, default is Undefined, optional + routePrefix: str, default is Undefined, optional The route prefix Prometheus registers HTTP handlers for. This is useful, if using ExternalURL and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`. - storage : StorageSpec, default is Undefined, optional + storage: StorageSpec, default is Undefined, optional Storage defines the configured storage for a group Prometheus servers. - volumeMounts : [v1.VolumeMount], default is Undefined, optional + volumeMounts: [v1.VolumeMount], default is Undefined, optional VolumeMounts allows configuration of additional VolumeMounts on the output StatefulSet definition. VolumeMounts specified will be appended to other VolumeMounts in the prometheus container, that are generated as a result of StorageSpec objects. - volumes : [v1.volumes], default is Undefined, optional + volumes: [v1.Volumes], default is Undefined, optional Volumes allows configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects. - web : PrometheusWebSpec, default is Undefined, optional + web: PrometheusWebSpec, default is Undefined, optional web - resources : v1.ResourceRequirements, default is Undefined, optional + resources: v1.ResourceRequirements, default is Undefined, optional resources - nodeSelector : {str:str}, default is Undefined, optional + nodeSelector: {str:str}, default is Undefined, optional Define which Nodes the Pods are scheduled on. - serviceAccountName : str, default is Undefined, optional + serviceAccountName: str, default is Undefined, optional ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods. - secrets : [str], default is Undefined, optional + secrets: [str], default is Undefined, optional Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-`. The Secrets are mounted into /etc/prometheus/secrets/ in the 'prometheus' container. - configMaps : [str], default is Undefined, optional + configMaps: [str], default is Undefined, optional ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-`. The ConfigMaps are mounted into /etc/prometheus/configmaps/ in the 'prometheus' container. - affinity : v1.Affinity, default is Undefined, optional + affinity: v1.Affinity, default is Undefined, optional affinity - tolerations : [v1.Toleration], default is Undefined, optional + tolerations: [v1.Toleration], default is Undefined, optional If specified, the pod's tolerations. - topologySpreadConstraints : [v1.TopologySpreadConstraint], default is Undefined, optional + topologySpreadConstraints: [v1.TopologySpreadConstraint], default is Undefined, optional If specified, the pod's topology spread constraints. - remoteWrite : [RemoteWriteSpec], default is Undefined, optional + remoteWrite: [RemoteWriteSpec], default is Undefined, optional remoteWrite is the list of remote write configurations. - securityContext : v1.PodSecurityContext, default is Undefined, optional + securityContext: v1.PodSecurityContext, default is Undefined, optional security context - listenLocal : bool, default is Undefined, optional + listenLocal: bool, default is Undefined, optional ListenLocal makes the Prometheus server listen on loopback, so that it does not bind against the Pod IP. - initContainers : [v1.Container], default is Undefined, optional + initContainers: [v1.Container], default is Undefined, optional InitContainers allows adding initContainers to the pod definition. Those can be used to e.g. fetch secrets for injection into the Prometheus configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch. The current init container name is: `init-config-reloader`. Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - containers : [v1.Container], default is Undefined, optional + containers: [v1.Container], default is Undefined, optional Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to a Prometheus pod or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch. The current container names are: `prometheus`, `config-reloader`, and `thanos-sidecar`. Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice. - additionalScrapeConfigs : v1.SecretKeySelector, default is Undefined, optional + additionalScrapeConfigs: v1.SecretKeySelector, default is Undefined, optional additional scrape configs - apiserverConfig : APIServerConfig, default is Undefined, optional + apiserverConfig: APIServerConfig, default is Undefined, optional apiserver config - portName : str, default is Undefined, optional + portName: str, default is Undefined, optional Port name used for the pods and governing service. This defaults to web - priorityClassName : str, default is Undefined, optional + priorityClassName: str, default is Undefined, optional Priority class assigned to the Pods - arbitraryFSAccessThroughSMs : ArbitraryFSAccessThroughSMsConfig, default is Undefined, optional + arbitraryFSAccessThroughSMs: ArbitraryFSAccessThroughSMsConfig, default is Undefined, optional arbitrary f s access through s ms - overrideHonorLabels : bool, default is Undefined, optional + overrideHonorLabels: bool, default is Undefined, optional When true, Prometheus resolves label conflicts by renaming the labels in the scraped data to "exported_