Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limitation #113

Open
aibangjuxin opened this issue Feb 2, 2024 · 2 comments
Open

Limitation #113

aibangjuxin opened this issue Feb 2, 2024 · 2 comments

Comments

@aibangjuxin
Copy link
Owner

Kubernetes ConfigMap 有一个大小限制,数据存储在 ConfigMap 中不能超过 1 MiB[1]。这意味着 ConfigMap 不适合存储大量数据,如果需要存储超过此限制的设置,可以考虑其他解决方案[1]。此限制是为了确保系统的性能和稳定性[5]。因此,如果需要存储大量数据,可以考虑将其拆分为多个 ConfigMap,或者使用其他方法来管理配置数据[6]。

根据搜索结果,Kubernetes 的 ConfigMap 有一个 1 MiB 的大小限制[1]。如果需要存储更大的数据,可以考虑将其拆分为多个 ConfigMap,或者使用其他方法来管理配置数据[6]。

Sources
[1] ConfigMaps https://kubernetes.io/docs/concepts/configuration/configmap/
[2] At which size is a configmap the wrong solution? https://www.reddit.com/r/kubernetes/comments/11btcfc/at_which_size_is_a_configmap_the_wrong_solution/?rdt=35986
[3] Kubernetes ConfigMap size limitation https://stackoverflow.com/questions/53012798/kubernetes-configmap-size-limitation
[4] Size limit for ConfigMap · Issue #19781 · kubernetes/kubernetes kubernetes/kubernetes#19781
[5] Kubernetes ConfigMaps and Configuration Best Practices https://earthly.dev/blog/kubernetes-config-maps/
[6] Kubernetes Configmap: Our Complete Guide - Qovery https://www.qovery.com/blog/kubernetes-configmap-our-complete-guide/
[7] K8S ConfigMap by Helm limitation https://www.linkedin.com/pulse/k8s-configmap-helm-limitation-sarris-overbosch
[8] Kubernetes ConfigMap size limitation https://devpress.csdn.net/k8s/62fd7dbfc677032930803bfc.html

By Perplexity at https://www.perplexity.ai/search/0fe7b286-dd6b-42e9-925d-27a8b0e20fff

Kubernetes的Secret有一个大小限制,数据存储在Secret中不能超过1MB[1]。这意味着Secret不适合存储大量数据,如果需要存储超过此限制的敏感数据,可以考虑其他解决方案。这个限制是为了确保系统的安全性和稳定性[7]。因此,如果需要存储大量数据,可以考虑使用其他方法来管理敏感数据,比如将其存储在外部的安全存储系统中,然后通过其他方式在Kubernetes中进行引用和使用。

Sources
[1] Secrets https://kubernetes.io/docs/concepts/configuration/secret/
[2] Size limit for ConfigMap · Issue #19781 · kubernetes/kubernetes kubernetes/kubernetes#19781
[3] ConfigMaps https://kubernetes.io/docs/concepts/configuration/configmap/
[4] How to overrun the secret size limitation in kube-prometheus-stack helm chart if we add more and more provisioned dashboard as separate yml files? https://stackoverflow.com/questions/71159109/how-to-overrun-the-secret-size-limitation-in-kube-prometheus-stack-helm-chart-if
[5] 2023-01: Helm Chart Size Limitations and Workarounds https://azure.github.io/azure-service-operator/design/adr-2023-02-helm-chart-size-limitations/
[6] Secrets https://kubebyexample.com/concept/secrets
[7] How to Use Kubernetes Secrets https://www.airplane.dev/blog/kubernetes-secrets
[8] Resource Management for Pods and Containers https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

By Perplexity at https://www.perplexity.ai/search/0fe7b286-dd6b-42e9-925d-27a8b0e20fff

在一个 GKE 集群中,对 ConfigMap 和 Secret 的数量没有硬性限制。但是,集群中的资源是有限的,因此在创建 ConfigMap 和 Secret 时需要注意不要过度使用资源。

一般来说,一个 GKE 集群可以轻松处理数千个 ConfigMap 和 Secret。但是,如果您需要创建大量 ConfigMap 和 Secret,则可能需要考虑将它们存储在外部系统中,例如 HashiCorp Vault 或 AWS Secrets Manager。

以下是一些关于 ConfigMap 和 Secret 数量的注意事项:

  • ConfigMap 和 Secret 的数量会影响集群的性能。创建的 ConfigMap 和 Secret 越多,集群的性能就越有可能下降。
  • ConfigMap 和 Secret 的数量也会影响集群的成本。创建的 ConfigMap 和 Secret 越多,集群的成本就越高。
  • 如果您需要创建大量 ConfigMap 和 Secret,则可以考虑将它们存储在外部系统中。外部系统通常可以更有效地存储和管理大量数据。

如果您不确定在一个 GKE 集群中可以创建多少个 ConfigMap 和 Secret,则可以联系 Google Cloud Support 以获取帮助。

如何检查集群的资源使用情况

您可以使用以下命令检查集群的资源使用情况:

kubectl top nodes

此命令将显示集群中每个节点的资源使用情况。

您还可以使用以下命令检查集群中所有 ConfigMap 和 Secret 的资源使用情况:

kubectl get configmaps,secrets --all-namespaces -o wide

此命令将显示每个 ConfigMap 和 Secret 的名称、大小和创建日期。

@aibangjuxin
Copy link
Owner Author

在 GKE 中,使用 kubectl api-resources --verbs-list --namespaced -o name 命令获取的所有 API 资源的数量没有限制。

但是,集群中的资源是有限的,因此在创建 API 资源时需要注意不要过度使用资源。

一般来说,一个 GKE 集群可以轻松处理数千个 API 资源。但是,如果您需要创建大量 API 资源,则可能需要考虑将它们存储在外部系统中,例如 HashiCorp Vault 或 AWS Secrets Manager。

以下是一些关于 API 资源数量的注意事项:

  • API 资源的数量会影响集群的性能。创建的 API 资源越多,集群的性能就越有可能下降。
  • API 资源的数量也会影响集群的成本。创建的 API 资源越多,集群的成本就越高。
  • 如果您需要创建大量 API 资源,则可以考虑将它们存储在外部系统中。外部系统通常可以更有效地存储和管理大量数据。

如果您不确定在一个 GKE 集群中可以创建多少个 API 资源,则可以联系 Google Cloud Support 以获取帮助。

如何检查集群的资源使用情况

您可以使用以下命令检查集群的资源使用情况:

kubectl top nodes

此命令将显示集群中每个节点的资源使用情况。

您还可以使用以下命令检查集群中所有 API 资源的资源使用情况:

kubectl get all --all-namespaces -o wide

此命令将显示每个 API 资源的名称、大小和创建日期。

@aibangjuxin
Copy link
Owner Author

Certainly! This kubectl command is used to list API resources along with the supported verbs (actions) for those resources in a Kubernetes cluster. Here's a breakdown of the command:

  • kubectl: The command-line tool for interacting with Kubernetes clusters.

  • api-resources: Requests the server to list the supported API resources.

  • --verbs-list: Displays the supported verbs (HTTP methods) for each resource.

  • --namespaced: Shows only resources that are namespaced, meaning they exist within a specific namespace. Namespaces are a way to partition resources in a cluster.

  • -o name: Specifies the output format as just the resource names, without additional information.

Putting it all together, this command retrieves a list of namespaced API resources in your Kubernetes cluster and displays the supported verbs for each resource, showing only the resource names.

这个 kubectl 命令用于在 Kubernetes 集群中列出支持的 API 资源,同时显示这些资源支持的操作(动词)。以下是命令的详细解释:

  • kubectl:与 Kubernetes 集群进行交互的命令行工具。

  • api-resources:请求服务器列出支持的 API 资源。

  • --verbs-list:显示每个资源支持的操作(HTTP 方法)。

  • --namespaced:仅显示具有命名空间的资源,即存在于特定命名空间中的资源。命名空间是在集群中分隔资源的一种方式。

  • -o name:将输出格式指定为仅包含资源名称,而不包含其他信息。

综合起来,这个命令检索在您的 Kubernetes 集群中的具有命名空间的 API 资源列表,并显示每个资源支持的操作,只显示资源名称。

kubectl api-resources --verbs-list --namespaced -o name 命令用于获取集群中所有 API 资源的名称和支持的操作(动词)。

以下是对每个选项的解释:

  • api-resources:此命令用于获取集群中可用的 API 资源列表。
  • --verbs-list:此选项用于显示每个 API 资源支持的操作(动词)列表。
  • --namespaced:此选项用于仅显示支持命名空间的 API 资源。
  • -o name:此选项用于仅显示 API 资源的名称,而不显示其他信息。

以下是一个使用此命令的示例:

kubectl api-resources --verbs-list --namespaced -o name

此命令将输出一个包含集群中所有支持命名空间的 API 资源名称的列表,以及每个 API 资源支持的操作(动词)。

以下是一些常见的 API 资源及其支持的操作(动词):

  • podsget, list, create, update, delete
  • servicesget, list, create, update, delete
  • deploymentsget, list, create, update, delete
  • configmapsget, list, create, update, delete
  • secretsget, list, create, update, delete

您可以使用此命令来了解集群中可用的 API 资源及其支持的操作(动词)。这对于学习 Kubernetes API 或编写 Kubernetes 脚本非常有用。

请注意,此命令仅显示集群中可用的 API 资源。它不会显示每个 API 资源的详细信息,例如字段或子资源。要获取有关特定 API 资源的更多信息,您可以使用 kubectl explain 命令。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant