ci: Introduce yamllint for actions workflow files

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
dependabot/go_modules/github.com/prometheus/procfs-0.11.0
Jintao Zhang 2023-05-26 16:34:23 +08:00
parent bf903e5007
commit b0b922cd71
34 changed files with 675 additions and 651 deletions

View File

@ -1,92 +1,93 @@
---
name: Bug Report
description: Report a bug encountered while operating Etcd
labels:
- type/bug
- type/bug
body:
- type: markdown
attributes:
value: |
Please read https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/reporting_bugs.md
If this matter is security related, please disclose it privately via security@etcd.io.
Please fill the form below and provide as much information as possible.
Not doing so may result in your bug not being addressed in a timely manner.
- type: markdown
attributes:
value: |
Please read https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/reporting_bugs.md
If this matter is security related, please disclose it privately via security@etcd.io.
Please fill the form below and provide as much information as possible.
Not doing so may result in your bug not being addressed in a timely manner.
- type: textarea
id: problem
attributes:
label: What happened?
validations:
required: true
- type: textarea
id: problem
attributes:
label: What happened?
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true
- type: textarea
id: repro
attributes:
label: How can we reproduce it (as minimally and precisely as possible)?
validations:
required: true
- type: textarea
id: repro
attributes:
label: How can we reproduce it (as minimally and precisely as possible)?
validations:
required: true
- type: textarea
id: additional
attributes:
label: Anything else we need to know?
- type: textarea
id: additional
attributes:
label: Anything else we need to know?
- type: textarea
id: etcdVersion
attributes:
label: Etcd version (please run commands below)
value: |
<details>
- type: textarea
id: etcdVersion
attributes:
label: Etcd version (please run commands below)
value: |
<details>
```console
$ etcd --version
# paste output here
```console
$ etcd --version
# paste output here
$ etcdctl version
# paste output here
```
$ etcdctl version
# paste output here
```
</details>
validations:
required: true
</details>
validations:
required: true
- type: textarea
id: config
attributes:
label: Etcd configuration (command line flags or environment variables)
value: |
<details>
- type: textarea
id: config
attributes:
label: Etcd configuration (command line flags or environment variables)
value: |
<details>
# paste your configuration here
# paste your configuration here
</details>
</details>
- type: textarea
id: etcdDebugInformation
attributes:
label: Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
value: |
<details>
- type: textarea
id: etcdDebugInformation
attributes:
label: Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
value: |
<details>
```console
$ etcdctl member list -w table
# paste output here
```console
$ etcdctl member list -w table
# paste output here
$ etcdctl --endpoints=<member list> endpoint status -w table
# paste output here
```
$ etcdctl --endpoints=<member list> endpoint status -w table
# paste output here
```
</details>
</details>
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

View File

@ -1,5 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/etcd-io/etcd/discussions
about: Question relating to Etcd
- name: Question
url: https://github.com/etcd-io/etcd/discussions
about: Question relating to Etcd

View File

@ -1,18 +1,19 @@
---
name: Feature request
description: Provide idea for a new feature
labels:
- type/feature
- type/feature
body:
- type: textarea
id: feature
attributes:
label: What would you like to be added?
validations:
required: true
- type: textarea
id: feature
attributes:
label: What would you like to be added?
validations:
required: true
- type: textarea
id: rationale
attributes:
label: Why is this needed?
validations:
required: true
- type: textarea
id: rationale
attributes:
label: Why is this needed?
validations:
required: true

View File

@ -1,30 +1,31 @@
---
name: Membership nomination
description: Nominate new etcd members
labels:
- area/community
- area/community
body:
- type: textarea
id: feature
attributes:
label: Who would you like to nominate?
validations:
required: true
- id: requirements
type: checkboxes
attributes:
label: Requirements
options:
- label: I have reviewed the [community membership guidelines](https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/community-membership.md)
required: true
- label: The members are actively contributing to 1 or more etcd subprojects
required: true
- label: The members are being sponsored by two current reviewers or a current maintainer.
- type: textarea
id: feature
attributes:
label: Who would you like to nominate?
validations:
required: true
- type: textarea
id: rationale
attributes:
label: How do the new members meet the regular active contribution requirements?
validations:
required: true
- id: requirements
type: checkboxes
attributes:
label: Requirements
options:
- label: I have reviewed the [community membership guidelines](https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/community-membership.md)
required: true
- label: The members are actively contributing to 1 or more etcd subprojects
required: true
- label: The members are being sponsored by two current reviewers or a current maintainer.
required: true
- type: textarea
id: rationale
attributes:
label: How do the new members meet the regular active contribution requirements?
validations:
required: true

View File

@ -1,33 +1,34 @@
---
name: Flaking Test
description: Report flaky tests
labels:
- type/flake
- type/flake
body:
- type: textarea
id: workflows
attributes:
label: Which github workflows are flaking?
validations:
required: true
- type: textarea
id: workflows
attributes:
label: Which github workflows are flaking?
validations:
required: true
- type: textarea
id: tests
attributes:
label: Which tests are flaking?
validations:
required: true
- type: textarea
id: tests
attributes:
label: Which tests are flaking?
validations:
required: true
- type: input
id: link
attributes:
label: Github Action link
- type: input
id: link
attributes:
label: Github Action link
- type: textarea
id: reason
attributes:
label: Reason for failure (if possible)
- type: textarea
id: reason
attributes:
label: Reason for failure (if possible)
- type: textarea
id: additional
attributes:
label: Anything else we need to know?
- type: textarea
id: additional
attributes:
label: Anything else we need to know?

View File

@ -1,3 +1,4 @@
---
version: 2
updates:
- package-ecosystem: github-actions
@ -10,11 +11,11 @@ updates:
schedule:
interval: weekly
allow:
- dependency-type: all
- dependency-type: all
- package-ecosystem: gomod
directory: /tools/mod # Not linked from /go.mod
schedule:
interval: weekly
allow:
- dependency-type: all
- dependency-type: all

1
.github/stale.yml vendored
View File

@ -1,3 +1,4 @@
---
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale

View File

@ -1,3 +1,4 @@
---
name: Build
on: [push, pull_request]
permissions: read-all

View File

@ -1,3 +1,4 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
@ -13,10 +14,10 @@ name: "CodeQL"
on:
push:
branches: [ main, release-3.4, release-3.5, release-3.6 ]
branches: [main, release-3.4, release-3.5, release-3.6]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '20 14 * * 5'
@ -34,40 +35,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
language: ['go']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3

View File

@ -1,3 +1,4 @@
---
name: Test contrib/mixin
on: [push, pull_request]
permissions: read-all
@ -8,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
needs: goversion
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: |
set -euo pipefail
make -C contrib/mixin tools test
make -C contrib/mixin tools test

View File

@ -1,3 +1,4 @@
---
name: Coverage
on: [push]
permissions: read-all
@ -11,22 +12,22 @@ jobs:
fail-fast: false
matrix:
target:
- linux-amd64-coverage
- linux-amd64-coverage
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- env:
TARGET: ${{ matrix.target }}
run: |
mkdir "${TARGET}"
case "${TARGET}" in
linux-amd64-coverage)
GOARCH=amd64 ./scripts/codecov_upload.sh
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- env:
TARGET: ${{ matrix.target }}
run: |
mkdir "${TARGET}"
case "${TARGET}" in
linux-amd64-coverage)
GOARCH=amd64 ./scripts/codecov_upload.sh
;;
*)
echo "Failed to find target"
exit 1
;;
esac

View File

@ -1,3 +1,4 @@
---
name: E2E-arm64
on:
schedule:
@ -19,27 +20,27 @@ jobs:
fail-fast: true
matrix:
target:
- linux-arm64-e2e
- linux-arm64-e2e
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-arm64-e2e)
GOOS=linux GOARCH=arm64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release
;;
*)
echo "Failed to find target"
exit 1
;;
esac
echo "${TARGET}"
case "${TARGET}" in
linux-arm64-e2e)
GOOS=linux GOARCH=arm64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release
;;
*)
echo "Failed to find target"
exit 1
;;
esac

View File

@ -1,3 +1,4 @@
---
name: E2E
on: [push, pull_request]
permissions: read-all
@ -11,29 +12,29 @@ jobs:
fail-fast: true
matrix:
target:
- linux-amd64-e2e
- linux-386-e2e
- linux-amd64-e2e
- linux-386-e2e
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
VERBOSE=1 GOOS=linux GOARCH=amd64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release
;;
linux-386-e2e)
VERBOSE=1 GOOS=linux GOARCH=386 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e
;;
*)
echo "Failed to find target"
exit 1
;;
esac
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
VERBOSE=1 GOOS=linux GOARCH=amd64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release
;;
linux-386-e2e)
VERBOSE=1 GOOS=linux GOARCH=386 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e
;;
*)
echo "Failed to find target"
exit 1
;;
esac

View File

@ -1,3 +1,4 @@
---
name: Fuzzing v3rpc
on: [push, pull_request]
permissions: read-all
@ -12,15 +13,15 @@ jobs:
env:
TARGET_PATH: ./server/etcdserver/api/v3rpc
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: |
set -euo pipefail
GOARCH=amd64 CPU=4 make fuzz
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: failure()
with:
path: "${{env.TARGET_PATH}}/testdata/fuzz/**/*"
GOARCH=amd64 CPU=4 make fuzz
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: failure()
with:
path: "${{env.TARGET_PATH}}/testdata/fuzz/**/*"

View File

@ -1,3 +1,4 @@
---
name: Go version setup
permissions: read-all

View File

@ -1,3 +1,4 @@
---
name: Go Vulnerability Checker
on: [push, pull_request]
permissions: read-all

View File

@ -1,3 +1,4 @@
---
name: grpcProxy-tests
on: [push, pull_request]
permissions: read-all
@ -11,29 +12,29 @@ jobs:
fail-fast: true
matrix:
target:
- linux-amd64-grpcproxy-integration
- linux-amd64-grpcproxy-e2e
- linux-amd64-grpcproxy-integration
- linux-amd64-grpcproxy-e2e
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-grpcproxy-integration)
GOOS=linux GOARCH=amd64 CPU=4 RACE=true make test-grpcproxy-integration
;;
linux-amd64-grpcproxy-e2e)
GOOS=linux GOARCH=amd64 CPU=4 RACE=true make test-grpcproxy-e2e
;;
*)
echo "Failed to find target"
exit 1
;;
esac
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-grpcproxy-integration)
GOOS=linux GOARCH=amd64 CPU=4 RACE=true make test-grpcproxy-integration
;;
linux-amd64-grpcproxy-e2e)
GOOS=linux GOARCH=amd64 CPU=4 RACE=true make test-grpcproxy-e2e
;;
*)
echo "Failed to find target"
exit 1
;;
esac

View File

@ -1,3 +1,4 @@
---
name: Measure Test Flakiness
on:
@ -11,12 +12,12 @@ jobs:
name: Measure Test Flakiness
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
./scripts/measure-test-flakiness.sh
make bin/etcd-test-analyzer
bin/etcd-test-analyzer run -token $GITHUB_TOKEN -max-age=168h -workflow Tests -branch main
./scripts/measure-test-flakiness.sh
make bin/etcd-test-analyzer
bin/etcd-test-analyzer run -token $GITHUB_TOKEN -max-age=168h -workflow Tests -branch main

View File

@ -1,3 +1,4 @@
---
name: Release
on: [push, pull_request]
permissions: read-all
@ -8,27 +9,27 @@ jobs:
runs-on: ubuntu-latest
needs: goversion
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- name: release
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- name: release
run: |
set -euo pipefail
git config --global user.email "github-action@etcd.io"
git config --global user.name "Github Action"
gpg --batch --gen-key <<EOF
%no-protection
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Github Action
Name-Email: github-action@etcd.io
Expire-Date: 0
EOF
DRY_RUN=true ./scripts/release.sh --no-upload --no-docker-push --in-place 3.6.99
- name: test-image
run: |
VERSION=3.6.99 ./scripts/test_images.sh
git config --global user.email "github-action@etcd.io"
git config --global user.name "Github Action"
gpg --batch --gen-key <<EOF
%no-protection
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Github Action
Name-Email: github-action@etcd.io
Expire-Date: 0
EOF
DRY_RUN=true ./scripts/release.sh --no-upload --no-docker-push --in-place 3.6.99
- name: test-image
run: |
VERSION=3.6.99 ./scripts/test_images.sh

View File

@ -1,3 +1,4 @@
---
name: Robustness Nightly
permissions: read-all
on:

View File

@ -1,3 +1,4 @@
---
name: Reusable Robustness Workflow
on:
workflow_call:
@ -35,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
@ -69,4 +70,3 @@ jobs:
with:
name: ${{ inputs.artifactName }}
path: /tmp/results/*

View File

@ -1,3 +1,4 @@
---
name: Reusable Robustness Workflow
on:
workflow_call:
@ -28,37 +29,37 @@ jobs:
runs-on: ${{ fromJson(inputs.runs-on) }}
needs: goversion
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- name: test-robustness
env:
ETCD_BRANCH: "${{ inputs.etcdBranch }}"
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- name: test-robustness
env:
ETCD_BRANCH: "${{ inputs.etcdBranch }}"
run: |
set -euo pipefail
# Use --failfast to avoid overriding report generated by failed test
GO_TEST_FLAGS="-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestRobustness"
case "${ETCD_BRANCH}" in
release-3.5)
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.5
;;
release-3.4)
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.4
;;
main)
make gofail-enable
make build
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness
;;
*)
echo "Failed to find target ${ETCD_BRANCH}"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: always()
with:
name: ${{ inputs.artifactName }}
path: /tmp/results/*
# Use --failfast to avoid overriding report generated by failed test
GO_TEST_FLAGS="-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestRobustness"
case "${ETCD_BRANCH}" in
release-3.5)
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.5
;;
release-3.4)
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.4
;;
main)
make gofail-enable
make build
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness
;;
*)
echo "Failed to find target ${ETCD_BRANCH}"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: always()
with:
name: ${{ inputs.artifactName }}
path: /tmp/results/*

View File

@ -1,3 +1,4 @@
---
name: Robustness
on: [push, pull_request]
permissions: read-all

View File

@ -1,3 +1,4 @@
---
name: Scorecards supply-chain security
on:
# Only the default branch is supported.
@ -5,7 +6,7 @@ on:
schedule:
- cron: '45 1 * * 0'
push:
branches: [ "main" ]
branches: ["main"]
# Declare default permissions as read only.
permissions: read-all
@ -46,7 +47,7 @@ jobs:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # tag=v1.0.26

View File

@ -1,3 +1,4 @@
---
name: Static Analysis
on: [push, pull_request]
permissions: read-all

View File

@ -1,3 +1,4 @@
---
name: Tests-arm64
on:
schedule:
@ -19,44 +20,44 @@ jobs:
fail-fast: false
matrix:
target:
- linux-arm64-integration-1-cpu
- linux-arm64-integration-2-cpu
- linux-arm64-integration-4-cpu
- linux-arm64-unit-4-cpu-race
- linux-arm64-integration-1-cpu
- linux-arm64-integration-2-cpu
- linux-arm64-integration-4-cpu
- linux-arm64-unit-4-cpu-race
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-arm64-integration-1-cpu)
GOOS=linux GOARCH=arm64 CPU=1 make test-integration
;;
linux-arm64-integration-2-cpu)
GOOS=linux GOARCH=arm64 CPU=2 make test-integration
;;
linux-arm64-integration-4-cpu)
GOOS=linux GOARCH=arm64 CPU=4 make test-integration
;;
linux-arm64-unit-4-cpu-race)
GOOS=linux GOARCH=arm64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
path: ./**/junit_*.xml
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-arm64-integration-1-cpu)
GOOS=linux GOARCH=arm64 CPU=1 make test-integration
;;
linux-arm64-integration-2-cpu)
GOOS=linux GOARCH=arm64 CPU=2 make test-integration
;;
linux-arm64-integration-4-cpu)
GOOS=linux GOARCH=arm64 CPU=4 make test-integration
;;
linux-arm64-unit-4-cpu-race)
GOOS=linux GOARCH=arm64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
path: ./**/junit_*.xml

View File

@ -1,3 +1,4 @@
---
name: Tests
on: [push, pull_request]
permissions: read-all
@ -11,46 +12,46 @@ jobs:
fail-fast: false
matrix:
target:
- linux-amd64-integration-1-cpu
- linux-amd64-integration-2-cpu
- linux-amd64-integration-4-cpu
- linux-amd64-unit-4-cpu-race
- linux-386-unit-1-cpu
- linux-amd64-integration-1-cpu
- linux-amd64-integration-2-cpu
- linux-amd64-integration-4-cpu
- linux-amd64-unit-4-cpu-race
- linux-386-unit-1-cpu
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-amd64-integration-1-cpu)
GOOS=linux GOARCH=amd64 CPU=1 make test-integration
;;
linux-amd64-integration-2-cpu)
GOOS=linux GOARCH=amd64 CPU=2 make test-integration
;;
linux-amd64-integration-4-cpu)
GOOS=linux GOARCH=amd64 CPU=4 make test-integration
;;
linux-amd64-unit-4-cpu-race)
GOOS=linux GOARCH=amd64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit
;;
linux-386-unit-1-cpu)
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
path: ./**/junit_*.xml
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-amd64-integration-1-cpu)
GOOS=linux GOARCH=amd64 CPU=1 make test-integration
;;
linux-amd64-integration-2-cpu)
GOOS=linux GOARCH=amd64 CPU=2 make test-integration
;;
linux-amd64-integration-4-cpu)
GOOS=linux GOARCH=amd64 CPU=4 make test-integration
;;
linux-amd64-unit-4-cpu-race)
GOOS=linux GOARCH=amd64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit
;;
linux-386-unit-1-cpu)
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
path: ./**/junit_*.xml

View File

@ -1,41 +1,37 @@
---
run:
timeout: 30m
skip-files:
- "^zz_generated.*"
skip-files: [^zz_generated.*]
issues:
max-same-issues: 0
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassing linter for generated files for conversion
- path: conversion\.go
linters:
- ineffassign
linters: [ineffassign]
linters:
disable-all: true
enable: # please keep this alphabetized
# Don't use soon to deprecated[1] linters that lead to false
# https://github.com/golangci/golangci-lint/issues/1841
# - deadcode
# - structcheck
# - varcheck
enable: # please keep this alphabetized
# Don't use soon to deprecated[1] linters that lead to false
# https://github.com/golangci/golangci-lint/issues/1841
# - deadcode
# - structcheck
# - varcheck
- goimports
- ineffassign
- revive
- staticcheck
- stylecheck
- unused
- unconvert # Remove unnecessary type conversions
linters-settings: # please keep this alphabetized
- unconvert # Remove unnecessary type conversions
linters-settings: # please keep this alphabetized
goimports:
local-prefixes: go.etcd.io # Put imports beginning with prefix after 3rd-party packages.
local-prefixes: go.etcd.io # Put imports beginning with prefix after 3rd-party packages.
staticcheck:
checks:
- "all"
- "-SA1019" # TODO(fix) Using a deprecated function, variable, constant or field
- "-SA2002" # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isnt allowed
- all
- -SA1019 # TODO(fix) Using a deprecated function, variable, constant or field
- -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isnt allowed
stylecheck:
checks:
- "ST1019" # Importing the same package multiple times.
- ST1019 # Importing the same package multiple times.

7
.yamllint Normal file
View File

@ -0,0 +1,7 @@
---
extends: default
rules:
line-length: disable
truthy: disable
comments: disable

View File

@ -64,7 +64,7 @@ fuzz:
verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck verify-goword \
verify-govet verify-license-header verify-receiver-name verify-mod-tidy verify-shellcheck \
verify-shellws verify-proto-annotations verify-genproto verify-goimport
verify-shellws verify-proto-annotations verify-genproto verify-goimport verify-yamllint
fix: fix-bom fix-lint
./scripts/fix.sh
@ -132,6 +132,10 @@ verify-genproto:
verify-goimport:
PASSES="goimport" ./scripts/test.sh
.PHONY: verify-yamllint
verify-yamllint:
yamllint .
# Cleanup
clean:

View File

@ -1,17 +1,16 @@
---
codecov:
token: "6040de41-c073-4d6f-bbf8-d89256ef31e1"
token: 6040de41-c073-4d6f-bbf8-d89256ef31e1
disable_default_path_fixes: true
fixes:
- "go.etcd.io/etcd/api/v3/::api/"
- "go.etcd.io/etcd/client/v3/::client/v3/"
- "go.etcd.io/etcd/client/v2/::client/v2/"
- "go.etcd.io/etcd/etcdctl/v3/::etcdctl/"
- "go.etcd.io/etcd/pkg/v3/::pkg/"
- "go.etcd.io/etcd/server/v3/::server/"
- go.etcd.io/etcd/api/v3/::api/
- go.etcd.io/etcd/client/v3/::client/v3/
- go.etcd.io/etcd/client/v2/::client/v2/
- go.etcd.io/etcd/etcdctl/v3/::etcdctl/
- go.etcd.io/etcd/pkg/v3/::pkg/
- go.etcd.io/etcd/server/v3/::server/
ignore:
- "**/*.pb.go"
- "**/*.pb.gw.go"
- "tests/**/*"
- "go.etcd.io/etcd/tests/**/*"
- '**/*.pb.go'
- '**/*.pb.gw.go'
- tests/**/*
- go.etcd.io/etcd/tests/**/*

View File

@ -1,17 +1,15 @@
rule_files:
- manifests/etcd-prometheusRules.yaml
---
rule_files: [manifests/etcd-prometheusRules.yaml]
evaluation_interval: 1m
tests:
- interval: 1m
input_series:
- series: 'up{job="etcd",instance="10.10.10.0"}'
values: '1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0'
- series: 'up{job="etcd",instance="10.10.10.1"}'
values: '1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0'
- series: 'up{job="etcd",instance="10.10.10.2"}'
values: '1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0'
- series: up{job="etcd",instance="10.10.10.0"}
values: 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
- series: up{job="etcd",instance="10.10.10.1"}
values: 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
- series: up{job="etcd",instance="10.10.10.2"}
values: 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test:
- eval_time: 3m
alertname: etcdInsufficientMembers
@ -27,7 +25,7 @@ tests:
severity: critical
exp_annotations:
description: 'etcd cluster "etcd": members are down (3).'
summary: 'etcd cluster members are down.'
summary: etcd cluster members are down.
- eval_time: 7m
alertname: etcdInsufficientMembers
- eval_time: 11m
@ -38,7 +36,7 @@ tests:
severity: critical
exp_annotations:
description: 'etcd cluster "etcd": insufficient members (1).'
summary: 'etcd cluster has insufficient number of members.'
summary: etcd cluster has insufficient number of members.
- eval_time: 15m
alertname: etcdInsufficientMembers
exp_alerts:
@ -47,16 +45,15 @@ tests:
severity: critical
exp_annotations:
description: 'etcd cluster "etcd": insufficient members (0).'
summary: 'etcd cluster has insufficient number of members.'
summary: etcd cluster has insufficient number of members.
- interval: 1m
input_series:
- series: 'up{job="etcd",instance="10.10.10.0"}'
values: '1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0'
- series: 'up{job="etcd",instance="10.10.10.1"}'
values: '1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0'
- series: 'up{job="etcd",instance="10.10.10.2"}'
values: '1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
- series: up{job="etcd",instance="10.10.10.0"}
values: 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
- series: up{job="etcd",instance="10.10.10.1"}
values: 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
- series: up{job="etcd",instance="10.10.10.2"}
values: 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test:
- eval_time: 14m
alertname: etcdMembersDown
@ -66,16 +63,15 @@ tests:
severity: critical
exp_annotations:
description: 'etcd cluster "etcd": members are down (3).'
summary: 'etcd cluster members are down.'
summary: etcd cluster members are down.
- interval: 1m
input_series:
- series: 'up{job="etcd",instance="10.10.10.0"}'
values: '1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0'
- series: 'up{job="etcd",instance="10.10.10.1"}'
values: '1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0'
- series: 'etcd_network_peer_sent_failures_total{To="member-1",job="etcd",endpoint="test"}'
values: '0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18'
- series: up{job="etcd",instance="10.10.10.0"}
values: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
- series: up{job="etcd",instance="10.10.10.1"}
values: 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
- series: etcd_network_peer_sent_failures_total{To="member-1",job="etcd",endpoint="test"}
values: 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
alert_rule_test:
- eval_time: 13m
alertname: etcdMembersDown
@ -85,16 +81,15 @@ tests:
severity: critical
exp_annotations:
description: 'etcd cluster "etcd": members are down (1).'
summary: 'etcd cluster members are down.'
summary: etcd cluster members are down.
- interval: 1m
input_series:
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.0"}'
values: '0 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0'
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.1"}'
values: '0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0'
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.2"}'
values: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
- series: etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.0"}
values: 0 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0
- series: etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.1"}
values: 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
- series: etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.2"}
values: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test:
- eval_time: 10m
alertname: etcdHighNumberOfLeaderChanges
@ -103,62 +98,69 @@ tests:
job: etcd
severity: warning
exp_annotations:
description: 'etcd cluster "etcd": 4 leader changes within the last 15 minutes. Frequent elections may be a sign of insufficient resources, high network latency, or disruptions by other components and should be investigated.'
summary: 'etcd cluster has high number of leader changes.'
description: 'etcd cluster "etcd": 4 leader changes within the last
15 minutes. Frequent elections may be a sign of insufficient resources,
high network latency, or disruptions by other components and should
be investigated.'
summary: etcd cluster has high number of leader changes.
- interval: 1m
input_series:
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.0"}'
values: '0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0'
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.1"}'
values: '0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0'
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.2"}'
values: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
- series: etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.0"}
values: 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0
- series: etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.1"}
values: 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
- series: etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.2"}
values: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test:
- eval_time: 10m
alertname: etcdHighNumberOfLeaderChanges
exp_alerts:
- interval: 1m
input_series:
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}'
values: '0+8192x240'
- series: 'etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.0"}'
values: '524288+0x240'
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}'
values: '0+1024x240'
- series: 'etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.1"}'
values: '524288+0x240'
- series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}
values: 0+8192x240
- series: etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.0"}
values: 524288+0x240
- series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}
values: 0+1024x240
- series: etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.1"}
values: 524288+0x240
alert_rule_test:
- eval_time: 11m
alertname: etcdExcessiveDatabaseGrowth
exp_alerts:
- exp_labels:
instance: '10.10.10.0'
instance: 10.10.10.0
job: etcd
severity: warning
exp_annotations:
description: 'etcd cluster "etcd": Predicting running out of disk space in the next four hours, based on write observations within the past four hours on etcd instance 10.10.10.0, please check as it might be disruptive.'
summary: 'etcd cluster database growing very fast.'
description: 'etcd cluster "etcd": Predicting running out of disk space
in the next four hours, based on write observations within the past
four hours on etcd instance 10.10.10.0, please check as it might be
disruptive.'
summary: etcd cluster database growing very fast.
- interval: 1m
input_series:
- series: 'etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.0"}'
values: '300000000+0x10'
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}'
values: '1000000000+0x10'
- series: 'etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.1"}'
values: '700000000+0x10'
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}'
values: '1000000000+0x10'
- series: etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.0"}
values: 300000000+0x10
- series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}
values: 1000000000+0x10
- series: etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.1"}
values: 700000000+0x10
- series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}
values: 1000000000+0x10
alert_rule_test:
- eval_time: 11m
alertname: etcdDatabaseHighFragmentationRatio
exp_alerts:
- exp_labels:
instance: '10.10.10.0'
instance: 10.10.10.0
job: etcd
severity: warning
exp_annotations:
description: 'etcd cluster "etcd": database size in use on instance 10.10.10.0 is 30% of the actual allocated disk space, please run defragmentation (e.g. etcdctl defrag) to retrieve the unused fragmented disk space.'
description: 'etcd cluster "etcd": database size in use on instance
10.10.10.0 is 30% of the actual allocated disk space, please run defragmentation
(e.g. etcdctl defrag) to retrieve the unused fragmented disk space.'
runbook_url: https://etcd.io/docs/v3.5/op-guide/maintenance/#defragmentation
summary: 'etcd database size in use is less than 50% of the actual allocated storage.'
summary: etcd database size in use is less than 50% of the actual allocated
storage.

View File

@ -1,18 +1,17 @@
---
apiVersion: v1
kind: Service
metadata:
name: etcd-client
spec:
ports:
- name: etcd-client-port
port: 2379
protocol: TCP
targetPort: 2379
- name: etcd-client-port
port: 2379
protocol: TCP
targetPort: 2379
selector:
app: etcd
---
apiVersion: v1
kind: Pod
metadata:
@ -22,35 +21,33 @@ metadata:
name: etcd0
spec:
containers:
- command:
- /usr/local/bin/etcd
- --name
- etcd0
- --initial-advertise-peer-urls
- http://etcd0:2380
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://etcd0:2379
- --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state
- new
image: quay.io/coreos/etcd:latest
name: etcd0
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
- command:
- /usr/local/bin/etcd
- --name
- etcd0
- --initial-advertise-peer-urls
- http://etcd0:2380
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://etcd0:2379
- --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state
- new
image: quay.io/coreos/etcd:latest
name: etcd0
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
@ -59,19 +56,17 @@ metadata:
name: etcd0
spec:
ports:
- name: client
port: 2379
protocol: TCP
targetPort: 2379
- name: server
port: 2380
protocol: TCP
targetPort: 2380
- name: client
port: 2379
protocol: TCP
targetPort: 2379
- name: server
port: 2380
protocol: TCP
targetPort: 2380
selector:
etcd_node: etcd0
---
apiVersion: v1
kind: Pod
metadata:
@ -81,35 +76,33 @@ metadata:
name: etcd1
spec:
containers:
- command:
- /usr/local/bin/etcd
- --name
- etcd1
- --initial-advertise-peer-urls
- http://etcd1:2380
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://etcd1:2379
- --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state
- new
image: quay.io/coreos/etcd:latest
name: etcd1
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
- command:
- /usr/local/bin/etcd
- --name
- etcd1
- --initial-advertise-peer-urls
- http://etcd1:2380
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://etcd1:2379
- --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state
- new
image: quay.io/coreos/etcd:latest
name: etcd1
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
@ -118,19 +111,17 @@ metadata:
name: etcd1
spec:
ports:
- name: client
port: 2379
protocol: TCP
targetPort: 2379
- name: server
port: 2380
protocol: TCP
targetPort: 2380
- name: client
port: 2379
protocol: TCP
targetPort: 2379
- name: server
port: 2380
protocol: TCP
targetPort: 2380
selector:
etcd_node: etcd1
---
apiVersion: v1
kind: Pod
metadata:
@ -140,35 +131,33 @@ metadata:
name: etcd2
spec:
containers:
- command:
- /usr/local/bin/etcd
- --name
- etcd2
- --initial-advertise-peer-urls
- http://etcd2:2380
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://etcd2:2379
- --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state
- new
image: quay.io/coreos/etcd:latest
name: etcd2
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
- command:
- /usr/local/bin/etcd
- --name
- etcd2
- --initial-advertise-peer-urls
- http://etcd2:2380
- --listen-peer-urls
- http://0.0.0.0:2380
- --listen-client-urls
- http://0.0.0.0:2379
- --advertise-client-urls
- http://etcd2:2379
- --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state
- new
image: quay.io/coreos/etcd:latest
name: etcd2
ports:
- containerPort: 2379
name: client
protocol: TCP
- containerPort: 2380
name: server
protocol: TCP
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
@ -177,13 +166,13 @@ metadata:
name: etcd2
spec:
ports:
- name: client
port: 2379
protocol: TCP
targetPort: 2379
- name: server
port: 2380
protocol: TCP
targetPort: 2380
- name: client
port: 2379
protocol: TCP
targetPort: 2379
- name: server
port: 2380
protocol: TCP
targetPort: 2380
selector:
etcd_node: etcd2

View File

@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Pod
metadata:
@ -6,17 +7,17 @@ metadata:
name: vulcand
spec:
containers:
- command:
- /go/bin/vulcand
- -apiInterface=0.0.0.0
- --etcd=http://etcd-client:2379
image: mailgun/vulcand:v0.8.0-beta.2
name: vulcand
ports:
- containerPort: 8081
name: api
protocol: TCP
- containerPort: 8082
name: server
protocol: TCP
- command:
- /go/bin/vulcand
- -apiInterface=0.0.0.0
- --etcd=http://etcd-client:2379
image: mailgun/vulcand:v0.8.0-beta.2
name: vulcand
ports:
- containerPort: 8081
name: api
protocol: TCP
- containerPort: 8082
name: server
protocol: TCP
restartPolicy: Always