Lightweight Kubernetes
 
 
 
 
Go to file
Kubernetes Submit Queue feb4d2004a Merge pull request #31064 from soundcloud/grobie/filter-internal-labels
Automatic merge from submit-queue

Filter internal Kubernetes labels from Prometheus metrics

**What this PR does / why we need it**:

Kubernetes uses Docker labels as storage for some internal labels. The
majority of these labels are not meaningful metric labels and a few of
them are even harmful as they're not static and cause wrong aggregation
results.

This change provides a custom labels func to only attach meaningful
labels to cAdvisor exported metrics.

**Which issue this PR fixes**

google/cadvisor#1312

**Special notes for your reviewer**:

Depends on google/cadvisor#1429. Once that is merged, I'll update the vendor update commit.

**Release note**:

```release-note
Remove environment variables and internal Kubernetes Docker labels from cAdvisor Prometheus metric labels.

Old behavior:

- environment variables explicitly whitelisted via --docker-env-metadata-whitelist were exported as `container_env_*=*`. Default is zero so by default non were exported
- all docker labels were exported as `container_label_*=*`

New behavior:

- Only `container_name`, `pod_name`, `namespace`, `id`, `image`, and `name` labels are exposed
- no environment variables will be exposed ever via /metrics, even if whitelisted
```

---

Given that we have full control over the exported label set, I shortened the pod_name, pod_namespace and container_name label names. Below an example of the change (reformatted for readability).

```
# BEFORE
container_cpu_cfs_periods_total{
  container_label_io_kubernetes_container_hash="5af8c3b4",
  container_label_io_kubernetes_container_name="sync",
  container_label_io_kubernetes_container_restartCount="1",
  container_label_io_kubernetes_container_terminationMessagePath="/dev/termination-log",
  container_label_io_kubernetes_pod_name="popularsearches-web-3165456836-2bfey",
  container_label_io_kubernetes_pod_namespace="popularsearches",
  container_label_io_kubernetes_pod_terminationGracePeriod="30",
  container_label_io_kubernetes_pod_uid="6a291e48-47c4-11e6-84a4-c81f66bdf8bd",
  id="/docker/68e1f15353921f4d6d4d998fa7293306c4ac828d04d1284e410ddaa75cf8cf25",
  image="redacted.com/popularsearches:42-16-ba6bd88",
  name="k8s_sync.5af8c3b4_popularsearches-web-3165456836-2bfey_popularsearches_6a291e48-47c4-11e6-84a4-c81f66bdf8bd_c02d3775"
} 72819

# AFTER
container_cpu_cfs_periods_total{
  container_name="sync",
  pod_name="popularsearches-web-3165456836-2bfey",
  namespace="popularsearches",
  id="/docker/68e1f15353921f4d6d4d998fa7293306c4ac828d04d1284e410ddaa75cf8cf25",
  image="redacted.com/popularsearches:42-16-ba6bd88",
  name="k8s_sync.5af8c3b4_popularsearches-web-3165456836-2bfey_popularsearches_6a291e48-47c4-11e6-84a4-c81f66bdf8bd_c02d3775"
} 72819
```

Feedback requested on:
* Label names. Other suggestions? Should we keep these very long ones?
* Do we need to export io.kubernetes.pod.uid? It makes working with the metrics a bit more complicated and the pod name is already unique at any time (but not over time). The UID is aslo part of `name`.

As discussed with @timstclair, this should be added to v1.4 as the current labels are harmful.

PTAL @jimmidyson @fabxc @vishh
2016-08-25 21:11:10 -07:00
.github issue-template: remove emoji suggestion 2016-08-14 22:07:43 +03:00
Godeps Update cAdvisor to d84e075 2016-08-22 19:01:12 -04:00
api/swagger-spec support Azure data disk volume 2016-08-23 13:23:07 +00:00
build Merge pull request #28717 from freehan/ebtable 2016-08-25 19:12:09 -07:00
cluster Merge pull request #28717 from freehan/ebtable 2016-08-25 19:12:09 -07:00
cmd Merge pull request #30902 from krousey/version_metric 2016-08-25 18:33:48 -07:00
contrib Merge pull request #30902 from krousey/version_metric 2016-08-25 18:33:48 -07:00
docs Moved runner to test-infra 2016-08-24 15:47:10 -07:00
examples return destroy func to clean up internal resources of storage 2016-08-25 08:32:21 -07:00
federation Merge pull request #31390 from hongchaodeng/fix 2016-08-25 16:44:10 -07:00
hack Merge pull request #31478 from david-mcmahon/fix-cache-gen 2016-08-25 18:33:52 -07:00
hooks Use make as the main build tool 2016-07-12 21:52:00 -07:00
logo Convert the font (ubuntu) to paths in SVG 2016-05-23 18:38:45 -07:00
pkg Merge pull request #31064 from soundcloud/grobie/filter-internal-labels 2016-08-25 21:11:10 -07:00
plugin Merge pull request #31122 from deads2k/add-quota-test 2016-08-25 08:21:50 -07:00
release Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
staging minor client-go doc change 2016-08-25 16:26:54 -07:00
test Merge pull request #30931 from Clarifai/ext-svc-ref-dns 2016-08-25 17:23:01 -07:00
third_party Merge pull request #28133 from freehan/e2ejunit 2016-07-09 01:55:07 -07:00
vendor Update cAdvisor to d84e075 2016-08-22 19:01:12 -04:00
www
.generated_docs update kubectl help output for better organization 2016-08-20 08:03:39 +08:00
.gitignore Do not ignore .drone.sec file 2016-08-18 13:50:50 -07:00
CHANGELOG.md Update CHANGELOG.md for v1.4.0-alpha.3. 2016-08-25 12:35:03 -07:00
CONTRIB.md Markdown files in root updated by update-generated-docs.sh. 2016-03-31 16:53:52 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md 2016-07-14 16:33:34 +03:00
DESIGN.md Markdown files in root updated by update-generated-docs.sh. 2016-03-31 16:53:52 -07:00
LICENSE Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Makefile Error if someone uses the sub-makefile directly 2016-08-22 15:26:08 -07:00
Makefile.generated_files Error if someone uses the sub-makefile directly 2016-08-22 15:26:08 -07:00
OWNERS Adding top-level OWNERS file. 2016-08-16 23:06:21 -07:00
README.md correcting mistakes 2016-07-21 11:26:01 +05:30
Vagrantfile added vagrant vsphere support 2016-03-30 22:55:08 +03:00
code-of-conduct.md code-of-conduct: provide concrete points of contact 2016-06-29 14:36:14 -07:00
labels.yaml Adding file to manage labels: issue #1423. 2016-07-28 21:12:07 -07:00

README.md

Kubernetes

Submit Queue Widget GoDoc Widget Coverage Status Widget

Are you ...

  • Interested in learning more about using Kubernetes? Please see our user-facing documentation on kubernetes.io
  • Interested in hacking on the core Kubernetes code base? Keep reading!

Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.

Kubernetes is:

  • lean: lightweight, simple, accessible
  • portable: public, private, hybrid, multi cloud
  • extensible: modular, pluggable, hookable, composable
  • self-healing: auto-placement, auto-restart, auto-replication

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale, combined with best-of-breed ideas and practices from the community.


Kubernetes is ready for Production!

With the 1.0.1 release Kubernetes is ready to serve your production workloads.

Kubernetes can run anywhere!

You can run Kubernetes on your local workstation under Vagrant, cloud providers (e.g. GCE, AWS, Azure), and physical hardware. Essentially, anywhere Linux runs you can run Kubernetes. Checkout the Getting Started Guides for details.

Concepts

Kubernetes works with the following concepts:

Cluster
A cluster is a set of physical or virtual machines and other infrastructure resources used by Kubernetes to run your applications. Kubernetes can run anywhere! See the Getting Started Guides for instructions for a variety of services.
Node
A node is a physical or virtual machine running Kubernetes, onto which pods can be scheduled.
Pod
Pods are a colocated group of application containers with shared volumes. They're the smallest deployable units that can be created, scheduled, and managed with Kubernetes. Pods can be created individually, but it's recommended that you use a replication controller even if creating a single pod.
Replication controller
Replication controllers manage the lifecycle of pods. They ensure that a specified number of pods are running at any given time, by creating or killing pods as required.
Service
Services provide a single, stable name and address for a set of pods. They act as basic load balancers.
Label
Labels are used to organize and select groups of objects based on key:value pairs.

Documentation

Kubernetes documentation is organized into several categories.

Community, discussion, contribution, and support

See which companies are committed to driving quality in Kubernetes on our community page.

Do you want to help "shape the evolution of technologies that are container packaged, dynamically scheduled and microservices oriented?"

You should consider joining the Cloud Native Computing Foundation. For details about who's involved and how Kubernetes plays a role, read their announcement.

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

Are you ready to add to the discussion?

We have presence on:

You can also view recordings of past events and presentations on our Media page.

For Q&A, our threads are at:

Want to contribute to Kubernetes?

If you're interested in being a contributor and want to get involved in developing Kubernetes, start in the Kubernetes Developer Guide and also review the contributor guidelines.

Support

While there are many different channels that you can use to get ahold of us, you can help make sure that we are efficient in getting you the help that you need.

If you need support, start with the troubleshooting guide and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another. We don't bite!

Community resources

You can find more projects, tools and articles related to Kubernetes on the awesome-kubernetes list. Add your project there and help us make it better.

Instructive & educational resources for the Kubernetes community. By the community.

  • Community Documentation

Here you can learn more about the current happenings in the kubernetes community.

Analytics