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
a8bf90f8
Commit
a8bf90f8
authored
Sep 26, 2017
by
Marcin Maciaszczyk
Committed by
maciaszczykm
Nov 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Dashboard add-on to version 1.8.0
parent
24042ce6
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
115 additions
and
28 deletions
+115
-28
README.md
cluster/addons/dashboard/README.md
+0
-1
dashboard-configmap.yaml
cluster/addons/dashboard/dashboard-configmap.yaml
+9
-0
dashboard-controller.yaml
cluster/addons/dashboard/dashboard-controller.yaml
+29
-5
dashboard-rbac.yaml
cluster/addons/dashboard/dashboard-rbac.yaml
+45
-0
dashboard-secret.yaml
cluster/addons/dashboard/dashboard-secret.yaml
+10
-0
dashboard-service.yaml
cluster/addons/dashboard/dashboard-service.yaml
+2
-2
deployAddons.sh
cluster/centos/deployAddons.sh
+6
-12
local-up-cluster.sh
hack/local-up-cluster.sh
+5
-2
ui.go
pkg/routes/ui.go
+1
-1
BUILD
test/e2e/ui/BUILD
+1
-0
dashboard.go
test/e2e/ui/dashboard.go
+7
-5
No files found.
cluster/addons/dashboard/README.md
View file @
a8bf90f8
# Kubernetes Dashboard
==============
Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters.
It allows users to manage applications running in the cluster, troubleshoot them,
...
...
cluster/addons/dashboard/dashboard-configmap.yaml
0 → 100644
View file @
a8bf90f8
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
labels
:
k8s-app
:
kubernetes-dashboard
# Allows editing resource and makes sure it is created first.
addonmanager.kubernetes.io/mode
:
EnsureExists
name
:
kubernetes-dashboard-settings
namespace
:
kube-system
cluster/addons/dashboard/dashboard-controller.yaml
View file @
a8bf90f8
apiVersion
:
extensions/v1beta1
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
labels
:
k8s-app
:
kubernetes-dashboard
addonmanager.kubernetes.io/mode
:
Reconcile
name
:
kubernetes-dashboard
namespace
:
kube-system
---
apiVersion
:
apps/v1beta2
kind
:
Deployment
metadata
:
name
:
kubernetes-dashboard
...
...
@@ -20,9 +29,8 @@ spec:
spec
:
containers
:
-
name
:
kubernetes-dashboard
image
:
gcr.io/google_containers/kubernetes-dashboard-amd64:v1.
6.3
image
:
gcr.io/google_containers/kubernetes-dashboard-amd64:v1.
8.0
resources
:
# keep request = limit to keep this container in guaranteed class
limits
:
cpu
:
100m
memory
:
300Mi
...
...
@@ -30,13 +38,29 @@ spec:
cpu
:
100m
memory
:
100Mi
ports
:
-
containerPort
:
9090
-
containerPort
:
8443
protocol
:
TCP
args
:
-
--auto-generate-certificates
volumeMounts
:
-
name
:
kubernetes-dashboard-certs
mountPath
:
/certs
-
name
:
tmp-volume
mountPath
:
/tmp
livenessProbe
:
httpGet
:
scheme
:
HTTPS
path
:
/
port
:
9090
port
:
8443
initialDelaySeconds
:
30
timeoutSeconds
:
30
volumes
:
-
name
:
kubernetes-dashboard-certs
secret
:
secretName
:
kubernetes-dashboard-certs
-
name
:
tmp-volume
emptyDir
:
{}
serviceAccountName
:
kubernetes-dashboard
tolerations
:
-
key
:
"
CriticalAddonsOnly"
operator
:
"
Exists"
cluster/addons/dashboard/dashboard-rbac.yaml
0 → 100644
View file @
a8bf90f8
kind
:
Role
apiVersion
:
rbac.authorization.k8s.io/v1
metadata
:
labels
:
k8s-app
:
kubernetes-dashboard
addonmanager.kubernetes.io/mode
:
Reconcile
name
:
kubernetes-dashboard-minimal
namespace
:
kube-system
rules
:
# Allow Dashboard to create 'kubernetes-dashboard-key-holder' secret.
-
apiGroups
:
[
"
"
]
resources
:
[
"
secrets"
]
verbs
:
[
"
create"
]
# Allow Dashboard to get, update and delete Dashboard exclusive secrets.
-
apiGroups
:
[
"
"
]
resources
:
[
"
secrets"
]
resourceNames
:
[
"
kubernetes-dashboard-key-holder"
,
"
kubernetes-dashboard-certs"
]
verbs
:
[
"
get"
,
"
update"
,
"
delete"
]
# Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
-
apiGroups
:
[
"
"
]
resources
:
[
"
configmaps"
]
resourceNames
:
[
"
kubernetes-dashboard-settings"
]
verbs
:
[
"
get"
,
"
update"
]
# Allow Dashboard to get metrics from heapster.
-
apiGroups
:
[
"
"
]
resources
:
[
"
services"
]
resourceNames
:
[
"
heapster"
]
verbs
:
[
"
proxy"
]
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
RoleBinding
metadata
:
name
:
kubernetes-dashboard-minimal
namespace
:
kube-system
labels
:
k8s-app
:
kubernetes-dashboard
addonmanager.kubernetes.io/mode
:
Reconcile
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
Role
name
:
kubernetes-dashboard-minimal
subjects
:
-
kind
:
ServiceAccount
name
:
kubernetes-dashboard
namespace
:
kube-system
cluster/addons/dashboard/dashboard-secret.yaml
0 → 100644
View file @
a8bf90f8
apiVersion
:
v1
kind
:
Secret
metadata
:
labels
:
k8s-app
:
kubernetes-dashboard
# Allows editing resource and makes sure it is created first.
addonmanager.kubernetes.io/mode
:
EnsureExists
name
:
kubernetes-dashboard-certs
namespace
:
kube-system
type
:
Opaque
cluster/addons/dashboard/dashboard-service.yaml
View file @
a8bf90f8
...
...
@@ -11,5 +11,5 @@ spec:
selector
:
k8s-app
:
kubernetes-dashboard
ports
:
-
port
:
80
targetPort
:
9090
-
port
:
443
targetPort
:
8443
cluster/centos/deployAddons.sh
View file @
a8bf90f8
...
...
@@ -45,19 +45,13 @@ function deploy_dns {
}
function
deploy_dashboard
{
if
${
KUBECTL
}
get rc
-l
k8s-app
=
kubernetes-dashboard
--namespace
=
kube-system |
grep
kubernetes-dashboard-v &> /dev/null
;
then
echo
"Kubernetes Dashboard replicationController already exists"
else
echo
"Creating Kubernetes Dashboard replicationController"
${
KUBECTL
}
create
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-controller.yaml
fi
echo
"Deploying Kubernetes Dashboard"
if
${
KUBECTL
}
get service/kubernetes-dashboard
--namespace
=
kube-system &> /dev/null
;
then
echo
"Kubernetes Dashboard service already exists"
else
echo
"Creating Kubernetes Dashboard service"
${
KUBECTL
}
create
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-service.yaml
fi
${
KUBECTL
}
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-secret.yaml
${
KUBECTL
}
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-configmap.yaml
${
KUBECTL
}
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-rbac.yaml
${
KUBECTL
}
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-controller.yaml
${
KUBECTL
}
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-service.yaml
echo
}
...
...
hack/local-up-cluster.sh
View file @
a8bf90f8
...
...
@@ -792,8 +792,11 @@ function start_kubedashboard {
if
[[
"
${
ENABLE_CLUSTER_DASHBOARD
}
"
=
true
]]
;
then
echo
"Creating kubernetes-dashboard"
# use kubectl to create the dashboard
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
create
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-controller.yaml
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
create
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-service.yaml
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-secret.yaml
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-configmap.yaml
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-rbac.yaml
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-controller.yaml
${
KUBECTL
}
--kubeconfig
=
"
${
CERT_DIR
}
/admin.kubeconfig"
apply
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-service.yaml
echo
"kubernetes-dashboard deployment and service successfully deployed."
fi
}
...
...
pkg/routes/ui.go
View file @
a8bf90f8
...
...
@@ -22,7 +22,7 @@ import (
"k8s.io/apiserver/pkg/server/mux"
)
const
dashboardPath
=
"/api/v1/namespaces/kube-system/services/
kubernetes-dashboard/proxy
"
const
dashboardPath
=
"/api/v1/namespaces/kube-system/services/
https:kubernetes-dashboard:/proxy/
"
// UIRedirect redirects /ui to the kube-ui proxy path.
type
UIRedirect
struct
{}
...
...
test/e2e/ui/BUILD
View file @
a8bf90f8
...
...
@@ -15,6 +15,7 @@ go_library(
"//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
],
)
...
...
test/e2e/ui/dashboard.go
View file @
a8bf90f8
...
...
@@ -23,6 +23,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
utilnet
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
testutils
"k8s.io/kubernetes/test/utils"
...
...
@@ -36,6 +37,7 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
uiServiceName
=
"kubernetes-dashboard"
uiAppName
=
uiServiceName
uiNamespace
=
metav1
.
NamespaceSystem
uiRedirect
=
"/ui"
serverStartTimeout
=
1
*
time
.
Minute
)
...
...
@@ -63,20 +65,20 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
framework
.
SingleCallTimeout
)
defer
cancel
()
// Query against the proxy URL for the kube
-ui
service.
// Query against the proxy URL for the kube
rnetes-dashboard
service.
err
:=
proxyRequest
.
Namespace
(
uiNamespace
)
.
Context
(
ctx
)
.
Name
(
u
iServiceName
)
.
Name
(
u
tilnet
.
JoinSchemeNamePort
(
"https"
,
uiServiceName
,
""
)
)
.
Timeout
(
framework
.
SingleCallTimeout
)
.
Do
()
.
StatusCode
(
&
status
)
.
Error
()
if
err
!=
nil
{
if
ctx
.
Err
()
!=
nil
{
framework
.
Failf
(
"Request to kube
-ui
failed: %v"
,
err
)
framework
.
Failf
(
"Request to kube
rnetes-dashboard
failed: %v"
,
err
)
return
true
,
err
}
framework
.
Logf
(
"Request to kube
-ui
failed: %v"
,
err
)
framework
.
Logf
(
"Request to kube
rnetes-dashboard
failed: %v"
,
err
)
}
else
if
status
!=
http
.
StatusOK
{
framework
.
Logf
(
"Unexpected status from kubernetes-dashboard: %v"
,
status
)
}
...
...
@@ -88,7 +90,7 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
By
(
"Checking that the ApiServer /ui endpoint redirects to a valid server."
)
var
status
int
err
=
f
.
ClientSet
.
CoreV1
()
.
RESTClient
()
.
Get
()
.
AbsPath
(
"/ui"
)
.
AbsPath
(
uiRedirect
)
.
Timeout
(
framework
.
SingleCallTimeout
)
.
Do
()
.
StatusCode
(
&
status
)
.
...
...
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