Commit Graph

67 Commits

Author SHA1 Message Date
Shiming Zhang
582b492cc0 Pre-allocated memory 2021-06-01 15:19:44 +08:00
afrouz
27a99045e5 Migrate pkg/kubelet/config to structured logging
Co-authored-by: Shubheksha <shubheksha@users.noreply.github.com>

Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>

Co-authored-by: Elana Hashman <ehashman@users.noreply.github.com>
2021-03-11 14:58:38 +03:30
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
obitech
898c40a484 Fix golint failures in some pkg/kubelet packages
Fixed:
- pkg/kubelet/pod
- pkg/kubelet/metrics
- pkg/kubelet/configmap
- pkg/kubelet/config
2019-08-03 21:07:12 +02:00
Haiyan Meng
1f270ef4e2
Limit the read length of ioutil.ReadAll in pkg/kubelet and pkg/probe
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-07-11 13:18:06 -07:00
Yann Hodique
4d9c01d747 replace golang.org/x/exp/inotify with standalone library
The inotify code was removed from golang.org/x/exp several years ago. Therefore
importing it from that path prevents downstream consumers from using any module
that makes use of more recent features of golang.org/x/exp.

This change is a followup to google/cadvisor#2060 which was merged with #70889

This fixes #68478
2018-11-13 14:51:40 -08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
wojtekt
e50c0b904f Speed up cluster startup in GCE 2018-07-02 10:22:32 +02:00
Di Xu
6d14771fd8 ignore not found file error when watching manifests 2018-06-07 22:02:53 +08:00
wu8685
8c27779657 fix #40123: add a periodical polling to update pod config 2018-02-14 23:37:50 +08:00
chentao1596
c080b75617 remove unused input param 2017-12-28 17:05:59 +08:00
stewart-yu
3432741b80 [kubelet]fix unstandardized function name, rename new() to newSourceFile() 2017-12-21 09:13:34 +08:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
xiangpengzhao
a4e04bb633 Change log level for pod manifest 2017-07-25 19:05:32 +08:00
xiangpengzhao
55e045d9db Change pod config to manifest 2017-07-25 18:58:25 +08:00
Kubernetes Submit Queue
956acc2bd8 Merge pull request #47643 from CaoShuFeng/golang.org/x/exp/inotify
Automatic merge from submit-queue (batch tested with PRs 46336, 47643)

Fix invalid filename in kubelet log

Fixes: https://github.com/kubernetes/kubernetes/issues/47641
**Release note**:

```
NONE
```
2017-06-29 16:20:32 -07:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Cao Shufeng
4ee6b42a4d Fix invalid filename in kubelet log
Fixes: https://github.com/kubernetes/kubernetes/issues/47641
2017-06-22 09:45:21 +08:00
xiangpengzhao
4805252e0f Do not log the content of pod manifest if parsing fails. 2017-05-31 11:03:46 +08:00
deads2k
b0b156b381 make tools/cache authoritative 2017-01-25 08:29:45 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Chao Xu
bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu
5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
wu8685
4cedad1a9f fix issue #27137: kubelet detects pod manifest files in the directory using inotify 2016-09-28 10:34:56 +08:00
Justin Santa Barbara
54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Jan Chaloupka
4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
Yu-Ju Hong
a3e60cc32e Rename imported package local name kubeletTypes to kubetypes
According to the naming guidelines, package name should not include mixedCaps.
2015-10-09 10:24:31 -07:00
Yu-Ju Hong
098ab05997 kubelet: move common types to kubelet/types
This would faciliate tasks such as moving code in pkg/kubelet to sub packages.
2015-10-08 14:38:01 -07:00
liguangbo
4df68f03a3 change iff to if and only if to improve annotation readability 2015-09-16 08:29:36 +00:00
caogaojin
60cb4406e9 Cleanup deprecated Forever function
Since util.Forever function has been deprecated, we should cleanup these
pieces of code.
2015-08-24 10:31:59 +08:00
Kris Rousey
565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Justin Santa Barbara
dee8d4b90b For kubelet, differentiate between the nodeName and the hostname
This will allow us to use a nodeName that is not the hostname,
for example on clouds where the hostname is not the natural identifier
for a node.
2015-06-18 12:40:01 -07:00
Satnam Singh
e4f5529a2d Revert "Allow nodename to be != hostname, use AWS instance ID on AWS" 2015-06-18 11:27:55 -07:00
Justin Santa Barbara
c28cdfbd43 For kubelet, differentiate between the nodeName and the hostname
This will allow us to use a nodeName that is not the hostname,
for example on clouds where the hostname is not the natural identifier
for a node.
2015-06-17 00:40:43 -04:00
Kris
f4e2c738f6 Delete deprecated API versions
pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
2015-05-29 17:17:35 -07:00
Eric Paris
6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Kris Rousey
81497f3ed2 Changing the scheduler package to use *api.Pod instead of api.Pod to
avoid unnecessary shallow copies. The change rippled through a lot of
code.
2015-04-17 13:34:31 -07:00
Clayton Coleman
d020ca00b8 Pass hostname to all kubelet config sources instead of os.Hostname()
Make applyDefaults be tied to the current config source.
2015-03-23 15:58:45 -04:00
Wojciech Tyczynski
b395c40e19 Refactor pkg/kubelet/config 2015-03-23 10:29:46 +01:00
Wojciech Tyczynski
7a7e64331c Kubelet file read both ContainerManifest and Pod 2015-03-20 12:09:09 +01:00
Victor Marmol
ce96182cc3 Add SelfLink to Kubelet http source. 2015-03-18 16:38:41 -07:00
Yu-Ju Hong
929fb63b33 Sync static pods from Kubelet to the API server
Currently, API server is not aware of the static pods (manifests from
sources other than the API server, e.g. file and http) at all. This is
inconvenient since users cannot check the static pods through kubectl.
It is also sub-optimal because scheduler is unaware of the resource
consumption by these static pods on the node.

This change syncs the information back to the API server by creating a
mirror pod via API server for each static pod.

 - Kubelet creates containers for the static pod, as it would do
   normally.

 - If a mirror pod gets deleted, Kubelet will re-create one. The
   containers are sync'd to the static pods, so they will not be
   affected.

 - If a static pod gets removed from the source (e.g. manifest file
   removed from the directory), the orphaned mirror pod will be deleted.

Note that because events are associated with UID, and the mirror pod has
a different UID than the original static pod, the events will not be
shown for the mirror pod when running `kubectl describe pod
<mirror_pod>`.
2015-03-17 08:45:56 -07:00
Wojciech Tyczynski
5d95e9e671 Remove BoundPods from Kubelet 2015-03-16 19:17:21 +01:00
Clayton Coleman
0f87337667 Kubelet tests broken on Macs with uppercase names
Hostname behavior across operating systems is inconsistent (Macs can
have uppercase host names, so can some other systems).  In general,
always strings.ToLower(os.Hostname()).
2015-03-08 23:44:32 -04:00
Yu-Ju Hong
fe70be9261 kubelet: revamp the pod/container naming scheme
There are two main goals for this change.

 1. Fix the naming scheme in kubelet so that it accepts DNS subdomain
    name/namespaces correctly (#4920). The design is discussed in #3453.

 2. Prepare for syncing the static pods back to the apiserver(#4090). This
    includes

  - Eliminate the source component in the internal full pod name (#4922). Pods
    no longer need sources as they will all be sync'd via apiserver.

  - Changing the naming scheme for the static (file-, http-, and etcd-based)
    pods such that they are distinguishable when syncing back to the apiserver.

The changes includes:
  *	name = <pod.Name>-<hostname>
  * namespace = <cluster_namespace> (i.e. "default" for now).
  * container_name = k8s_<contianer_name>.<hash_of_container>_<pod_name>_<namespace>_<uid>_<random>

Note that this is not backward-compatible, meaning the kubelet won't recognize
existing running containers using the old naming scheme.
2015-03-06 13:14:45 -08:00
Tim Hockin
4ff2865cd1 Make kubelet's file source go through conversion
See comments for details.  Same problem exists in HTTP source, but I want to
float this for review first.
2015-01-22 13:10:59 -08:00
Dawn Chen
ec77507915 Generate pod.Name when pod.Name == "" for both HTTP and file sources.
Fix #3584
2015-01-22 12:53:30 -08:00