Skip to content

Commit

Permalink
Merge branch 'takuyaymd-feature/gateway-lb/add-default-backend-flag' of
Browse files Browse the repository at this point in the history
https://github.com/takuyaymd/vald into takuyaymd-feature/gateway-lb/add-default-backend-flag
  • Loading branch information
takuyaymd committed May 25, 2023
2 parents ed6046c + d912518 commit 57da0e8
Show file tree
Hide file tree
Showing 48 changed files with 1,916 additions and 598 deletions.
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enabled = true

[[analyzers]]
name = "test-coverage"
enabled = true
enabled = false

[[transformers]]
name = "gofumpt"
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-agent-ngt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-agent-sidecar-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-ci-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-dev-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-discoverer-k8s-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-gateway-filter-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-gateway-lb-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-helm-operator-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-loadtest-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/dockers-manager-index-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
steps:
- name: Get ref
id: ref
run: |
if [ ${{ github.event.pull_request.head.sha }} != "" ]; then
echo ref=${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
with:
ref: ${{ steps.ref.outputs.ref }}
- name: set git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/e2e-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
version: latest
name: vald
agents: 3
options: "--image docker.io/rancher/k3s:v1.23.5-rc1-k3s1"
options: "--image docker.io/rancher/k3s:latest"
- name: check k3d
run: |
kubectl cluster-info
Expand All @@ -110,8 +110,8 @@ jobs:
wait_for_selector: app=vald-lb-gateway
- name: deploy Chaos Mesh
run: |
make kubectl/install/linux/v1.23.6
curl -sSL https://mirrors.chaos-mesh.org/v2.4.1/install.sh | bash -s -- --k3s
make kubectl/install
curl -sSL "https://mirrors.chaos-mesh.org/v$(cat versions/CHAOS_MESH_VERSION)/install.sh" | bash -s -- --k3s
helm install \
--set podChaos.failure.enabled=true \
vald-chaos-test tests/chaos/chart
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
version: latest
name: vald
agents: 3
options: "--image docker.io/rancher/k3s:v1.23.5-rc1-k3s1"
options: "--image docker.io/rancher/k3s:latest"
- name: check k3d
run: |
kubectl cluster-info
Expand All @@ -204,8 +204,8 @@ jobs:
wait_for_selector: app=vald-lb-gateway
- name: deploy Chaos Mesh
run: |
make kubectl/install/linux/v1.23.6
curl -sSL https://mirrors.chaos-mesh.org/v2.4.1/install.sh | bash -s -- --k3s
make kubectl/install
curl -sSL "https://mirrors.chaos-mesh.org/v$(cat versions/CHAOS_MESH_VERSION)/install.sh" | bash -s -- --k3s
helm install \
--set podChaos.kill.enabled=true \
vald-chaos-test tests/chaos/chart
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
version: latest
name: vald
agents: 3
options: "--image docker.io/rancher/k3s:v1.23.5-rc1-k3s1"
options: "--image docker.io/rancher/k3s:latest"
- name: check k3d
run: |
kubectl cluster-info
Expand All @@ -298,8 +298,8 @@ jobs:
wait_for_selector: app=vald-lb-gateway
- name: deploy Chaos Mesh
run: |
make kubectl/install/linux/v1.23.6
curl -sSL https://mirrors.chaos-mesh.org/v2.4.1/install.sh | bash -s -- --k3s
make kubectl/install
curl -sSL "https://mirrors.chaos-mesh.org/v$(cat versions/CHAOS_MESH_VERSION)/install.sh" | bash -s -- --k3s
helm install \
--set networkChaos.partition.enabled=true \
vald-chaos-test tests/chaos/chart
Expand Down Expand Up @@ -372,7 +372,7 @@ jobs:
version: latest
name: vald
agents: 3
options: "--image docker.io/rancher/k3s:v1.23.5-rc1-k3s1"
options: "--image docker.io/rancher/k3s:latest"
- name: check k3d
run: |
kubectl cluster-info
Expand All @@ -392,8 +392,8 @@ jobs:
wait_for_selector: app=vald-lb-gateway
- name: deploy Chaos Mesh
run: |
make kubectl/install/linux/v1.23.6
curl -sSL https://mirrors.chaos-mesh.org/v2.4.1/install.sh | bash -s -- --k3s
make kubectl/install
curl -sSL "https://mirrors.chaos-mesh.org/v$(cat versions/CHAOS_MESH_VERSION)/install.sh" | bash -s -- --k3s
helm install \
--set networkChaos.bandwidth.enabled=true \
vald-chaos-test tests/chaos/chart
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update_pull_request_and_issue_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
sed -i -e "s/^- NGT Version: .*$/- NGT Version: ${NGT_VERSION}/" .github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- NGT Version: .*$/- NGT Version: ${NGT_VERSION}/" .github/PULL_REQUEST_TEMPLATE.md
sed -i -e "s/^- Kubernetes Version: .*$/- Kubernetes Version: ${KUBECTL_VERSION}/" .github/ISSUE_TEMPLATE/bug_report.md
sed -i -e "s/^- Kubernetes Version: .*$/- Kubernetes Version: ${KUBECTL_VERSION}/" .github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- Kubernetes Version: .*$/- Kubernetes Version: ${KUBECTL_VERSION}/" .github/PULL_REQUEST_TEMPLATE.md
git add .github/PULL_REQUEST_TEMPLATE.md .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/security_issue_report.md
git commit -S --signoff -m ":robot: Automatically update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE"
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ HELM_DOCS_VERSION := $(eval HELM_DOCS_VERSION := $(shell cat versions/HE
HELM_VERSION := $(eval HELM_VERSION := $(shell cat versions/HELM_VERSION))$(HELM_VERSION)
JAEGER_OPERATOR_VERSION := $(eval JAEGER_OPERATOR_VERSION := $(shell cat versions/JAEGER_OPERATOR_VERSION))$(JAEGER_OPERATOR_VERSION)
KIND_VERSION := $(eval KIND_VERSION := $(shell cat versions/KIND_VERSION))$(KIND_VERSION)
KUBECTL_VERSION := $(eval KUBECTL_VERSION := $(shell cat versions/KUBECTL_VERSION))$(KUBECTL_VERSION)
KUBELINTER_VERSION := $(eval KUBELINTER_VERSION := $(shell cat versions/KUBELINTER_VERSION))$(KUBELINTER_VERSION)
OTEL_OPERATOR_VERSION := $(eval OTEL_OPERATOR_VERSION := $(shell cat versions/OTEL_OPERATOR_VERSION))$(OTEL_OPERATOR_VERSION)
PROMETHEUS_STACK_VERSION := $(eval PROMETHEUS_STACK_VERSION := $(shell cat versions/PROMETHEUS_STACK_VERSION))$(PROMETHEUS_STACK_VERSION)
Expand All @@ -76,7 +77,8 @@ SWAP_TAG ?= latest

BINDIR ?= /usr/local/bin

UNAME := $(eval UNAME := $(shell uname))$(UNAME)
UNAME := $(eval UNAME := $(shell uname -s))$(UNAME)
ARCH := $(eval ARCH := $(shell uname -m))$(ARCH)
PWD := $(eval PWD := $(shell pwd))$(PWD)

ifeq ($(UNAME),Linux)
Expand Down
12 changes: 12 additions & 0 deletions Makefile.d/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
.PHONY: update/libs
## update vald libraries including tools
update/libs: \
update/chaos-mesh \
update/go \
update/golangci-lint \
update/helm \
update/helm-docs \
update/helm-operator \
update/jaeger-operator \
update/kind \
update/kubectl \
update/kube-linter \
update/ngt \
update/prometheus-stack \
Expand Down Expand Up @@ -66,6 +68,11 @@ go/example/deps:
cp $(ROOTDIR)/example/client/go.mod.default $(ROOTDIR)/example/client/go.mod
cd $(ROOTDIR)/example/client && GOPRIVATE=$(GOPRIVATE) go mod tidy && cd -

.PHONY: update/chaos-mesh
## update chaos-mesh version
update/chaos-mesh:
curl --silent https://api.github.com/repos/chaos-mesh/chaos-mesh/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' > $(ROOTDIR)/versions/CHAOS_MESH_VERSION

.PHONY: update/go
## update go version
update/go:
Expand Down Expand Up @@ -101,6 +108,11 @@ update/protobuf:
update/kind:
curl --silent https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' > $(ROOTDIR)/versions/KIND_VERSION

.PHONY: update/kubectl
## update kubectl (kubernetes cli) version
update/kubectl:
curl -L -s https://dl.k8s.io/release/stable.txt > $(ROOTDIR)/versions/KUBECTL_VERSION

.PHONY: update/prometheus-stack
## update prometheus version
update/prometheus-stack:
Expand Down
27 changes: 4 additions & 23 deletions Makefile.d/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,12 @@ $(BINDIR)/helm:
## install helm-docs
helm-docs/install: $(BINDIR)/helm-docs

ifeq ($(UNAME),Darwin)
$(BINDIR)/helm-docs:
mkdir -p $(BINDIR)
cd $(TEMP_DIR) \
&& curl -LO https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_Darwin_x86_64.tar.gz \
&& tar xzvf helm-docs_$(HELM_DOCS_VERSION)_Darwin_x86_64.tar.gz \
&& curl -LO https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_$(UNAME)_$(ARCH).tar.gz \
&& tar xzvf helm-docs_$(HELM_DOCS_VERSION)_$(UNAME)_$(ARCH).tar.gz \
&& mv helm-docs $(BINDIR)/helm-docs
else
$(BINDIR)/helm-docs:
mkdir -p $(BINDIR)
cd $(TEMP_DIR) \
&& curl -LO https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_Linux_x86_64.tar.gz \
&& tar xzvf helm-docs_$(HELM_DOCS_VERSION)_Linux_x86_64.tar.gz \
&& mv helm-docs $(BINDIR)/helm-docs
endif

.PHONY: helm/package/vald
## packaging Helm chart for Vald
Expand Down Expand Up @@ -103,21 +94,11 @@ charts/vald-helm-operator/values.schema.json: \
## install yq
yq/install: $(BINDIR)/yq

ifeq ($(UNAME),Darwin)
$(BINDIR)/yq:
mkdir -p $(BINDIR)
cd $(TEMP_DIR) \
&& curl -Lo yq https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_darwin_amd64 \
&& chmod a+x yq \
&& mv yq $(BINDIR)/yq
else
$(BINDIR)/yq:
mkdir -p $(BINDIR)
cd $(TEMP_DIR) \
&& curl -Lo yq https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_linux_amd64 \
&& chmod a+x yq \
&& mv yq $(BINDIR)/yq
endif
&& curl -L https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$(shell echo $(UNAME) | tr '[:upper:]' '[:lower:]')_$(subst x86_64,amd64,$(shell echo $(ARCH) | tr '[:upper:]' '[:lower:]')) -o $(BINDIR)/yq \
&& chmod a+x $(BINDIR)/yq

.PHONY: helm/schema/crd/vald
## generate OpenAPI v3 schema for ValdRelease
Expand Down
Loading

0 comments on commit 57da0e8

Please sign in to comment.