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
47a94637
Commit
47a94637
authored
Nov 05, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move metrics-server manifests to sub-directory
parent
2b760d5e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
151 additions
and
144 deletions
+151
-144
metrics-server.yaml
manifests/metrics-server.yaml
+0
-135
aggregated-metrics-reader.yaml
manifests/metrics-server/aggregated-metrics-reader.yaml
+12
-0
auth-delegator.yaml
manifests/metrics-server/auth-delegator.yaml
+13
-0
auth-reader.yaml
manifests/metrics-server/auth-reader.yaml
+14
-0
metrics-apiservice.yaml
manifests/metrics-server/metrics-apiservice.yaml
+14
-0
metrics-server-deployment.yaml
manifests/metrics-server/metrics-server-deployment.yaml
+36
-0
metrics-server-service.yaml
manifests/metrics-server/metrics-server-service.yaml
+16
-0
resource-reader.yaml
manifests/metrics-server/resource-reader.yaml
+30
-0
server.go
pkg/cli/server/server.go
+0
-4
main.go
pkg/codegen/main.go
+2
-1
stage.go
pkg/deploy/stage.go
+14
-4
No files found.
manifests/metrics-server.yaml
deleted
100644 → 0
View file @
2b760d5e
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRole
metadata
:
name
:
system:metrics-server
rules
:
-
apiGroups
:
-
"
"
resources
:
-
pods
-
nodes
-
nodes/stats
-
namespaces
verbs
:
-
get
-
list
-
watch
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRoleBinding
metadata
:
name
:
system:metrics-server
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
ClusterRole
name
:
system:metrics-server
subjects
:
-
kind
:
ServiceAccount
name
:
metrics-server
namespace
:
kube-system
---
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
RoleBinding
metadata
:
name
:
metrics-server-auth-reader
namespace
:
kube-system
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
Role
name
:
extension-apiserver-authentication-reader
subjects
:
-
kind
:
ServiceAccount
name
:
metrics-server
namespace
:
kube-system
---
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
ClusterRoleBinding
metadata
:
name
:
metrics-server:system:auth-delegator
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
ClusterRole
name
:
system:auth-delegator
subjects
:
-
kind
:
ServiceAccount
name
:
metrics-server
namespace
:
kube-system
---
kind
:
ClusterRole
apiVersion
:
rbac.authorization.k8s.io/v1
metadata
:
name
:
system:aggregated-metrics-reader
labels
:
rbac.authorization.k8s.io/aggregate-to-view
:
"
true"
rbac.authorization.k8s.io/aggregate-to-edit
:
"
true"
rbac.authorization.k8s.io/aggregate-to-admin
:
"
true"
rules
:
-
apiGroups
:
[
"
metrics.k8s.io"
]
resources
:
[
"
pods"
,
"
nodes"
]
verbs
:
[
"
get"
,
"
list"
,
"
watch"
]
---
apiVersion
:
apiregistration.k8s.io/v1beta1
kind
:
APIService
metadata
:
name
:
v1beta1.metrics.k8s.io
spec
:
service
:
name
:
metrics-server
namespace
:
kube-system
group
:
metrics.k8s.io
version
:
v1beta1
insecureSkipTLSVerify
:
true
groupPriorityMinimum
:
100
versionPriority
:
100
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
metrics-server
namespace
:
kube-system
labels
:
kubernetes.io/name
:
"
Metrics-server"
kubernetes.io/cluster-service
:
"
true"
spec
:
selector
:
k8s-app
:
metrics-server
ports
:
-
port
:
443
protocol
:
TCP
targetPort
:
443
---
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
metrics-server
namespace
:
kube-system
---
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
metrics-server
namespace
:
kube-system
labels
:
k8s-app
:
metrics-server
spec
:
selector
:
matchLabels
:
k8s-app
:
metrics-server
template
:
metadata
:
name
:
metrics-server
labels
:
k8s-app
:
metrics-server
spec
:
serviceAccountName
:
metrics-server
volumes
:
# mount in tmp so we can safely use from-scratch images and/or read-only containers
-
name
:
tmp-dir
emptyDir
:
{}
containers
:
-
name
:
metrics-server
image
:
rancher/metrics-server:v0.3.6
volumeMounts
:
-
name
:
tmp-dir
mountPath
:
/tmp
manifests/metrics-server/aggregated-metrics-reader.yaml
0 → 100644
View file @
47a94637
kind
:
ClusterRole
apiVersion
:
rbac.authorization.k8s.io/v1
metadata
:
name
:
system:aggregated-metrics-reader
labels
:
rbac.authorization.k8s.io/aggregate-to-view
:
"
true"
rbac.authorization.k8s.io/aggregate-to-edit
:
"
true"
rbac.authorization.k8s.io/aggregate-to-admin
:
"
true"
rules
:
-
apiGroups
:
[
"
metrics.k8s.io"
]
resources
:
[
"
pods"
,
"
nodes"
]
verbs
:
[
"
get"
,
"
list"
,
"
watch"
]
manifests/metrics-server/auth-delegator.yaml
0 → 100644
View file @
47a94637
---
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
ClusterRoleBinding
metadata
:
name
:
metrics-server:system:auth-delegator
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
ClusterRole
name
:
system:auth-delegator
subjects
:
-
kind
:
ServiceAccount
name
:
metrics-server
namespace
:
kube-system
manifests/metrics-server/auth-reader.yaml
0 → 100644
View file @
47a94637
---
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
RoleBinding
metadata
:
name
:
metrics-server-auth-reader
namespace
:
kube-system
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
Role
name
:
extension-apiserver-authentication-reader
subjects
:
-
kind
:
ServiceAccount
name
:
metrics-server
namespace
:
kube-system
manifests/metrics-server/metrics-apiservice.yaml
0 → 100644
View file @
47a94637
---
apiVersion
:
apiregistration.k8s.io/v1beta1
kind
:
APIService
metadata
:
name
:
v1beta1.metrics.k8s.io
spec
:
service
:
name
:
metrics-server
namespace
:
kube-system
group
:
metrics.k8s.io
version
:
v1beta1
insecureSkipTLSVerify
:
true
groupPriorityMinimum
:
100
versionPriority
:
100
manifests/metrics-server/metrics-server-deployment.yaml
0 → 100644
View file @
47a94637
---
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
metrics-server
namespace
:
kube-system
---
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
metrics-server
namespace
:
kube-system
labels
:
k8s-app
:
metrics-server
spec
:
selector
:
matchLabels
:
k8s-app
:
metrics-server
template
:
metadata
:
name
:
metrics-server
labels
:
k8s-app
:
metrics-server
spec
:
serviceAccountName
:
metrics-server
volumes
:
# mount in tmp so we can safely use from-scratch images and/or read-only containers
-
name
:
tmp-dir
emptyDir
:
{}
containers
:
-
name
:
metrics-server
image
:
rancher/metrics-server:v0.3.6
volumeMounts
:
-
name
:
tmp-dir
mountPath
:
/tmp
manifests/metrics-server/metrics-server-service.yaml
0 → 100644
View file @
47a94637
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
metrics-server
namespace
:
kube-system
labels
:
kubernetes.io/name
:
"
Metrics-server"
kubernetes.io/cluster-service
:
"
true"
spec
:
selector
:
k8s-app
:
metrics-server
ports
:
-
port
:
443
protocol
:
TCP
targetPort
:
443
manifests/metrics-server/resource-reader.yaml
0 → 100644
View file @
47a94637
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRole
metadata
:
name
:
system:metrics-server
rules
:
-
apiGroups
:
-
"
"
resources
:
-
pods
-
nodes
-
nodes/stats
-
namespaces
verbs
:
-
get
-
list
-
watch
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRoleBinding
metadata
:
name
:
system:metrics-server
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
ClusterRole
name
:
system:metrics-server
subjects
:
-
kind
:
ServiceAccount
name
:
metrics-server
namespace
:
kube-system
pkg/cli/server/server.go
View file @
47a94637
...
@@ -158,10 +158,6 @@ func run(app *cli.Context, cfg *cmds.Server) error {
...
@@ -158,10 +158,6 @@ func run(app *cli.Context, cfg *cmds.Server) error {
serverConfig
.
DisableServiceLB
=
true
serverConfig
.
DisableServiceLB
=
true
continue
continue
}
}
if
!
strings
.
HasSuffix
(
noDeploy
,
".yaml"
)
{
noDeploy
=
noDeploy
+
".yaml"
}
serverConfig
.
ControlConfig
.
Skips
=
append
(
serverConfig
.
ControlConfig
.
Skips
,
noDeploy
)
serverConfig
.
ControlConfig
.
Skips
=
append
(
serverConfig
.
ControlConfig
.
Skips
,
noDeploy
)
}
}
...
...
pkg/codegen/main.go
View file @
47a94637
...
@@ -36,7 +36,8 @@ func main() {
...
@@ -36,7 +36,8 @@ func main() {
bc
=
&
bindata
.
Config
{
bc
=
&
bindata
.
Config
{
Input
:
[]
bindata
.
InputConfig
{
Input
:
[]
bindata
.
InputConfig
{
{
{
Path
:
"manifests"
,
Path
:
"manifests"
,
Recursive
:
true
,
},
},
},
},
Package
:
"deploy"
,
Package
:
"deploy"
,
...
...
pkg/deploy/stage.go
View file @
47a94637
...
@@ -5,23 +5,32 @@ import (
...
@@ -5,23 +5,32 @@ import (
"io/ioutil"
"io/ioutil"
"os"
"os"
"path/filepath"
"path/filepath"
"strings"
"github.com/pkg/errors"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)
)
func
Stage
(
dataDir
string
,
templateVars
map
[
string
]
string
,
skipList
[]
string
)
error
{
func
Stage
(
dataDir
string
,
templateVars
map
[
string
]
string
,
skipList
[]
string
)
error
{
os
.
MkdirAll
(
dataDir
,
0700
)
skips
:=
map
[
string
]
bool
{}
skips
:=
map
[
string
]
bool
{}
for
_
,
skip
:=
range
skipList
{
for
_
,
skip
:=
range
skipList
{
skips
[
skip
]
=
true
skips
[
skip
]
=
true
}
}
staging
:
for
_
,
name
:=
range
AssetNames
()
{
for
_
,
name
:=
range
AssetNames
()
{
if
skips
[
name
]
{
nameNoExtension
:=
strings
.
TrimSuffix
(
name
,
filepath
.
Ext
(
name
))
continue
if
skips
[
name
]
||
skips
[
nameNoExtension
]
{
continue
staging
}
namePath
:=
strings
.
Split
(
name
,
string
(
os
.
PathSeparator
))
for
i
:=
1
;
i
<
len
(
namePath
);
i
++
{
subPath
:=
filepath
.
Join
(
namePath
[
0
:
i
]
...
)
if
skips
[
subPath
]
{
continue
staging
}
}
}
content
,
err
:=
Asset
(
name
)
content
,
err
:=
Asset
(
name
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -30,6 +39,7 @@ func Stage(dataDir string, templateVars map[string]string, skipList []string) er
...
@@ -30,6 +39,7 @@ func Stage(dataDir string, templateVars map[string]string, skipList []string) er
content
=
bytes
.
Replace
(
content
,
[]
byte
(
k
),
[]
byte
(
v
),
-
1
)
content
=
bytes
.
Replace
(
content
,
[]
byte
(
k
),
[]
byte
(
v
),
-
1
)
}
}
p
:=
filepath
.
Join
(
dataDir
,
name
)
p
:=
filepath
.
Join
(
dataDir
,
name
)
os
.
MkdirAll
(
filepath
.
Dir
(
p
),
0700
)
logrus
.
Info
(
"Writing manifest: "
,
p
)
logrus
.
Info
(
"Writing manifest: "
,
p
)
if
err
:=
ioutil
.
WriteFile
(
p
,
content
,
0600
);
err
!=
nil
{
if
err
:=
ioutil
.
WriteFile
(
p
,
content
,
0600
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"failed to write to %s"
,
name
)
return
errors
.
Wrapf
(
err
,
"failed to write to %s"
,
name
)
...
...
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