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
e9322b92
Commit
e9322b92
authored
Nov 17, 2017
by
Mik Vyatskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix setting resources in fluentd-gcp plugin
Signed-off-by:
Mik Vyatskov
<
vmik@google.com
>
parent
8823a835
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
fluentd-gcp-ds-sa.yaml
cluster/addons/fluentd-gcp/fluentd-gcp-ds-sa.yaml
+8
-0
fluentd-gcp-ds.yaml
cluster/addons/fluentd-gcp/fluentd-gcp-ds.yaml
+0
-9
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+33
-7
No files found.
cluster/addons/fluentd-gcp/fluentd-gcp-ds-sa.yaml
0 → 100644
View file @
e9322b92
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
fluentd-gcp
namespace
:
kube-system
labels
:
kubernetes.io/cluster-service
:
"
true"
addonmanager.kubernetes.io/mode
:
Reconcile
cluster/addons/fluentd-gcp/fluentd-gcp-ds.yaml
View file @
e9322b92
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
fluentd-gcp
namespace
:
kube-system
labels
:
kubernetes.io/cluster-service
:
"
true"
addonmanager.kubernetes.io/mode
:
Reconcile
---
apiVersion
:
extensions/v1beta1
kind
:
DaemonSet
metadata
:
...
...
cluster/gce/gci/configure-helper.sh
View file @
e9322b92
...
...
@@ -1942,21 +1942,47 @@ function copy-manifests {
# Fluentd manifest is modified using kubectl, which may not be available at
# this point. Run this as a background process.
function
wait-for-apiserver-and-update-fluentd
{
local
-r
fluentd_gcp_yaml
=
"
${
1
}
"
local
modifying_flags
=
""
if
[[
-n
"
${
FLUENTD_GCP_MEMORY_LIMIT
:-}
"
]]
;
then
modifying_flags
=
"
${
modifying_flags
}
--limits=memory=
${
FLUENTD_GCP_MEMORY_LIMIT
}
"
fi
local
request_resources
=
""
if
[[
-n
"
${
FLUENTD_GCP_CPU_REQUEST
:-}
"
]]
;
then
request_resources
=
"cpu=
${
FLUENTD_GCP_CPU_REQUEST
}
"
fi
if
[[
-n
"
${
FLUENTD_GCP_MEMORY_REQUEST
:-}
"
]]
;
then
if
[[
-n
"
${
request_resources
}
"
]]
;
then
request_resources
=
"
${
request_resources
}
,"
fi
request_resources
=
"memory=
${
FLUENTD_GCP_MEMORY_REQUEST
}
"
fi
if
[[
-n
"
${
request_resources
}
"
]]
;
then
modifying_flags
=
"
${
modifying_flags
}
--requests=
${
request_resources
}
"
fi
until
kubectl get nodes
do
sleep
10
done
kubectl
set
resources
--dry-run
--local
-f
${
fluentd_gcp_yaml
}
\
--limits
=
memory
=
${
FLUENTD_GCP_MEMORY_LIMIT
}
\
--requests
=
cpu
=
${
FLUENTD_GCP_CPU_REQUEST
}
,memory
=
${
FLUENTD_GCP_MEMORY_REQUEST
}
\
--containers
=
fluentd-gcp
-o
yaml
>
${
fluentd_gcp_yaml
}
.tmp
mv
${
fluentd_gcp_yaml
}
.tmp
${
fluentd_gcp_yaml
}
local
-r
temp_fluentd_gcp_yaml
=
"
${
fluentd_gcp_yaml
}
.tmp"
if
kubectl
set
resources
--dry-run
--local
-f
${
fluentd_gcp_yaml
}
${
modifying_flags
}
\
--containers
=
fluentd-gcp
-o
yaml
>
${
temp_fluentd_gcp_yaml
}
;
then
mv
${
temp_fluentd_gcp_yaml
}
${
fluentd_gcp_yaml
}
else
(
echo
"Failed to update fluentd resources. Used manifest:"
&&
cat
${
temp_fluentd_gcp_yaml
}
)
>
&2
rm
${
temp_fluentd_gcp_yaml
}
fi
}
# Trigger background process that will ultimately update fluentd resource
# requirements.
function
start-fluentd-resource-update
{
wait-for-apiserver-and-update-fluentd &
local
-r
fluentd_gcp_yaml
=
"
${
1
}
"
wait-for-apiserver-and-update-fluentd
${
fluentd_gcp_yaml
}
&
}
# Updates parameters in yaml file for prometheus-to-sd configuration, or
...
...
@@ -2091,7 +2117,7 @@ EOF
local
-r
fluentd_gcp_yaml
=
"
${
dst_dir
}
/fluentd-gcp/fluentd-gcp-ds.yaml"
update-prometheus-to-sd-parameters
${
event_exporter_yaml
}
update-prometheus-to-sd-parameters
${
fluentd_gcp_yaml
}
start-fluentd-resource-update
start-fluentd-resource-update
${
fluentd_gcp_yaml
}
fi
if
[[
"
${
ENABLE_CLUSTER_UI
:-}
"
==
"true"
]]
;
then
setup-addon-manifests
"addons"
"dashboard"
...
...
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