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
29d556a0
Unverified
Commit
29d556a0
authored
Nov 09, 2017
by
Tim Allclair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Source PodSecurityPolicies from addon subdir
parent
338ee7f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+26
-5
No files found.
cluster/gce/gci/configure-helper.sh
View file @
29d556a0
...
...
@@ -1705,14 +1705,35 @@ function start-cluster-autoscaler {
fi
}
# A helper function for copying addon manifests and set dir/files
# permissions.
# A helper function for setting up addon manifests.
#
# $1: addon category under /etc/kubernetes
# $2: manifest source dir
# $3: (optional) auxilary manifest source dir
function
setup-addon-manifests
{
local
-r
src_dir
=
"
${
KUBE_HOME
}
/kube-manifests/kubernetes/gci-trusty
/
$2
"
local
-r
src_dir
=
"
${
KUBE_HOME
}
/kube-manifests/kubernetes/gci-trusty"
local
-r
dst_dir
=
"/etc/kubernetes/
$1
/
$2
"
copy-manifests
"
${
src_dir
}
/
$2
"
"
${
dst_dir
}
"
# If the PodSecurityPolicy admission controller is enabled,
# set up the corresponding addon policies.
if
[[
"
${
ENABLE_POD_SECURITY_POLICY
:-}
"
==
"true"
]]
;
then
local
-r
psp_dir
=
"
${
src_dir
}
/
${
3
:-
$2
}
/podsecuritypolicies"
if
[[
-d
"
${
psp_dir
}
"
]]
;
then
copy-manifests
"
${
psp_dir
}
"
"
${
dst_dir
}
"
fi
fi
}
# A helper function for copying manifests and setting dir/files
# permissions.
#
# $1: absolute source dir
# $2: absolute destination dir
function
copy-manifests
{
local
-r
src_dir
=
"
$1
"
local
-r
dst_dir
=
"
$2
"
if
[[
!
-d
"
${
dst_dir
}
"
]]
;
then
mkdir
-p
"
${
dst_dir
}
"
fi
...
...
@@ -1783,7 +1804,7 @@ function start-kube-addons {
fi
if
[[
"
${
ENABLE_POD_SECURITY_POLICY
:-}
"
==
"true"
]]
;
then
setup-addon-manifests
"addons"
"podsecuritypolicies"
setup-addon-manifests
"addons"
"podsecuritypolicies"
fi
# Set up manifests of other addons.
...
...
@@ -1892,7 +1913,7 @@ EOF
fi
if
[[
"
${
ENABLE_NODE_PROBLEM_DETECTOR
:-}
"
==
"standalone"
]]
;
then
# Setup role binding for standalone node problem detector.
setup-addon-manifests
"addons"
"node-problem-detector/standalone"
setup-addon-manifests
"addons"
"node-problem-detector/standalone"
"node-problem-detector"
fi
if
echo
"
${
ADMISSION_CONTROL
:-}
"
|
grep
-q
"LimitRanger"
;
then
setup-addon-manifests
"admission-controls"
"limit-range"
...
...
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