Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
988aa6fd
Commit
988aa6fd
authored
Jun 24, 2015
by
Brendan Burns
Committed by
Satnam Singh
Jul 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move things into a 'kube-system' namespace.
parent
c8f8e5f3
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
100 additions
and
56 deletions
+100
-56
heapster-controller.yaml
...addons/cluster-monitoring/google/heapster-controller.yaml
+1
-1
heapster-service.yaml
...er/addons/cluster-monitoring/google/heapster-service.yaml
+1
-0
heapster-controller-combined.yaml
...nitoring/googleinfluxdb/heapster-controller-combined.yaml
+1
-1
grafana-service.yaml
...r/addons/cluster-monitoring/influxdb/grafana-service.yaml
+1
-1
heapster-controller.yaml
...dons/cluster-monitoring/influxdb/heapster-controller.yaml
+1
-1
heapster-service.yaml
.../addons/cluster-monitoring/influxdb/heapster-service.yaml
+3
-2
influxdb-grafana-controller.yaml
...ster-monitoring/influxdb/influxdb-grafana-controller.yaml
+2
-2
influxdb-service.yaml
.../addons/cluster-monitoring/influxdb/influxdb-service.yaml
+1
-1
heapster-controller.yaml
...ns/cluster-monitoring/standalone/heapster-controller.yaml
+1
-1
heapster-service.yaml
...ddons/cluster-monitoring/standalone/heapster-service.yaml
+1
-0
skydns-rc.yaml.in
cluster/addons/dns/skydns-rc.yaml.in
+1
-1
skydns-svc.yaml.in
cluster/addons/dns/skydns-svc.yaml.in
+1
-1
es-controller.yaml
cluster/addons/fluentd-elasticsearch/es-controller.yaml
+2
-2
Makefile
cluster/addons/fluentd-elasticsearch/es-image/Makefile
+3
-2
elasticsearch_logging_discovery.go
...elasticsearch/es-image/elasticsearch_logging_discovery.go
+2
-2
es-service.yaml
cluster/addons/fluentd-elasticsearch/es-service.yaml
+1
-1
td-agent.conf
...dons/fluentd-elasticsearch/fluentd-es-image/td-agent.conf
+16
-1
kibana-controller.yaml
cluster/addons/fluentd-elasticsearch/kibana-controller.yaml
+1
-1
kibana-service.yaml
cluster/addons/fluentd-elasticsearch/kibana-service.yaml
+1
-1
kube-ui-rc.yaml
cluster/addons/kube-ui/kube-ui-rc.yaml
+1
-1
kube-ui-svc.yaml
cluster/addons/kube-ui/kube-ui-svc.yaml
+1
-1
fluentd-es.yaml
cluster/saltbase/salt/fluentd-es/fluentd-es.yaml
+1
-0
fluentd-gcp.yaml
cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml
+1
-0
init.sls
cluster/saltbase/salt/kube-addons/init.sls
+7
-0
kube-addons.sh
cluster/saltbase/salt/kube-addons/kube-addons.sh
+18
-9
namespace.yaml
cluster/saltbase/salt/kube-addons/namespace.yaml
+4
-0
limit-range.yaml
...salt/kube-admission-controls/limit-range/limit-range.yaml
+1
-0
types.go
pkg/api/types.go
+2
-0
clusterinfo.go
pkg/kubectl/cmd/clusterinfo.go
+3
-3
dns.go
test/e2e/dns.go
+7
-7
e2e_test.go
test/e2e/e2e_test.go
+1
-1
es_cluster_logging.go
test/e2e/es_cluster_logging.go
+8
-8
monitoring.go
test/e2e/monitoring.go
+4
-4
No files found.
cluster/addons/cluster-monitoring/google/heapster-controller.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
monitoring-heapster-v5
name
:
monitoring-heapster-v5
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
heapster
k8s-app
:
heapster
version
:
v5
version
:
v5
...
...
cluster/addons/cluster-monitoring/google/heapster-service.yaml
View file @
988aa6fd
...
@@ -2,6 +2,7 @@ kind: Service
...
@@ -2,6 +2,7 @@ kind: Service
apiVersion
:
v1
apiVersion
:
v1
metadata
:
metadata
:
name
:
monitoring-heapster
name
:
monitoring-heapster
namespace
:
kube-system
labels
:
labels
:
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/name
:
"
Heapster"
kubernetes.io/name
:
"
Heapster"
...
...
cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
monitoring-heapster-v5
name
:
monitoring-heapster-v5
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
heapster
k8s-app
:
heapster
version
:
v5
version
:
v5
...
...
cluster/addons/cluster-monitoring/influxdb/grafana-service.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
monitoring-grafana
name
:
monitoring-grafana
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/name
:
"
Grafana"
kubernetes.io/name
:
"
Grafana"
...
...
cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
monitoring-heapster-v5
name
:
monitoring-heapster-v5
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
heapster
k8s-app
:
heapster
version
:
v5
version
:
v5
...
...
cluster/addons/cluster-monitoring/influxdb/heapster-service.yaml
View file @
988aa6fd
kind
:
Service
kind
:
Service
apiVersion
:
v1
apiVersion
:
v1
metadata
:
metadata
:
name
:
monitoring-heapster
name
:
monitoring-heapster
labels
:
namespace
:
kube-system
labels
:
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/name
:
"
Heapster"
kubernetes.io/name
:
"
Heapster"
spec
:
spec
:
...
...
cluster/addons/cluster-monitoring/influxdb/influxdb-grafana-controller.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
monitoring-influx-grafana-v1
name
:
monitoring-influx-grafana-v1
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
influxGrafana
k8s-app
:
influxGrafana
version
:
v1
version
:
v1
...
@@ -42,7 +42,7 @@ spec:
...
@@ -42,7 +42,7 @@ spec:
memory
:
100Mi
memory
:
100Mi
env
:
env
:
-
name
:
INFLUXDB_EXTERNAL_URL
-
name
:
INFLUXDB_EXTERNAL_URL
value
:
/api/v1/proxy/namespaces/
default
/services/monitoring-influxdb:api/db/
value
:
/api/v1/proxy/namespaces/
kube-system
/services/monitoring-influxdb:api/db/
-
name
:
INFLUXDB_HOST
-
name
:
INFLUXDB_HOST
value
:
monitoring-influxdb
value
:
monitoring-influxdb
-
name
:
INFLUXDB_PORT
-
name
:
INFLUXDB_PORT
...
...
cluster/addons/cluster-monitoring/influxdb/influxdb-service.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
monitoring-influxdb
name
:
monitoring-influxdb
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/name
:
"
InfluxDB"
kubernetes.io/name
:
"
InfluxDB"
...
...
cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
monitoring-heapster-v5
name
:
monitoring-heapster-v5
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
heapster
k8s-app
:
heapster
version
:
v5
version
:
v5
...
...
cluster/addons/cluster-monitoring/standalone/heapster-service.yaml
View file @
988aa6fd
...
@@ -2,6 +2,7 @@ kind: Service
...
@@ -2,6 +2,7 @@ kind: Service
apiVersion
:
v1
apiVersion
:
v1
metadata
:
metadata
:
name
:
monitoring-heapster
name
:
monitoring-heapster
namespace
:
kube-system
labels
:
labels
:
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/name
:
"
Heapster"
kubernetes.io/name
:
"
Heapster"
...
...
cluster/addons/dns/skydns-rc.yaml.in
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind: ReplicationController
kind: ReplicationController
metadata:
metadata:
name: kube-dns-v5
name: kube-dns-v5
namespace:
default
namespace:
kube-system
labels:
labels:
k8s-app: kube-dns
k8s-app: kube-dns
version: v5
version: v5
...
...
cluster/addons/dns/skydns-svc.yaml.in
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
kind: Service
metadata:
metadata:
name: kube-dns
name: kube-dns
namespace:
default
namespace:
kube-system
labels:
labels:
k8s-app: kube-dns
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
kubernetes.io/cluster-service: "true"
...
...
cluster/addons/fluentd-elasticsearch/es-controller.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
elasticsearch-logging-v1
name
:
elasticsearch-logging-v1
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
elasticsearch-logging
k8s-app
:
elasticsearch-logging
version
:
v1
version
:
v1
...
@@ -20,7 +20,7 @@ spec:
...
@@ -20,7 +20,7 @@ spec:
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
spec
:
spec
:
containers
:
containers
:
-
image
:
gcr.io/google_containers/elasticsearch:1.
4
-
image
:
gcr.io/google_containers/elasticsearch:1.
5
name
:
elasticsearch-logging
name
:
elasticsearch-logging
resources
:
resources
:
limits
:
limits
:
...
...
cluster/addons/fluentd-elasticsearch/es-image/Makefile
View file @
988aa6fd
.PHONY
:
elasticsearch_logging_discovery build push
.PHONY
:
elasticsearch_logging_discovery build push
# Keep this one version ahead to help prevent accidental pushes.
# The current value of the tag to be used for building and
TAG
=
1.4
# pushing an image to gcr.io
TAG
=
1.5
build
:
elasticsearch_logging_discovery
build
:
elasticsearch_logging_discovery
docker build
-t
gcr.io/google_containers/elasticsearch:
$(TAG)
.
docker build
-t
gcr.io/google_containers/elasticsearch:
$(TAG)
.
...
...
cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go
View file @
988aa6fd
...
@@ -50,7 +50,7 @@ func main() {
...
@@ -50,7 +50,7 @@ func main() {
// Look for endpoints associated with the Elasticsearch loggging service.
// Look for endpoints associated with the Elasticsearch loggging service.
// First wait for the service to become available.
// First wait for the service to become available.
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
elasticsearch
,
err
=
c
.
Services
(
api
.
Namespace
Default
)
.
Get
(
"elasticsearch-logging"
)
elasticsearch
,
err
=
c
.
Services
(
api
.
Namespace
System
)
.
Get
(
"elasticsearch-logging"
)
if
err
==
nil
{
if
err
==
nil
{
break
break
}
}
...
@@ -67,7 +67,7 @@ func main() {
...
@@ -67,7 +67,7 @@ func main() {
// Wait for some endpoints.
// Wait for some endpoints.
count
:=
0
count
:=
0
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
endpoints
,
err
=
c
.
Endpoints
(
api
.
Namespace
Default
)
.
Get
(
"elasticsearch-logging"
)
endpoints
,
err
=
c
.
Endpoints
(
api
.
Namespace
System
)
.
Get
(
"elasticsearch-logging"
)
if
err
!=
nil
{
if
err
!=
nil
{
continue
continue
}
}
...
...
cluster/addons/fluentd-elasticsearch/es-service.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
elasticsearch-logging
name
:
elasticsearch-logging
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
elasticsearch-logging
k8s-app
:
elasticsearch-logging
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
...
...
cluster/addons/fluentd-elasticsearch/fluentd-es-image/td-agent.conf
View file @
988aa6fd
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
# The time_format specification below makes sure we properly
# The time_format specification below makes sure we properly
# parse the time format produced by Docker. This will be
# parse the time format produced by Docker. This will be
# submitted to Elasticsearch and should appear like:
# submitted to Elasticsearch and should appear like:
# $ curl 'http://elasticsearch-logging
.default
:9200/_search?pretty'
# $ curl 'http://elasticsearch-logging:9200/_search?pretty'
# ...
# ...
# {
# {
# "_index" : "logstash-2014.09.25",
# "_index" : "logstash-2014.09.25",
...
@@ -94,6 +94,21 @@
...
@@ -94,6 +94,21 @@
tag
docker
tag
docker
</
source
>
</
source
>
<
match
kubernetes
.**>
type
elasticsearch
log_level
info
include_tag_key
true
host
elasticsearch
-
logging
port
9200
logstash_format
true
flush_interval
5
s
# Never wait longer than 5 minutes between retries.
max_retry_wait
300
# Disable the limit on the number of retries (retry forever).
disable_retry_limit
</
match
>
>>>>>>>
Move
things
into
a
'kube-system'
namespace
.
<
source
>
<
source
>
type
tail
type
tail
format
none
format
none
...
...
cluster/addons/fluentd-elasticsearch/kibana-controller.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
kibana-logging-v1
name
:
kibana-logging-v1
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
kibana-logging
k8s-app
:
kibana-logging
version
:
v1
version
:
v1
...
...
cluster/addons/fluentd-elasticsearch/kibana-service.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
kibana-logging
name
:
kibana-logging
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
kibana-logging
k8s-app
:
kibana-logging
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
...
...
cluster/addons/kube-ui/kube-ui-rc.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
ReplicationController
kind
:
ReplicationController
metadata
:
metadata
:
name
:
kube-ui-v1
name
:
kube-ui-v1
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
kube-ui
k8s-app
:
kube-ui
version
:
v1
version
:
v1
...
...
cluster/addons/kube-ui/kube-ui-svc.yaml
View file @
988aa6fd
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
kube-ui
name
:
kube-ui
namespace
:
default
namespace
:
kube-system
labels
:
labels
:
k8s-app
:
kube-ui
k8s-app
:
kube-ui
kubernetes.io/cluster-service
:
"
true"
kubernetes.io/cluster-service
:
"
true"
...
...
cluster/saltbase/salt/fluentd-es/fluentd-es.yaml
View file @
988aa6fd
...
@@ -2,6 +2,7 @@ apiVersion: v1
...
@@ -2,6 +2,7 @@ apiVersion: v1
kind
:
Pod
kind
:
Pod
metadata
:
metadata
:
name
:
fluentd-elasticsearch
name
:
fluentd-elasticsearch
namespace
:
kube-system
spec
:
spec
:
containers
:
containers
:
-
name
:
fluentd-elasticsearch
-
name
:
fluentd-elasticsearch
...
...
cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml
View file @
988aa6fd
...
@@ -2,6 +2,7 @@ apiVersion: v1
...
@@ -2,6 +2,7 @@ apiVersion: v1
kind
:
Pod
kind
:
Pod
metadata
:
metadata
:
name
:
fluentd-cloud-logging
name
:
fluentd-cloud-logging
namespace
:
kube-system
spec
:
spec
:
containers
:
containers
:
-
name
:
fluentd-cloud-logging
-
name
:
fluentd-cloud-logging
...
...
cluster/saltbase/salt/kube-addons/init.sls
View file @
988aa6fd
...
@@ -11,6 +11,13 @@ addon-dir-create:
...
@@ -11,6 +11,13 @@ addon-dir-create:
- require:
- require:
- file: addon-dir-delete
- file: addon-dir-delete
/etc/kubernetes/addons/namespace.yaml:
file.managed:
- source: salt://kube-addons/namespace.yaml
- user: root
- group: root
- file_mode: 644
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'influxdb' %}
{% if pillar.get('enable_cluster_monitoring', '').lower() == 'influxdb' %}
/etc/kubernetes/addons/cluster-monitoring/influxdb:
/etc/kubernetes/addons/cluster-monitoring/influxdb:
file.recurse:
file.recurse:
...
...
cluster/saltbase/salt/kube-addons/kube-addons.sh
View file @
988aa6fd
...
@@ -21,6 +21,8 @@ KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl}
...
@@ -21,6 +21,8 @@ KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl}
ADDON_CHECK_INTERVAL_SEC
=
${
TEST_ADDON_CHECK_INTERVAL_SEC
:-
600
}
ADDON_CHECK_INTERVAL_SEC
=
${
TEST_ADDON_CHECK_INTERVAL_SEC
:-
600
}
SYSTEM_NAMESPACE
=
kube-system
function
create-kubeconfig-secret
()
{
function
create-kubeconfig-secret
()
{
local
-r
token
=
$1
local
-r
token
=
$1
local
-r
username
=
$2
local
-r
username
=
$2
...
@@ -47,6 +49,7 @@ contexts:
...
@@ -47,6 +49,7 @@ contexts:
- context:
- context:
cluster: local
cluster: local
user:
${
username
}
user:
${
username
}
namespace:
${
SYSTEM_NAMESPACE
}
name: service-account-context
name: service-account-context
current-context: service-account-context
current-context: service-account-context
EOF
EOF
...
@@ -67,6 +70,7 @@ contexts:
...
@@ -67,6 +70,7 @@ contexts:
- context:
- context:
cluster: local
cluster: local
user:
${
username
}
user:
${
username
}
namespace:
${
SYSTEM_NAMESPACE
}
name: service-account-context
name: service-account-context
current-context: service-account-context
current-context: service-account-context
EOF
EOF
...
@@ -82,36 +86,39 @@ metadata:
...
@@ -82,36 +86,39 @@ metadata:
name: token-
${
safe_username
}
name: token-
${
safe_username
}
type: Opaque
type: Opaque
EOF
EOF
create-resource-from-string
"
${
secretyaml
}
"
100 10
"Secret-for-token-for-user-
${
username
}
"
&
create-resource-from-string
"
${
secretyaml
}
"
100 10
"Secret-for-token-for-user-
${
username
}
"
"
${
SYSTEM_NAMESPACE
}
"
&
# TODO: label the secrets with special label so kubectl does not show these?
}
}
# $1 filename of addon to start.
# $1 filename of addon to start.
# $2 count of tries to start the addon.
# $2 count of tries to start the addon.
# $3 delay in seconds between two consecutive tries
# $3 delay in seconds between two consecutive tries
# $4 namespace
function
start_addon
()
{
function
start_addon
()
{
local
-r
addon_filename
=
$1
;
local
-r
addon_filename
=
$1
;
local
-r
tries
=
$2
;
local
-r
tries
=
$2
;
local
-r
delay
=
$3
;
local
-r
delay
=
$3
;
local
-r
namespace
=
$4
create-resource-from-string
"
$(
cat
${
addon_filename
})
"
"
${
tries
}
"
"
${
delay
}
"
"
${
addon_filename
}
"
create-resource-from-string
"
$(
cat
${
addon_filename
})
"
"
${
tries
}
"
"
${
delay
}
"
"
${
addon_filename
}
"
"
${
namespace
}
"
}
}
# $1 string with json or yaml.
# $1 string with json or yaml.
# $2 count of tries to start the addon.
# $2 count of tries to start the addon.
# $3 delay in seconds between two consecutive tries
# $3 delay in seconds between two consecutive tries
# $3 name of this object to use when logging about it.
# $4 name of this object to use when logging about it.
# $5 namespace for this object
function
create-resource-from-string
()
{
function
create-resource-from-string
()
{
local
-r
config_string
=
$1
;
local
-r
config_string
=
$1
;
local
tries
=
$2
;
local
tries
=
$2
;
local
-r
delay
=
$3
;
local
-r
delay
=
$3
;
local
-r
config_name
=
$4
;
local
-r
config_name
=
$4
;
local
-r
namespace
=
$5
;
while
[
${
tries
}
-gt
0
]
;
do
while
[
${
tries
}
-gt
0
]
;
do
echo
"
${
config_string
}
"
|
${
KUBECTL
}
create
-f
-
&&
\
echo
"
${
config_string
}
"
|
${
KUBECTL
}
--namespace
=
"
${
namespace
}
"
create
-f
-
&&
\
echo
"== Successfully started
${
config_name
}
at
$(
date
-Is
)
"
&&
\
echo
"== Successfully started
${
config_name
}
in namespace
${
namespace
}
at
$(
date
-Is
)
"
&&
\
return
0
;
return
0
;
let
tries
=
tries-1
;
let
tries
=
tries-1
;
echo
"== Failed to start
${
config_name
}
at
$(
date
-Is
)
.
${
tries
}
tries remaining. =="
echo
"== Failed to start
${
config_name
}
in namespace
${
namespace
}
at
$(
date
-Is
)
.
${
tries
}
tries remaining. =="
sleep
${
delay
}
;
sleep
${
delay
}
;
done
done
return
1
;
return
1
;
...
@@ -143,6 +150,8 @@ done
...
@@ -143,6 +150,8 @@ done
echo
"== default service account has token
${
token_found
}
=="
echo
"== default service account has token
${
token_found
}
=="
start_addon /etc/kubernetes/addons/namespace.yaml 100 10
""
&
# Generate secrets for "internal service accounts".
# Generate secrets for "internal service accounts".
# TODO(etune): move to a completely yaml/object based
# TODO(etune): move to a completely yaml/object based
# workflow so that service accounts can be created
# workflow so that service accounts can be created
...
@@ -162,7 +171,7 @@ while read line; do
...
@@ -162,7 +171,7 @@ while read line; do
else
else
# Set the server to https://kubernetes. Pods/components that
# Set the server to https://kubernetes. Pods/components that
# do not have DNS available will have to override the server.
# do not have DNS available will have to override the server.
create-kubeconfig-secret
"
${
token
}
"
"
${
username
}
"
"https://kubernetes"
create-kubeconfig-secret
"
${
token
}
"
"
${
username
}
"
"https://kubernetes
.default
"
fi
fi
done
< /srv/kubernetes/known_tokens.csv
done
< /srv/kubernetes/known_tokens.csv
...
@@ -170,7 +179,7 @@ done < /srv/kubernetes/known_tokens.csv
...
@@ -170,7 +179,7 @@ done < /srv/kubernetes/known_tokens.csv
# are defined in a namespace other than default, we should still create the limits for the
# are defined in a namespace other than default, we should still create the limits for the
# default namespace.
# default namespace.
for
obj
in
$(
find /etc/kubernetes/admission-controls
\(
-name
\*
.yaml
-o
-name
\*
.json
\)
)
;
do
for
obj
in
$(
find /etc/kubernetes/admission-controls
\(
-name
\*
.yaml
-o
-name
\*
.json
\)
)
;
do
start_addon
${
obj
}
100 10 &
start_addon
${
obj
}
100 10
default
&
echo
"++ obj
${
obj
}
is created ++"
echo
"++ obj
${
obj
}
is created ++"
done
done
...
...
cluster/saltbase/salt/kube-addons/namespace.yaml
0 → 100644
View file @
988aa6fd
apiVersion
:
v1
kind
:
Namespace
metadata
:
name
:
kube-system
cluster/saltbase/salt/kube-admission-controls/limit-range/limit-range.yaml
View file @
988aa6fd
...
@@ -2,6 +2,7 @@ apiVersion: "v1"
...
@@ -2,6 +2,7 @@ apiVersion: "v1"
kind
:
"
LimitRange"
kind
:
"
LimitRange"
metadata
:
metadata
:
name
:
"
limits"
name
:
"
limits"
namespace
:
default
spec
:
spec
:
limits
:
limits
:
-
type
:
"
Container"
-
type
:
"
Container"
...
...
pkg/api/types.go
View file @
988aa6fd
...
@@ -169,6 +169,8 @@ const (
...
@@ -169,6 +169,8 @@ const (
NamespaceAll
string
=
""
NamespaceAll
string
=
""
// NamespaceNone is the argument for a context when there is no namespace.
// NamespaceNone is the argument for a context when there is no namespace.
NamespaceNone
string
=
""
NamespaceNone
string
=
""
// NamespaceSystem is the system namespace where we place system components.
NamespaceSystem
string
=
"kube-system"
// TerminationMessagePathDefault means the default path to capture the application termination message running in a container
// TerminationMessagePathDefault means the default path to capture the application termination message running in a container
TerminationMessagePathDefault
string
=
"/dev/termination-log"
TerminationMessagePathDefault
string
=
"/dev/termination-log"
)
)
...
...
pkg/kubectl/cmd/clusterinfo.go
View file @
988aa6fd
...
@@ -57,9 +57,9 @@ func RunClusterInfo(factory *cmdutil.Factory, out io.Writer, cmd *cobra.Command)
...
@@ -57,9 +57,9 @@ func RunClusterInfo(factory *cmdutil.Factory, out io.Writer, cmd *cobra.Command)
printService
(
out
,
"Kubernetes master"
,
client
.
Host
)
printService
(
out
,
"Kubernetes master"
,
client
.
Host
)
mapper
,
typer
:=
factory
.
Object
()
mapper
,
typer
:=
factory
.
Object
()
cmdNamespace
,
_
,
err
:=
factory
.
DefaultNamespace
(
)
cmdNamespace
:=
cmdutil
.
GetFlagString
(
cmd
,
"namespace"
)
if
err
!=
nil
{
if
cmdNamespace
==
""
{
return
err
cmdNamespace
=
api
.
NamespaceSystem
}
}
// TODO use generalized labels once they are implemented (#341)
// TODO use generalized labels once they are implemented (#341)
...
...
test/e2e/dns.go
View file @
988aa6fd
...
@@ -188,20 +188,20 @@ var _ = Describe("DNS", func() {
...
@@ -188,20 +188,20 @@ var _ = Describe("DNS", func() {
// TODO: support DNS on vagrant #3580
// TODO: support DNS on vagrant #3580
SkipIfProviderIs
(
"vagrant"
)
SkipIfProviderIs
(
"vagrant"
)
podClient
:=
f
.
Client
.
Pods
(
api
.
NamespaceDefault
)
systemClient
:=
f
.
Client
.
Pods
(
api
.
NamespaceSystem
)
By
(
"Waiting for DNS Service to be Running"
)
By
(
"Waiting for DNS Service to be Running"
)
dnsPods
,
err
:=
pod
Client
.
List
(
dnsServiceLableSelector
,
fields
.
Everything
())
dnsPods
,
err
:=
system
Client
.
List
(
dnsServiceLableSelector
,
fields
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
Failf
(
"Failed to list all dns service pods"
)
Failf
(
"Failed to list all dns service pods"
)
}
}
if
len
(
dnsPods
.
Items
)
!=
1
{
if
len
(
dnsPods
.
Items
)
!=
1
{
Failf
(
"Unexpected number of pods (%d) matches the label selector %v"
,
len
(
dnsPods
.
Items
),
dnsServiceLableSelector
.
String
())
Failf
(
"Unexpected number of pods (%d) matches the label selector %v"
,
len
(
dnsPods
.
Items
),
dnsServiceLableSelector
.
String
())
}
}
expectNoError
(
waitForPodRunning
(
f
.
Client
,
dnsPods
.
Items
[
0
]
.
Name
))
expectNoError
(
waitForPodRunning
InNamespace
(
f
.
Client
,
dnsPods
.
Items
[
0
]
.
Name
,
api
.
NamespaceSystem
))
// All the names we need to be able to resolve.
// All the names we need to be able to resolve.
// TODO: Spin up a separate test service and test that dns works for that service.
// TODO: Spin up a separate test service and test that dns works for that service.
// TODO: Should these be changed to kubernetes.kube-system etc. ?
namesToResolve
:=
[]
string
{
namesToResolve
:=
[]
string
{
"kubernetes.default"
,
"kubernetes.default"
,
"kubernetes.default.svc"
,
"kubernetes.default.svc"
,
...
@@ -227,17 +227,17 @@ var _ = Describe("DNS", func() {
...
@@ -227,17 +227,17 @@ var _ = Describe("DNS", func() {
// TODO: support DNS on vagrant #3580
// TODO: support DNS on vagrant #3580
SkipIfProviderIs
(
"vagrant"
)
SkipIfProviderIs
(
"vagrant"
)
podClient
:=
f
.
Client
.
Pods
(
api
.
NamespaceDefault
)
systemClient
:=
f
.
Client
.
Pods
(
api
.
NamespaceSystem
)
By
(
"Waiting for DNS Service to be Running"
)
By
(
"Waiting for DNS Service to be Running"
)
dnsPods
,
err
:=
pod
Client
.
List
(
dnsServiceLableSelector
,
fields
.
Everything
())
dnsPods
,
err
:=
system
Client
.
List
(
dnsServiceLableSelector
,
fields
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
Failf
(
"Failed to list all dns service pods"
)
Failf
(
"Failed to list all dns service pods"
)
}
}
if
len
(
dnsPods
.
Items
)
!=
1
{
if
len
(
dnsPods
.
Items
)
!=
1
{
Failf
(
"Unexpected number of pods (%d) matches the label selector %v"
,
len
(
dnsPods
.
Items
),
dnsServiceLableSelector
.
String
())
Failf
(
"Unexpected number of pods (%d) matches the label selector %v"
,
len
(
dnsPods
.
Items
),
dnsServiceLableSelector
.
String
())
}
}
expectNoError
(
waitForPodRunning
(
f
.
Client
,
dnsPods
.
Items
[
0
]
.
Name
))
expectNoError
(
waitForPodRunning
InNamespace
(
f
.
Client
,
dnsPods
.
Items
[
0
]
.
Name
,
api
.
NamespaceSystem
))
// Create a test headless service.
// Create a test headless service.
By
(
"Creating a test headless service"
)
By
(
"Creating a test headless service"
)
...
...
test/e2e/e2e_test.go
View file @
988aa6fd
...
@@ -126,7 +126,7 @@ func TestE2E(t *testing.T) {
...
@@ -126,7 +126,7 @@ func TestE2E(t *testing.T) {
// cluster infrastructure pods that are being pulled or started can block
// cluster infrastructure pods that are being pulled or started can block
// test pods from running, and tests that ensure all pods are running and
// test pods from running, and tests that ensure all pods are running and
// ready will fail).
// ready will fail).
if
err
:=
waitForPodsRunningReady
(
api
.
Namespace
Default
,
testContext
.
MinStartupPods
,
podStartupTimeout
);
err
!=
nil
{
if
err
:=
waitForPodsRunningReady
(
api
.
Namespace
System
,
testContext
.
MinStartupPods
,
podStartupTimeout
);
err
!=
nil
{
t
.
Errorf
(
"Error waiting for all pods to be running and ready: %v"
,
err
)
t
.
Errorf
(
"Error waiting for all pods to be running and ready: %v"
,
err
)
return
return
}
}
...
...
test/e2e/es_cluster_logging.go
View file @
988aa6fd
...
@@ -70,7 +70,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -70,7 +70,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
// Check for the existence of the Elasticsearch service.
// Check for the existence of the Elasticsearch service.
By
(
"Checking the Elasticsearch service exists."
)
By
(
"Checking the Elasticsearch service exists."
)
s
:=
f
.
Client
.
Services
(
api
.
Namespace
Default
)
s
:=
f
.
Client
.
Services
(
api
.
Namespace
System
)
// Make a few attempts to connect. This makes the test robust against
// Make a few attempts to connect. This makes the test robust against
// being run as the first e2e test just after the e2e cluster has been created.
// being run as the first e2e test just after the e2e cluster has been created.
var
err
error
var
err
error
...
@@ -85,10 +85,10 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -85,10 +85,10 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
// Wait for the Elasticsearch pods to enter the running state.
// Wait for the Elasticsearch pods to enter the running state.
By
(
"Checking to make sure the Elasticsearch pods are running"
)
By
(
"Checking to make sure the Elasticsearch pods are running"
)
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
esKey
:
esValue
}))
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
esKey
:
esValue
}))
pods
,
err
:=
f
.
Client
.
Pods
(
api
.
Namespace
Default
)
.
List
(
label
,
fields
.
Everything
())
pods
,
err
:=
f
.
Client
.
Pods
(
api
.
Namespace
System
)
.
List
(
label
,
fields
.
Everything
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
_
,
pod
:=
range
pods
.
Items
{
for
_
,
pod
:=
range
pods
.
Items
{
err
=
waitForPodRunning
(
f
.
Client
,
pod
.
Name
)
err
=
waitForPodRunning
InNamespace
(
f
.
Client
,
pod
.
Name
,
api
.
NamespaceSystem
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
}
...
@@ -100,7 +100,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -100,7 +100,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
5
*
time
.
Second
)
{
// Query against the root URL for Elasticsearch.
// Query against the root URL for Elasticsearch.
body
,
err
:=
f
.
Client
.
Get
()
.
body
,
err
:=
f
.
Client
.
Get
()
.
Namespace
(
api
.
Namespace
Default
)
.
Namespace
(
api
.
Namespace
System
)
.
Prefix
(
"proxy"
)
.
Prefix
(
"proxy"
)
.
Resource
(
"services"
)
.
Resource
(
"services"
)
.
Name
(
"elasticsearch-logging"
)
.
Name
(
"elasticsearch-logging"
)
.
...
@@ -146,7 +146,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -146,7 +146,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
var
body
[]
byte
var
body
[]
byte
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
5
*
time
.
Second
)
{
body
,
err
=
f
.
Client
.
Get
()
.
body
,
err
=
f
.
Client
.
Get
()
.
Namespace
(
api
.
Namespace
Default
)
.
Namespace
(
api
.
Namespace
System
)
.
Prefix
(
"proxy"
)
.
Prefix
(
"proxy"
)
.
Resource
(
"services"
)
.
Resource
(
"services"
)
.
Name
(
"elasticsearch-logging"
)
.
Name
(
"elasticsearch-logging"
)
.
...
@@ -188,7 +188,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -188,7 +188,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
return
isNodeReadySetAsExpected
(
&
node
,
true
)
return
isNodeReadySetAsExpected
(
&
node
,
true
)
})
})
if
len
(
nodes
.
Items
)
<
2
{
if
len
(
nodes
.
Items
)
<
2
{
Failf
(
"Less than two nodes were found Ready
."
)
Failf
(
"Less than two nodes were found Ready
: %d"
,
len
(
nodes
.
Items
)
)
}
}
Logf
(
"Found %d healthy nodes."
,
len
(
nodes
.
Items
))
Logf
(
"Found %d healthy nodes."
,
len
(
nodes
.
Items
))
...
@@ -257,7 +257,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -257,7 +257,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
ingestionTimeout
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
ingestionTimeout
;
time
.
Sleep
(
10
*
time
.
Second
)
{
// Debugging code to report the status of the elasticsearch logging endpoints.
// Debugging code to report the status of the elasticsearch logging endpoints.
esPods
,
err
:=
f
.
Client
.
Pods
(
api
.
Namespace
Default
)
.
List
(
labels
.
Set
{
esKey
:
esValue
}
.
AsSelector
(),
fields
.
Everything
())
esPods
,
err
:=
f
.
Client
.
Pods
(
api
.
Namespace
System
)
.
List
(
labels
.
Set
{
esKey
:
esValue
}
.
AsSelector
(),
fields
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
Logf
(
"Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v"
,
err
)
Logf
(
"Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v"
,
err
)
continue
continue
...
@@ -272,7 +272,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -272,7 +272,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
// verison of the name. Ask for twice as many log lines as we expect to check for
// verison of the name. Ask for twice as many log lines as we expect to check for
// duplication bugs.
// duplication bugs.
body
,
err
=
f
.
Client
.
Get
()
.
body
,
err
=
f
.
Client
.
Get
()
.
Namespace
(
api
.
Namespace
Default
)
.
Namespace
(
api
.
Namespace
System
)
.
Prefix
(
"proxy"
)
.
Prefix
(
"proxy"
)
.
Resource
(
"services"
)
.
Resource
(
"services"
)
.
Name
(
"elasticsearch-logging"
)
.
Name
(
"elasticsearch-logging"
)
.
...
...
test/e2e/monitoring.go
View file @
988aa6fd
...
@@ -78,7 +78,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
...
@@ -78,7 +78,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
// situaiton when a heapster-monitoring-v1 and heapster-monitoring-v2 replication controller
// situaiton when a heapster-monitoring-v1 and heapster-monitoring-v2 replication controller
// is running (which would be an error except during a rolling update).
// is running (which would be an error except during a rolling update).
for
_
,
rcLabel
:=
range
rcLabels
{
for
_
,
rcLabel
:=
range
rcLabels
{
rcList
,
err
:=
c
.
ReplicationControllers
(
api
.
Namespace
Default
)
.
List
(
labels
.
Set
{
"k8s-app"
:
rcLabel
}
.
AsSelector
())
rcList
,
err
:=
c
.
ReplicationControllers
(
api
.
Namespace
System
)
.
List
(
labels
.
Set
{
"k8s-app"
:
rcLabel
}
.
AsSelector
())
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -87,7 +87,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
...
@@ -87,7 +87,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
rcLabel
,
len
(
rcList
.
Items
))
rcLabel
,
len
(
rcList
.
Items
))
}
}
for
_
,
rc
:=
range
rcList
.
Items
{
for
_
,
rc
:=
range
rcList
.
Items
{
podList
,
err
:=
c
.
Pods
(
api
.
Namespace
Default
)
.
List
(
labels
.
Set
(
rc
.
Spec
.
Selector
)
.
AsSelector
(),
fields
.
Everything
())
podList
,
err
:=
c
.
Pods
(
api
.
Namespace
System
)
.
List
(
labels
.
Set
(
rc
.
Spec
.
Selector
)
.
AsSelector
(),
fields
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -100,7 +100,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
...
@@ -100,7 +100,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
}
}
func
expectedServicesExist
(
c
*
client
.
Client
)
error
{
func
expectedServicesExist
(
c
*
client
.
Client
)
error
{
serviceList
,
err
:=
c
.
Services
(
api
.
Namespace
Default
)
.
List
(
labels
.
Everything
())
serviceList
,
err
:=
c
.
Services
(
api
.
Namespace
System
)
.
List
(
labels
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -205,7 +205,7 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) {
...
@@ -205,7 +205,7 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) {
if
!
ok
{
if
!
ok
{
Failf
(
"failed to get master http client"
)
Failf
(
"failed to get master http client"
)
}
}
proxyUrl
:=
fmt
.
Sprintf
(
"%s/api/v1/proxy/namespaces/
default/services/%s:api/"
,
getMasterHost
()
,
influxdbService
)
proxyUrl
:=
fmt
.
Sprintf
(
"%s/api/v1/proxy/namespaces/
%s/services/%s:api/"
,
getMasterHost
(),
api
.
NamespaceSystem
,
influxdbService
)
config
:=
&
influxdb
.
ClientConfig
{
config
:=
&
influxdb
.
ClientConfig
{
Host
:
proxyUrl
,
Host
:
proxyUrl
,
// TODO(vishh): Infer username and pw from the Pod spec.
// TODO(vishh): Infer username and pw from the Pod spec.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment