Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyueyao committed Oct 23, 2021
1 parent f10d36e commit 4b1507e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ verify:
.PHONY: toc
toc:
@echo "===> Generating Table of Contents for Antrea docs <==="
$(CURDIR)/hack/update-toc.sh
GO=$(GO) $(CURDIR)/hack/update-toc.sh

.PHONE: markdownlint
markdownlint:
Expand Down
17 changes: 9 additions & 8 deletions docs/cookbooks/fluentd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,16 @@ kubectl create configmap fluentd-conf --from-file=docs/cookbooks/fluentd/resourc

### Step 4: Deploy Fluentd DeamonSet

Fluentd needs to collect logs from cluster components, so permissions need
to be granted first. All Fluentd-related resources will be deployed in
`kube-logging` Namespace, together with Elasticsearch and Kibana.
Create a ServiceAccount for Fluentd DaemonSet, in "ClusterRole", grant
permission to read, list and watch Pods. Finally, use ClusterRoleBinding
to link the two resources.

Fluentd deployment includes RBAC and DeamonSet. Fluentd will collect logs
from cluster components, so permissions need to be granted first through
RBAC. Create a ServiceAccount, and grant permissions to read, list and
watch Pods in ClusterRole. Then, use ClusterRoleBinding to link the two
resources.

In the DeamonSet configuration, specify Elasticsearch host, port and scheme,
as the Elasticsearch output plugin requires.
In [Fluentd official documentation](https://github.com/fluent/fluentd-kubernetes-daemonset),
the output plugins are specified in `fluent.conf` depending on the chosen image.
output plugins are specified in `fluent.conf` depending on the chosen image.
To change output plugins, choose a different image and specify it in `./resources/fluentd.yml`.
When choosing image version, note that the current Elasticsearch version
specified in `resources/kibana-elasticsearch.yml` is 7.8.0 and that the major
Expand Down
15 changes: 10 additions & 5 deletions hack/update-toc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ set -o pipefail

TOOL_VERSION=$(head hack/mdtoc-version)

GO_VERSION="$(${GO} version | awk '{print $3}')"
function version_lt() { test "$(printf '%s\n' "$@" | sort -rV | head -n 1)" != "$1"; }

if version_lt "${GO_VERSION}" "go1.16"; then
# See https://golang.org/doc/go-get-install-deprecation
echo "Running this script requires Go >= 1.16, please upgrade"
exit 1
fi

# cd to the root path
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "${ROOT}"
Expand All @@ -37,12 +46,8 @@ exitHandler() (
)
trap exitHandler EXIT

# perform go install in a temp dir as we are not tracking this version in a go module
# if we do the go install in the repo, it will create / update a go.mod and go.sum
cd "${TMP_DIR}"
GO111MODULE=on GOBIN="${TMP_DIR}" go install "github.com/tallclair/mdtoc@${TOOL_VERSION}"
GOBIN="${TMP_DIR}" ${GO} install "github.com/tallclair/mdtoc@${TOOL_VERSION}"
export PATH="${TMP_DIR}:${PATH}"
cd "${ROOT}"

# Update tables of contents if necessary.
find docs -name '*.md' | grep -Fxvf hack/.notableofcontents | xargs mdtoc --inplace
Expand Down

0 comments on commit 4b1507e

Please sign in to comment.