ci: Introduce yamllint for actions workflow files

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

View File

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

View File

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

View File

@ -1,30 +1,31 @@
---
name: Membership nomination name: Membership nomination
description: Nominate new etcd members description: Nominate new etcd members
labels: labels:
- area/community - area/community
body: body:
- type: textarea - type: textarea
id: feature id: feature
attributes: attributes:
label: Who would you like to nominate? label: Who would you like to nominate?
validations: 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 required: true
- type: textarea - id: requirements
id: rationale type: checkboxes
attributes: attributes:
label: How do the new members meet the regular active contribution requirements? label: Requirements
validations: options:
required: true - 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 name: Flaking Test
description: Report flaky tests description: Report flaky tests
labels: labels:
- type/flake - type/flake
body: body:
- type: textarea - type: textarea
id: workflows id: workflows
attributes: attributes:
label: Which github workflows are flaking? label: Which github workflows are flaking?
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: tests id: tests
attributes: attributes:
label: Which tests are flaking? label: Which tests are flaking?
validations: validations:
required: true required: true
- type: input - type: input
id: link id: link
attributes: attributes:
label: Github Action link label: Github Action link
- type: textarea - type: textarea
id: reason id: reason
attributes: attributes:
label: Reason for failure (if possible) label: Reason for failure (if possible)
- type: textarea - type: textarea
id: additional id: additional
attributes: attributes:
label: Anything else we need to know? label: Anything else we need to know?

View File

@ -1,3 +1,4 @@
---
version: 2 version: 2
updates: updates:
- package-ecosystem: github-actions - package-ecosystem: github-actions
@ -10,11 +11,11 @@ updates:
schedule: schedule:
interval: weekly interval: weekly
allow: allow:
- dependency-type: all - dependency-type: all
- package-ecosystem: gomod - package-ecosystem: gomod
directory: /tools/mod # Not linked from /go.mod directory: /tools/mod # Not linked from /go.mod
schedule: schedule:
interval: weekly interval: weekly
allow: 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 # Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale # Number of days of inactivity before an Issue or Pull Request becomes stale

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
---
name: Reusable Robustness Workflow name: Reusable Robustness Workflow
on: on:
workflow_call: workflow_call:
@ -69,4 +70,3 @@ jobs:
with: with:
name: ${{ inputs.artifactName }} name: ${{ inputs.artifactName }}
path: /tmp/results/* path: /tmp/results/*

View File

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

View File

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

View File

@ -1,3 +1,4 @@
---
name: Scorecards supply-chain security name: Scorecards supply-chain security
on: on:
# Only the default branch is supported. # Only the default branch is supported.
@ -5,7 +6,7 @@ on:
schedule: schedule:
- cron: '45 1 * * 0' - cron: '45 1 * * 0'
push: push:
branches: [ "main" ] branches: ["main"]
# Declare default permissions as read only. # Declare default permissions as read only.
permissions: read-all permissions: read-all

View File

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

View File

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

View File

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

View File

@ -1,41 +1,37 @@
---
run: run:
timeout: 30m timeout: 30m
skip-files: skip-files: [^zz_generated.*]
- "^zz_generated.*"
issues: issues:
max-same-issues: 0 max-same-issues: 0
# Excluding configuration per-path, per-linter, per-text and per-source # Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules: exclude-rules:
# exclude ineffassing linter for generated files for conversion # exclude ineffassing linter for generated files for conversion
- path: conversion\.go - path: conversion\.go
linters: linters: [ineffassign]
- ineffassign
linters: linters:
disable-all: true disable-all: true
enable: # please keep this alphabetized enable: # please keep this alphabetized
# Don't use soon to deprecated[1] linters that lead to false # Don't use soon to deprecated[1] linters that lead to false
# https://github.com/golangci/golangci-lint/issues/1841 # https://github.com/golangci/golangci-lint/issues/1841
# - deadcode # - deadcode
# - structcheck # - structcheck
# - varcheck # - varcheck
- goimports - goimports
- ineffassign - ineffassign
- revive - revive
- staticcheck - staticcheck
- stylecheck - stylecheck
- unused - unused
- unconvert # Remove unnecessary type conversions - unconvert # Remove unnecessary type conversions
linters-settings: # please keep this alphabetized
linters-settings: # please keep this alphabetized
goimports: 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: staticcheck:
checks: checks:
- "all" - all
- "-SA1019" # TODO(fix) Using a deprecated function, variable, constant or field - -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 - -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isnt allowed
stylecheck: stylecheck:
checks: 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: 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-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 fix: fix-bom fix-lint
./scripts/fix.sh ./scripts/fix.sh
@ -132,6 +132,10 @@ verify-genproto:
verify-goimport: verify-goimport:
PASSES="goimport" ./scripts/test.sh PASSES="goimport" ./scripts/test.sh
.PHONY: verify-yamllint
verify-yamllint:
yamllint .
# Cleanup # Cleanup
clean: clean:

View File

@ -1,17 +1,16 @@
---
codecov: codecov:
token: "6040de41-c073-4d6f-bbf8-d89256ef31e1" token: 6040de41-c073-4d6f-bbf8-d89256ef31e1
disable_default_path_fixes: true disable_default_path_fixes: true
fixes: fixes:
- "go.etcd.io/etcd/api/v3/::api/" - go.etcd.io/etcd/api/v3/::api/
- "go.etcd.io/etcd/client/v3/::client/v3/" - go.etcd.io/etcd/client/v3/::client/v3/
- "go.etcd.io/etcd/client/v2/::client/v2/" - go.etcd.io/etcd/client/v2/::client/v2/
- "go.etcd.io/etcd/etcdctl/v3/::etcdctl/" - go.etcd.io/etcd/etcdctl/v3/::etcdctl/
- "go.etcd.io/etcd/pkg/v3/::pkg/" - go.etcd.io/etcd/pkg/v3/::pkg/
- "go.etcd.io/etcd/server/v3/::server/" - go.etcd.io/etcd/server/v3/::server/
ignore: ignore:
- "**/*.pb.go" - '**/*.pb.go'
- "**/*.pb.gw.go" - '**/*.pb.gw.go'
- "tests/**/*" - tests/**/*
- "go.etcd.io/etcd/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 evaluation_interval: 1m
tests: tests:
- interval: 1m - interval: 1m
input_series: input_series:
- series: 'up{job="etcd",instance="10.10.10.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' 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"}' - 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' 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"}' - 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' values: 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test: alert_rule_test:
- eval_time: 3m - eval_time: 3m
alertname: etcdInsufficientMembers alertname: etcdInsufficientMembers
@ -27,7 +25,7 @@ tests:
severity: critical severity: critical
exp_annotations: exp_annotations:
description: 'etcd cluster "etcd": members are down (3).' description: 'etcd cluster "etcd": members are down (3).'
summary: 'etcd cluster members are down.' summary: etcd cluster members are down.
- eval_time: 7m - eval_time: 7m
alertname: etcdInsufficientMembers alertname: etcdInsufficientMembers
- eval_time: 11m - eval_time: 11m
@ -38,7 +36,7 @@ tests:
severity: critical severity: critical
exp_annotations: exp_annotations:
description: 'etcd cluster "etcd": insufficient members (1).' 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 - eval_time: 15m
alertname: etcdInsufficientMembers alertname: etcdInsufficientMembers
exp_alerts: exp_alerts:
@ -47,16 +45,15 @@ tests:
severity: critical severity: critical
exp_annotations: exp_annotations:
description: 'etcd cluster "etcd": insufficient members (0).' 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 - interval: 1m
input_series: input_series:
- series: 'up{job="etcd",instance="10.10.10.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' 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"}' - 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' 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"}' - 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' values: 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test: alert_rule_test:
- eval_time: 14m - eval_time: 14m
alertname: etcdMembersDown alertname: etcdMembersDown
@ -66,16 +63,15 @@ tests:
severity: critical severity: critical
exp_annotations: exp_annotations:
description: 'etcd cluster "etcd": members are down (3).' description: 'etcd cluster "etcd": members are down (3).'
summary: 'etcd cluster members are down.' summary: etcd cluster members are down.
- interval: 1m - interval: 1m
input_series: input_series:
- series: 'up{job="etcd",instance="10.10.10.0"}' - 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' 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"}' - 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' 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"}' - 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' values: 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
alert_rule_test: alert_rule_test:
- eval_time: 13m - eval_time: 13m
alertname: etcdMembersDown alertname: etcdMembersDown
@ -85,16 +81,15 @@ tests:
severity: critical severity: critical
exp_annotations: exp_annotations:
description: 'etcd cluster "etcd": members are down (1).' description: 'etcd cluster "etcd": members are down (1).'
summary: 'etcd cluster members are down.' summary: etcd cluster members are down.
- interval: 1m - interval: 1m
input_series: input_series:
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.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' 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"}' - 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' 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"}' - 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' values: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test: alert_rule_test:
- eval_time: 10m - eval_time: 10m
alertname: etcdHighNumberOfLeaderChanges alertname: etcdHighNumberOfLeaderChanges
@ -103,62 +98,69 @@ tests:
job: etcd job: etcd
severity: warning severity: warning
exp_annotations: 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.' description: 'etcd cluster "etcd": 4 leader changes within the last
summary: 'etcd cluster has high number of leader changes.' 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 - interval: 1m
input_series: input_series:
- series: 'etcd_server_leader_changes_seen_total{job="etcd",instance="10.10.10.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' 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"}' - 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' 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"}' - 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' values: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
alert_rule_test: alert_rule_test:
- eval_time: 10m - eval_time: 10m
alertname: etcdHighNumberOfLeaderChanges alertname: etcdHighNumberOfLeaderChanges
exp_alerts: exp_alerts:
- interval: 1m - interval: 1m
input_series: input_series:
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}' - series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}
values: '0+8192x240' values: 0+8192x240
- series: 'etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.0"}' - series: etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.0"}
values: '524288+0x240' values: 524288+0x240
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}' - series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}
values: '0+1024x240' values: 0+1024x240
- series: 'etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.1"}' - series: etcd_server_quota_backend_bytes{job="etcd",instance="10.10.10.1"}
values: '524288+0x240' values: 524288+0x240
alert_rule_test: alert_rule_test:
- eval_time: 11m - eval_time: 11m
alertname: etcdExcessiveDatabaseGrowth alertname: etcdExcessiveDatabaseGrowth
exp_alerts: exp_alerts:
- exp_labels: - exp_labels:
instance: '10.10.10.0' instance: 10.10.10.0
job: etcd job: etcd
severity: warning severity: warning
exp_annotations: 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.' description: 'etcd cluster "etcd": Predicting running out of disk space
summary: 'etcd cluster database growing very fast.' 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 - interval: 1m
input_series: input_series:
- series: 'etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.0"}' - series: etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.0"}
values: '300000000+0x10' values: 300000000+0x10
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}' - series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.0"}
values: '1000000000+0x10' values: 1000000000+0x10
- series: 'etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.1"}' - series: etcd_mvcc_db_total_size_in_use_in_bytes{job="etcd",instance="10.10.10.1"}
values: '700000000+0x10' values: 700000000+0x10
- series: 'etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}' - series: etcd_mvcc_db_total_size_in_bytes{job="etcd",instance="10.10.10.1"}
values: '1000000000+0x10' values: 1000000000+0x10
alert_rule_test: alert_rule_test:
- eval_time: 11m - eval_time: 11m
alertname: etcdDatabaseHighFragmentationRatio alertname: etcdDatabaseHighFragmentationRatio
exp_alerts: exp_alerts:
- exp_labels: - exp_labels:
instance: '10.10.10.0' instance: 10.10.10.0
job: etcd job: etcd
severity: warning severity: warning
exp_annotations: 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 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 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: etcd-client name: etcd-client
spec: spec:
ports: ports:
- name: etcd-client-port - name: etcd-client-port
port: 2379 port: 2379
protocol: TCP protocol: TCP
targetPort: 2379 targetPort: 2379
selector: selector:
app: etcd app: etcd
--- ---
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
@ -22,35 +21,33 @@ metadata:
name: etcd0 name: etcd0
spec: spec:
containers: containers:
- command: - command:
- /usr/local/bin/etcd - /usr/local/bin/etcd
- --name - --name
- etcd0 - etcd0
- --initial-advertise-peer-urls - --initial-advertise-peer-urls
- http://etcd0:2380 - http://etcd0:2380
- --listen-peer-urls - --listen-peer-urls
- http://0.0.0.0:2380 - http://0.0.0.0:2380
- --listen-client-urls - --listen-client-urls
- http://0.0.0.0:2379 - http://0.0.0.0:2379
- --advertise-client-urls - --advertise-client-urls
- http://etcd0:2379 - http://etcd0:2379
- --initial-cluster - --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380 - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state - --initial-cluster-state
- new - new
image: quay.io/coreos/etcd:latest image: quay.io/coreos/etcd:latest
name: etcd0 name: etcd0
ports: ports:
- containerPort: 2379 - containerPort: 2379
name: client name: client
protocol: TCP protocol: TCP
- containerPort: 2380 - containerPort: 2380
name: server name: server
protocol: TCP protocol: TCP
restartPolicy: Always restartPolicy: Always
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -59,19 +56,17 @@ metadata:
name: etcd0 name: etcd0
spec: spec:
ports: ports:
- name: client - name: client
port: 2379 port: 2379
protocol: TCP protocol: TCP
targetPort: 2379 targetPort: 2379
- name: server - name: server
port: 2380 port: 2380
protocol: TCP protocol: TCP
targetPort: 2380 targetPort: 2380
selector: selector:
etcd_node: etcd0 etcd_node: etcd0
--- ---
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
@ -81,35 +76,33 @@ metadata:
name: etcd1 name: etcd1
spec: spec:
containers: containers:
- command: - command:
- /usr/local/bin/etcd - /usr/local/bin/etcd
- --name - --name
- etcd1 - etcd1
- --initial-advertise-peer-urls - --initial-advertise-peer-urls
- http://etcd1:2380 - http://etcd1:2380
- --listen-peer-urls - --listen-peer-urls
- http://0.0.0.0:2380 - http://0.0.0.0:2380
- --listen-client-urls - --listen-client-urls
- http://0.0.0.0:2379 - http://0.0.0.0:2379
- --advertise-client-urls - --advertise-client-urls
- http://etcd1:2379 - http://etcd1:2379
- --initial-cluster - --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380 - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state - --initial-cluster-state
- new - new
image: quay.io/coreos/etcd:latest image: quay.io/coreos/etcd:latest
name: etcd1 name: etcd1
ports: ports:
- containerPort: 2379 - containerPort: 2379
name: client name: client
protocol: TCP protocol: TCP
- containerPort: 2380 - containerPort: 2380
name: server name: server
protocol: TCP protocol: TCP
restartPolicy: Always restartPolicy: Always
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -118,19 +111,17 @@ metadata:
name: etcd1 name: etcd1
spec: spec:
ports: ports:
- name: client - name: client
port: 2379 port: 2379
protocol: TCP protocol: TCP
targetPort: 2379 targetPort: 2379
- name: server - name: server
port: 2380 port: 2380
protocol: TCP protocol: TCP
targetPort: 2380 targetPort: 2380
selector: selector:
etcd_node: etcd1 etcd_node: etcd1
--- ---
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
@ -140,35 +131,33 @@ metadata:
name: etcd2 name: etcd2
spec: spec:
containers: containers:
- command: - command:
- /usr/local/bin/etcd - /usr/local/bin/etcd
- --name - --name
- etcd2 - etcd2
- --initial-advertise-peer-urls - --initial-advertise-peer-urls
- http://etcd2:2380 - http://etcd2:2380
- --listen-peer-urls - --listen-peer-urls
- http://0.0.0.0:2380 - http://0.0.0.0:2380
- --listen-client-urls - --listen-client-urls
- http://0.0.0.0:2379 - http://0.0.0.0:2379
- --advertise-client-urls - --advertise-client-urls
- http://etcd2:2379 - http://etcd2:2379
- --initial-cluster - --initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380 - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- --initial-cluster-state - --initial-cluster-state
- new - new
image: quay.io/coreos/etcd:latest image: quay.io/coreos/etcd:latest
name: etcd2 name: etcd2
ports: ports:
- containerPort: 2379 - containerPort: 2379
name: client name: client
protocol: TCP protocol: TCP
- containerPort: 2380 - containerPort: 2380
name: server name: server
protocol: TCP protocol: TCP
restartPolicy: Always restartPolicy: Always
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
@ -177,13 +166,13 @@ metadata:
name: etcd2 name: etcd2
spec: spec:
ports: ports:
- name: client - name: client
port: 2379 port: 2379
protocol: TCP protocol: TCP
targetPort: 2379 targetPort: 2379
- name: server - name: server
port: 2380 port: 2380
protocol: TCP protocol: TCP
targetPort: 2380 targetPort: 2380
selector: selector:
etcd_node: etcd2 etcd_node: etcd2

View File

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