mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
commit
92e58c4f2b
@ -648,9 +648,6 @@ function kube::release::create_docker_images_for_server() {
|
||||
|
||||
kube::log::status "Deleting docker image ${docker_image_tag}"
|
||||
"${DOCKER[@]}" rmi ${docker_image_tag} 2>/dev/null || true
|
||||
|
||||
# Now, that we have created docker images we can safely delete raw binary.
|
||||
rm -f $1/${binary_name}
|
||||
) &
|
||||
done
|
||||
|
||||
|
@ -22,10 +22,6 @@ spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster:v0.14.3
|
||||
name: heapster
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 2.5Gi
|
||||
command:
|
||||
- /heapster
|
||||
- --source=kubernetes:''
|
||||
|
@ -22,10 +22,6 @@ spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster:v0.14.3
|
||||
name: heapster
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 2.5Gi
|
||||
command:
|
||||
- /heapster
|
||||
- --source=kubernetes:''
|
||||
|
@ -22,10 +22,6 @@ spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster:v0.14.3
|
||||
name: heapster
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 2.5Gi
|
||||
command:
|
||||
- /heapster
|
||||
- --source=kubernetes:''
|
||||
|
@ -22,10 +22,6 @@ spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster_influxdb:v0.3
|
||||
name: influxdb
|
||||
resources:
|
||||
limits:
|
||||
cpu: 300m
|
||||
memory: 2Gi
|
||||
ports:
|
||||
- containerPort: 8083
|
||||
hostPort: 8083
|
||||
|
@ -22,10 +22,6 @@ spec:
|
||||
containers:
|
||||
- image: gcr.io/google_containers/heapster:v0.14.3
|
||||
name: heapster
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 2.5Gi
|
||||
command:
|
||||
- /heapster
|
||||
- --source=kubernetes:''
|
||||
|
@ -109,7 +109,7 @@ Create a file named busybox.yaml with the
|
||||
following contents:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1beta3
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: busybox
|
||||
|
@ -1,12 +1,20 @@
|
||||
* Fri May 15 2015 Tim Hockin <thockin@google.com>
|
||||
- First Changelog entry
|
||||
- Current version is 1.4
|
||||
## Version 1.10 (Jun 19 2015 Tim Hockin <thockin@google.com>)
|
||||
- Fall back on service account tokens if no other auth is specified.
|
||||
|
||||
|
||||
## Version 1.9 (May 28 2015 Abhishek Shah <abshah@google.com>)
|
||||
- Add SRV support.
|
||||
|
||||
|
||||
## Version 1.8 (May 28 2015 Vishnu Kannan <vishnuk@google.com>)
|
||||
- Avoid making connections to the master insecure by default
|
||||
- Let users override the master URL in kubeconfig via a flag
|
||||
|
||||
|
||||
## Version 1.7 (May 25 2015 Vishnu Kannan <vishnuk@google.com>)
|
||||
- Adding support for headless services. All pods backing a headless service is addressible via DNS RR.
|
||||
- Adding support for headless services. All pods backing a headless service is
|
||||
addressible via DNS RR.
|
||||
|
||||
|
||||
## Version 1.8 (May 18 2015 Vishnu Kannan <vishnuk@google.com>)
|
||||
- Avoid making connections to the master insecure by default
|
||||
- Let users override the master URL in kubeconfig via a flag
|
||||
## Version 1.4 (Fri May 15 2015 Tim Hockin <thockin@google.com>)
|
||||
- First Changelog entry
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
.PHONY: all kube2sky container push clean test
|
||||
|
||||
TAG = 1.9
|
||||
TAG = 1.10
|
||||
PREFIX = gcr.io/google_containers
|
||||
|
||||
all: container
|
||||
|
@ -46,10 +46,11 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// TODO: switch to pflag and make - and _ equivalent.
|
||||
argDomain = flag.String("domain", "cluster.local", "domain under which to create names")
|
||||
argEtcdMutationTimeout = flag.Duration("etcd_mutation_timeout", 10*time.Second, "crash after retrying etcd mutation for a specified duration")
|
||||
argEtcdServer = flag.String("etcd-server", "http://127.0.0.1:4001", "URL to etcd server")
|
||||
argKubecfgFile = flag.String("kubecfg_file", "", "Location of kubecfg file for access to kubernetes service")
|
||||
argKubecfgFile = flag.String("kubecfg_file", "", "Location of kubecfg file for access to kubernetes master service; --kube_master_url overrides the URL part of this; if neither this nor --kube_master_url are provided, defaults to service account tokens")
|
||||
argKubeMasterURL = flag.String("kube_master_url", "", "URL to reach kubernetes master. Env variables in this flag will be expanded.")
|
||||
)
|
||||
|
||||
@ -405,7 +406,7 @@ func newEtcdClient(etcdServer string) (*etcd.Client, error) {
|
||||
return client, nil
|
||||
}
|
||||
|
||||
func getKubeMasterURL() (string, error) {
|
||||
func expandKubeMasterURL() (string, error) {
|
||||
parsedURL, err := url.Parse(os.ExpandEnv(*argKubeMasterURL))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to parse --kube_master_url %s - %v", *argKubeMasterURL, err)
|
||||
@ -423,31 +424,34 @@ func newKubeClient() (*kclient.Client, error) {
|
||||
err error
|
||||
masterURL string
|
||||
)
|
||||
// If the user specified --kube_master_url, expand env vars and verify it.
|
||||
if *argKubeMasterURL != "" {
|
||||
masterURL, err = getKubeMasterURL()
|
||||
masterURL, err = expandKubeMasterURL()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if *argKubecfgFile == "" {
|
||||
if masterURL == "" {
|
||||
return nil, fmt.Errorf("--kube_master_url must be set when --kubecfg_file is not set")
|
||||
}
|
||||
if masterURL != "" && *argKubecfgFile == "" {
|
||||
// Only --kube_master_url was provided.
|
||||
config = &kclient.Config{
|
||||
Host: masterURL,
|
||||
Version: "v1beta3",
|
||||
Version: "v1",
|
||||
}
|
||||
} else {
|
||||
// We either have:
|
||||
// 1) --kube_master_url and --kubecfg_file
|
||||
// 2) just --kubecfg_file
|
||||
// 3) neither flag
|
||||
// In any case, the logic is the same. If (3), this will automatically
|
||||
// fall back on the service account token.
|
||||
overrides := &kclientcmd.ConfigOverrides{}
|
||||
if masterURL != "" {
|
||||
overrides.ClusterInfo.Server = masterURL
|
||||
}
|
||||
if config, err = kclientcmd.NewNonInteractiveDeferredLoadingClientConfig(
|
||||
&kclientcmd.ClientConfigLoadingRules{ExplicitPath: *argKubecfgFile},
|
||||
overrides).ClientConfig(); err != nil {
|
||||
overrides.ClusterInfo.Server = masterURL // might be "", but that is OK
|
||||
rules := &kclientcmd.ClientConfigLoadingRules{ExplicitPath: *argKubecfgFile} // might be "", but that is OK
|
||||
if config, err = kclientcmd.NewNonInteractiveDeferredLoadingClientConfig(rules, overrides).ClientConfig(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
glog.Infof("Using %s for kubernetes master", config.Host)
|
||||
glog.Infof("Using kubernetes API %s", config.Version)
|
||||
return kclient.New(config)
|
||||
|
@ -1,21 +1,22 @@
|
||||
apiVersion: v1beta3
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: kube-dns-v3
|
||||
name: kube-dns-v4
|
||||
namespace: default
|
||||
labels:
|
||||
k8s-app: kube-dns-v3
|
||||
k8s-app: kube-dns
|
||||
version: v4
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
replicas: {{ pillar['dns_replicas'] }}
|
||||
selector:
|
||||
k8s-app: kube-dns
|
||||
version: v3
|
||||
version: v4
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
version: v3
|
||||
version: v4
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
containers:
|
||||
@ -30,15 +31,10 @@ spec:
|
||||
- -initial-cluster-token
|
||||
- skydns-etcd
|
||||
- name: kube2sky
|
||||
image: gcr.io/google_containers/kube2sky:1.9
|
||||
image: gcr.io/google_containers/kube2sky:1.10
|
||||
args:
|
||||
# command = "/kube2sky"
|
||||
- -domain={{ pillar['dns_domain'] }}
|
||||
- -kubecfg_file=/etc/dns_token/kubeconfig
|
||||
volumeMounts:
|
||||
- mountPath: /etc/dns_token
|
||||
name: dns-token
|
||||
readOnly: true
|
||||
- name: skydns
|
||||
image: gcr.io/google_containers/skydns:2015-03-11-001
|
||||
args:
|
||||
@ -58,11 +54,7 @@ spec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- nslookup kubernetes.default.{{ pillar['dns_domain'] }} localhost >/dev/null
|
||||
- nslookup kubernetes.default.svc.{{ pillar['dns_domain'] }} localhost >/dev/null
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 5
|
||||
dnsPolicy: Default # Don't use cluster DNS.
|
||||
volumes:
|
||||
- name: dns-token
|
||||
secret:
|
||||
secretName: token-system-dns
|
||||
|
@ -1,4 +1,4 @@
|
||||
apiVersion: v1beta3
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kube-dns
|
||||
@ -10,7 +10,7 @@ metadata:
|
||||
spec:
|
||||
selector:
|
||||
k8s-app: kube-dns
|
||||
portalIP: {{ pillar['dns_server'] }}
|
||||
clusterIP: {{ pillar['dns_server'] }}
|
||||
ports:
|
||||
- name: dns
|
||||
port: 53
|
||||
|
@ -156,13 +156,22 @@ const watchWaitDuration = 100 * time.Millisecond
|
||||
// and a versioner, the versioner must be able to handle the objects that transform creates.
|
||||
func newEtcdWatcher(list bool, include includeFunc, filter FilterFunc, encoding runtime.Codec, versioner EtcdVersioner, transform TransformFunc, cache etcdCache) *etcdWatcher {
|
||||
w := &etcdWatcher{
|
||||
encoding: encoding,
|
||||
versioner: versioner,
|
||||
transform: transform,
|
||||
list: list,
|
||||
include: include,
|
||||
filter: filter,
|
||||
etcdIncoming: make(chan *etcd.Response),
|
||||
encoding: encoding,
|
||||
versioner: versioner,
|
||||
transform: transform,
|
||||
list: list,
|
||||
include: include,
|
||||
filter: filter,
|
||||
// Buffer this channel, so that the etcd client is not forced
|
||||
// to context switch with every object it gets, and so that a
|
||||
// long time spent decoding an object won't block the *next*
|
||||
// object. Basically, we see a lot of "401 window exceeded"
|
||||
// errors from etcd, and that's due to the client not streaming
|
||||
// results but rather getting them one at a time. So we really
|
||||
// want to never block the etcd client, if possible. The 50 is
|
||||
// arbitrary; there's a V(4) log message that prints the length
|
||||
// so we can monitor how much of this buffer is actually used.
|
||||
etcdIncoming: make(chan *etcd.Response, 50),
|
||||
etcdError: make(chan error, 1),
|
||||
etcdStop: make(chan bool),
|
||||
outgoing: make(chan watch.Event),
|
||||
@ -250,6 +259,10 @@ func (w *etcdWatcher) translate() {
|
||||
return
|
||||
case res, ok := <-w.etcdIncoming:
|
||||
if ok {
|
||||
if curLen := len(w.etcdIncoming); curLen > 0 {
|
||||
// Monitor if this gets backed up, and how much.
|
||||
glog.V(4).Infof("watch: %v objects queued in channel.", curLen)
|
||||
}
|
||||
w.sendResult(res)
|
||||
}
|
||||
// If !ok, don't return here-- must wait for etcdError channel
|
||||
|
@ -36,8 +36,8 @@ package version
|
||||
var (
|
||||
// TODO: Deprecate gitMajor and gitMinor, use only gitVersion instead.
|
||||
gitMajor string = "0" // major version, always numeric
|
||||
gitMinor string = "20.0" // minor version, numeric possibly followed by "+"
|
||||
gitVersion string = "v0.20.0" // version from git, output of $(git describe)
|
||||
gitMinor string = "20.1+" // minor version, numeric possibly followed by "+"
|
||||
gitVersion string = "v0.20.1-dev" // version from git, output of $(git describe)
|
||||
gitCommit string = "" // sha1 from git, output of $(git rev-parse HEAD)
|
||||
gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user