Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dependencies and go version #8

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
70d2576
Bump github.com/emicklei/go-restful
dependabot[bot] Feb 9, 2023
39adca8
Updated dependencies and go version
cin Jul 5, 2023
cdc06d6
add dev container files and setups
R-HNF Aug 2, 2023
608219f
add comments to devcontainer.json
R-HNF Aug 2, 2023
3b450f6
specify directory instead using $HOME
R-HNF Aug 2, 2023
fad4bee
support multi platform
R-HNF Aug 2, 2023
8f6471c
add comments to devcontainer.json
R-HNF Aug 3, 2023
78d0cd5
add comment to Makefile
R-HNF Aug 3, 2023
0e7b54e
update comments on Dockerfile.dev
R-HNF Aug 3, 2023
503bbf1
add extensions to devcontainer.json
R-HNF Aug 3, 2023
7416926
add trailing new line
R-HNF Aug 3, 2023
cdbac06
add trailing new line
R-HNF Aug 3, 2023
0513e62
update comment
R-HNF Aug 4, 2023
c0521e5
Merge remote-tracking branch 'av/main' into update-dependencies
cin Aug 16, 2023
b9050f0
Updated dependencies
cin Aug 16, 2023
c370713
Add: build-guide.md using Makefile
itiB Aug 22, 2023
ea6190b
remove unnecessary line breaks
R-HNF Aug 22, 2023
01c29a3
Upgrade gatling
gold-kou Aug 15, 2023
4cfe457
fix saving kubectl config
R-HNF Aug 22, 2023
a28ec1f
Add: TOC
itiB Aug 22, 2023
3e0137a
use env variable
R-HNF Aug 24, 2023
9342f69
use ifeq to conditional statements
R-HNF Aug 24, 2023
fe69616
fix: Corrected grammar in documentation
itiB Aug 29, 2023
a2c6a81
fix: README.md link
itiB Aug 29, 2023
6950b4c
Merge pull request #91 from itiB/feature/#89-makefile-doc
R-HNF Sep 5, 2023
17bfcfd
Merge pull request #90 from R-HNF/add-docker-dev-env
R-HNF Sep 5, 2023
7d28b3f
Merge pull request #69 from st-tech/dependabot/go_modules/github.com/…
itiB Sep 26, 2023
1bc64df
Fix Dockerfile
gold-kou Sep 28, 2023
da6bc34
Delete libc6-dev
gold-kou Oct 3, 2023
1cde976
Merge pull request #96 from gold-kou/update_gatling
gold-kou Oct 10, 2023
d6436ab
add daily-vul-scan.yml
R-HNF Oct 3, 2023
20d232b
add tested workflow and trivy result template
R-HNF Oct 15, 2023
e772bd5
fix badge link
R-HNF Oct 18, 2023
a49cd04
add branch parameter to badge link
R-HNF Oct 18, 2023
cda4144
move template file
R-HNF Oct 18, 2023
dec98bb
change workflow trigger to cron
R-HNF Oct 18, 2023
91e13dc
fix link
R-HNF Oct 18, 2023
83f321c
fix job name
R-HNF Oct 27, 2023
ab8f154
fix template
R-HNF Oct 30, 2023
4b89ab8
Merge pull request #100 from R-HNF/feature/#45-add-daily-vul-scan
R-HNF Oct 30, 2023
ae615c8
Update go version
gold-kou Jan 24, 2024
a2ad969
Merge pull request #103 from gold-kou/update_go
gold-kou Feb 7, 2024
6db24c3
Revert "Update go version to 1.21"
gold-kou Feb 7, 2024
64fb2ba
Merge pull request #104 from st-tech/revert-103-update_go
gold-kou Feb 7, 2024
9f6f582
Updated dependencies
cin Feb 9, 2024
d94705d
Updated dependencies
cin Feb 9, 2024
b50ff75
Update CI for AirVantage build/publish (#1)
cin May 12, 2023
66409db
Added version checks (#2)
cin May 12, 2023
92ea320
Fixing CI
cin May 12, 2023
401d23a
Fixing CI
cin May 12, 2023
eb68b60
Fixing CI
cin May 12, 2023
29861c5
Removing arm support for now
cin May 12, 2023
fd9ebb5
Applying build action context
cin May 12, 2023
fafb286
Bump golang.org/x/sys from 0.0.0-20220209214540-3681064d5158 to 0.1.0…
dependabot[bot] Jul 5, 2023
7b2f302
Bump github.com/emicklei/go-restful (#5)
dependabot[bot] Jul 5, 2023
7893005
Bump golang.org/x/crypto from 0.0.0-20220214200702-86341886e292 to 0.…
dependabot[bot] Jul 5, 2023
fa42860
Bump golang.org/x/net from 0.0.0-20220127200216-cd36cc0744dd to 0.7.0…
dependabot[bot] Jul 5, 2023
8b7b771
Updated dependencies and go version
cin Jul 5, 2023
0a3f02e
Updated dependencies
cin Aug 16, 2023
6ada9fe
Updated dependencies
cin Feb 9, 2024
9246218
Updated dependencies
cin Feb 9, 2024
85e69e2
Merge branch 'update-dependencies' of github.com:AirVantage/gatling-o…
cin Feb 9, 2024
4f78de2
Merged main
cin Feb 9, 2024
8b480aa
Removed old controller-gen options
cin Feb 12, 2024
cca2954
Dockerfile updates as well as kustomize version updates
cin Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Gatling Operator Dev Container",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile.dev"
},
"mounts": [
// Mount the host's Docker socket.
// Official document: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"runArgs": [
"--name=gatling-operator-dev-container",
"--hostname=gatling-operator-dev-container",
// Set network mode to host to communicate with other containers.
"--network=host"
],
"containerEnv": {
"IN_DEV_CONTAINER": "true"
},
// Restore the local kubectl config to a dev container.
"postStartCommand": "if [ -d ${containerWorkspaceFolder}/.kube ]; then cp -r ${containerWorkspaceFolder}/.kube $HOME/.kube; fi",
"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker",
"mhutchie.git-graph"
]
}
}
}
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/trivy-results.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{ $d := dict "CRITICAL" "🔴" "HIGH" "🟠" "MEDIUM" "🟡" "UNKNOWN" "🟤" }}

{{- range . -}}
## {{ .Target }}

### {{ .Type }} [{{ .Class }}]

{{ if .Vulnerabilities -}}
| Title | Severity | CVE | Package Name | Installed Version | Fixed Version | PrimaryURL |
| :--: | :--: | :--: | :--: | :--: | :--: | :-- |
{{- range .Vulnerabilities }}
| {{ .Title -}}
| {{ get $d .Severity }}{{ .Severity -}}
| {{ .VulnerabilityID -}}
| {{ .PkgName -}}
| {{ .InstalledVersion -}}
| {{ .FixedVersion -}}
| {{ .PrimaryURL -}}
|
{{- end }}

{{ else -}}
_No vulnerabilities found_

{{ end }}

{{- end }}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.17'
go-version: '1.21'

- run: go version

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.17'
go-version: '1.20'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/daily-vul-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: daily vulnerability scan

on:
schedule:
- cron: '0 0 * * *'

env:
IMAGE_NAME: zozo-gatling-operator
TRIVY_RESULTS_MARKDOWN: trivy-results.md

permissions:
contents: read
issues: write

jobs:
build-scan-and-save-results:
name: Build, scan, and save results
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
cache: true

- name: Go modules sync
run: go mod tidy

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build an image from Dockerfile
run: |
make docker-build IMG="${{ env.IMAGE_NAME }}:${{ github.sha }}"

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: image
image-ref: "${{ env.IMAGE_NAME }}:${{ github.sha }}"
exit-code: 1
ignore-unfixed: true
vuln-type: os,library
severity: HIGH,CRITICAL
timeout: 10m0s
scanners: vuln,secret,config
format: template
template: "@.github/ISSUE_TEMPLATE/trivy-results.tpl"
output: ${{ env.TRIVY_RESULTS_MARKDOWN }}

- name: Insert YAML front matter into the results markdown
if: always()
run: |
sed -i '1i\
---\
title: "[DO NOT CHANGE] Security Alert"\
labels: "trivy, vulnerability"\
---\
' "${{ env.TRIVY_RESULTS_MARKDOWN }}"

- name: Create or update the trivy results issue
uses: JasonEtco/create-an-issue@v2
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: ${{ env.TRIVY_RESULTS_MARKDOWN }}
update_existing: true
search_existing: open
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ testbin/*
# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*
.kube

# editor and IDE paraphernalia
.idea
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"devcontainer"
]
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.21 as builder

ARG TARGETARCH
ARG TARGETOS
Expand All @@ -19,7 +19,7 @@ COPY controllers/ controllers/
COPY pkg/ pkg/

# Build
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$(dpkg --print-architecture) go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
53 changes: 53 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ubuntu:22.04

ENV GO_VERSION 1.21.7
ENV KUBECTL_VERSION v1.25.8

# KEEP the value as arm64.
# This environment variable is for arm64, but should be left as is for any architecture
# References:
# https://github.com/etcd-io/etcd/issues/10677
# https://github.com/k0sproject/k0s/issues/424
ENV ETCD_UNSUPPORTED_ARCH arm64

# Development tools
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
wget \
git \
make \
gcc

# Docker CLI
# Referring to https://docs.docker.com/engine/install/ubuntu/#installation-methods
RUN apt-get install -y \
ca-certificates \
curl \
gnupg \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "${VERSION_CODENAME}")" stable" \
| tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update && apt-get install -y \
docker-ce-cli

# kubectl
# Referring to https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/
RUN curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/"$(dpkg --print-architecture)"/kubectl" \
&& chmod +x ./kubectl \
&& mv ./kubectl /usr/local/bin/kubectl

# golang
# Referring to https://go.dev/doc/install
RUN wget "https://go.dev/dl/go${GO_VERSION}.linux-"$(dpkg --print-architecture)".tar.gz" \
&& tar -C /usr/local -xzf "go${GO_VERSION}.linux-"$(dpkg --print-architecture)".tar.gz"
ENV PATH "${PATH}:/usr/local/go/bin"
ENV PATH "${PATH}:/root/go/bin"

# kind
# References:
# https://github.com/kind-ci/examples/blob/master/.github/workflows/kind.yml
# https://kind.sigs.k8s.io/docs/user/resources/
RUN GO111MODULE=on go install sigs.k8s.io/kind@latest
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ SAMPLE_IMG := gatling:$(IMAGE_TAG)
# Release version
VERSION := latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
CRD_OPTIONS ?= "crd"
KIND_CLUSTER_NAME ?= "gatling-cluster"
K8S_NODE_IMAGE ?= v1.25.8
KUSTOMIZE_VERSION ?= v5.0.1
KUSTOMIZE_VERSION ?= v5.3.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand All @@ -27,7 +27,8 @@ SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
KIND_CONFIG_DIR=$(shell pwd)/config/kind
KIND_CLUSTER_CONFIG_DIR=$(shell pwd)/config/kind
KUBECONFIG_BACKUP_DIR=$(shell pwd)/.kube

all: build

Expand All @@ -47,12 +48,16 @@ all: build
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

kind-create: ## Create a kind cluster named ${KIND_CLUSTER_NAME} locally if necessary
kind-create: ## Create a kind cluster named ${KIND_CLUSTER_NAME} locally if necessary and save the kubectl config.
ifeq (1, $(shell kind get clusters | grep ${KIND_CLUSTER_NAME} | wc -l | tr -d ' '))
@echo "Cluster already exists"
else
@echo "Creating Cluster"
kind create cluster --name ${KIND_CLUSTER_NAME} --image=kindest/node:${K8S_NODE_IMAGE} --config ${KIND_CONFIG_DIR}/cluster.yaml
kind create cluster --name ${KIND_CLUSTER_NAME} --image=kindest/node:${K8S_NODE_IMAGE} --config ${KIND_CLUSTER_CONFIG_DIR}/cluster.yaml
ifeq ($(IN_DEV_CONTAINER), true)
@echo "kubeconfig backup =>"
mkdir -p ${KUBECONFIG_BACKUP_DIR} && kind get kubeconfig --name ${KIND_CLUSTER_NAME} > ${KUBECONFIG_BACKUP_DIR}/kind-conifg.yaml
endif
endif

##@ Development
Expand Down Expand Up @@ -135,7 +140,7 @@ LOCALBIN ?= $(shell pwd)/bin

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Gatling Operator

[![Go Report Card](https://goreportcard.com/badge/github.com/st-tech/gatling-operator)](https://goreportcard.com/report/github.com/st-tech/gatling-operator) [![CI](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/st-tech/gatling-operator)
[![Go Report Card](https://goreportcard.com/badge/github.com/st-tech/gatling-operator)](https://goreportcard.com/report/github.com/st-tech/gatling-operator) [![CI](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml) [![daily vulnerability scan](https://github.com/st-tech/gatling-operator/actions/workflows/daily-vul-scan.yml/badge.svg?branch=main)](https://github.com/st-tech/gatling-operator/actions/workflows/daily-vul-scan.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/st-tech/gatling-operator)

[Gatling](https://gatling.io/) is an open source load testing tool that allows to analyze and measure the performance of a variety of services. [Gatling Operator](https://github.com/st-tech/gatling-operator) is a Kubernetes Operator for running automated distributed Gatling load testing.
[Gatling](https://gatling.io/) is an open source load testing tool that allows to analyze and measure the performance of a variety of services. [Gatling Operator](https://github.com/airvantage/gatling-operator) is a Kubernetes Operator for running automated distributed Gatling load testing.

## How Gatling Operator works

Expand All @@ -19,7 +19,7 @@ The desired state of a distributed Gatling load testing is described through a K
- Horizontal scaling: number of pods running in parallel during a load testing can be configured
- Vertical scaling: CPU and RAM resource allocation for Gatling runner Pod can be configured
- Allows Gatling load testing to start running at a specific time
- By default, the Gatling load testing starts running as soon as the runner Pod's init container gets ready. By specifing the start time, the Gatling load testing waits to start running until the specified time
- By default, the Gatling load testing starts running as soon as the runner Pod's init container gets ready. By specifying the start time, the Gatling load testing waits to start running until the specified time
- Gatling Pod attributions
- Gatling runtime container image
- [rclone](https://rclone.org/) container image
Expand All @@ -36,23 +36,25 @@ The desired state of a distributed Gatling load testing is described through a K

## Requirements

- Kubernetes: version >= 1.18
- Kubernetes: version >= 1.20

> note: the versions below 1.18 might work but are not tested
> note: the versions below 1.20 might work but are not tested

## Quick Start

- [Quick Start Guide](docs/quickstart-guide.md)

## Documentations

- [Architecture](docs/architecture.md)
- [Gatling CRD Reference](docs/api.md)
- [User Guide](docs/user-guide.md)
- [How to build Gatling Operator](docs/build-guide.md)

## Contributing

Please make a GitHub issue or pull request to help us build the operator.

## Changelog

Please see the [list of releases](https://github.com/st-tech/gatling-operator/releases) for information on changes between releases.
Please see the [list of releases](https://github.com/airvantage/gatling-operator/releases) for information on changes between releases.
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading