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
4dce8973
Commit
4dce8973
authored
Jun 21, 2018
by
Jing Ai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a helper function to customize K8s addon yamls and use it to customize Calico addons on GKE.
parent
52603a78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+20
-0
No files found.
cluster/gce/gci/configure-helper.sh
View file @
4dce8973
...
...
@@ -2286,6 +2286,23 @@ EOF
fi
}
# A helper function to set up a custom yaml for a k8s addon.
#
# $1: addon category under /etc/kubernetes
# $2: manifest source dir
# $3: manifest file
# $4: custom yaml
function
setup-addon-custom-yaml
{
local
-r
manifest_path
=
"/etc/kubernetes/
$1
/
$2
/
$3
"
local
-r
custom_yaml
=
"
$4
"
if
[
-n
"
${
custom_yaml
:-}
"
]
;
then
# Replace with custom manifest.
cat
>
"
${
manifest_path
}
"
<<
EOF
$custom_yaml
EOF
fi
}
# Prepares the manifests of k8s addons, and starts the addon manager.
# Vars assumed:
# CLUSTER_NAME
...
...
@@ -2436,6 +2453,9 @@ EOF
if
[[
"
${
NETWORK_POLICY_PROVIDER
:-}
"
==
"calico"
]]
;
then
setup-addon-manifests
"addons"
"calico-policy-controller"
setup-addon-custom-yaml
"addons"
"calico-policy-controller"
"calico-node-daemonset.yaml"
"
${
CUSTOM_CALICO_NODE_DAEMONSET_YAML
:-}
"
setup-addon-custom-yaml
"addons"
"calico-policy-controller"
"typha-deployment.yaml"
"
${
CUSTOM_TYPHA_DEPLOYMENT_YAML
:-}
"
# Configure Calico CNI directory.
local
-r
ds_file
=
"
${
dst_dir
}
/calico-policy-controller/calico-node-daemonset.yaml"
sed
-i
-e
"s@__CALICO_CNI_DIR__@/home/kubernetes/bin@g"
"
${
ds_file
}
"
...
...
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