Skip to content

Commit

Permalink
feat: initial commit for the Kheper mock Kong Gateway data plane nodes
Browse files Browse the repository at this point in the history
- Simulates Kong Gateway data plane node connections to a control plane using
  multiple WebSocket protocols
  - Supports both standard and JSON RPC protocols
- Manages connections, pings, and configuration updates
- Enables communication with multiple control planes for
  cross-region/environment testing
- Offers simple configuration through YAML files or environment variables
- Exposes a RESTful API for inspecting the configuration of each node
- Supports the simulation of extensive network loads by creating thousands of
  mock Kong Gateway data plane nodes
- Compatible with both OSS and Enterprise versions of Kong Gateway
  • Loading branch information
mikefero committed Jul 3, 2024
0 parents commit 6e587d2
Show file tree
Hide file tree
Showing 43 changed files with 6,537 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lint
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
on:
push:
branches:
- main
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/lint.yml'
- 'docker/**'
- 'docs/**'
- 'mk/**'
- '.gitignore'
- 'kheper.yml'
- 'LICENSE'
- 'Makefile'
- 'README.md'
- 'version'
pull_request:
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/lint.yml'
- 'docker/**'
- 'docs/**'
- 'mk/**'
- '.gitignore'
- 'kheper.yml'
- 'LICENSE'
- 'Makefile'
- 'README.md'
- 'version'
permissions:
contents: read
pull-requests: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: install reodcly
run: npm install -g @redocly/cli@latest
- name: redocly-lint
run: redocly lint --config redocly.yml --format=github-actions openapi.yml
67 changes: 67 additions & 0 deletions .github/workflows/test_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Test
env:
KHEPER_TEST_WAIT_FOR: 500ms
KHEPER_TEST_WAIT_FOR_CAPTURE: 100ms
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true
on:
push:
branches:
- main
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/test_and_coverage.yml'
- 'docker/**'
- 'docs/**'
- 'mk/**'
- '.gitignore'
- '.golangci.yml'
- '.header'
- 'kheper.yml'
- 'LICENSE'
- 'Makefile'
- 'openapi.yml'
- 'README.md'
- 'redocly.yml'
- 'version'
pull_request:
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/test_and_coverage.yml'
- 'docker/**'
- 'docs/**'
- 'mk/**'
- '.gitignore'
- '.golangci.yml'
- '.header'
- 'kheper.yml'
- 'LICENSE'
- 'Makefile'
- 'openapi.yml'
- 'README.md'
- 'redocly.yml'
- 'version'
permissions:
contents: read
pull-requests: read
jobs:
test:
name: Test and Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
# TODO(fero): remove gofumpt after removing make test-coverage
- uses: luisnquin/setup-gofumpt@v2
- name: Test with Coverage
run: make test-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.out
name: kheper
token: ${{ secrets.CODECOV_TOKEN }}
slug: mikefero/kheper
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode
bin

coverage.html
coverage.out
54 changes: 54 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
run:
timeout: 5m

issues:
exclude-files:
- "_test.go"

linters-settings:
goheader:
values:
regexp:
COPYRIGHT-HOLDER: Copyright © {{ MOD-YEAR-RANGE }} Michael Fero
template-path: .header

linters:
enable:
- asciicheck
- bidichk
- decorder
- dogsled
- dupl
- errname
- errorlint
- exhaustive
- exportloopref
- forbidigo
- forcetypeassert
- gci
- goconst
- gocritic
- godot
- gofmt
- gofumpt
- goheader
- goimports
- goprintffuncname
- gosec
- grouper
- importas
- lll
- misspell
- nakedret
- nestif
- nilnil
- nolintlint
- prealloc
- predeclared
- revive
- stylecheck
- tenv
- thelper
- unconvert
- whitespace
- wrapcheck
13 changes: 13 additions & 0 deletions .header
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ COPYRIGHT-HOLDER }}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DEFAULT_GOAL := test

# Ensure golang is available
ifeq (, $(shell which go 2> /dev/null))
$(error "'go' is not installed or available in PATH")
endif

APP_NAME := kheper
APP_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
APP_WORKDIR := $(shell pwd)

include $(APP_DIR)/mk/build.mk
include $(APP_DIR)/mk/common.mk
include $(APP_DIR)/mk/docker.mk
include $(APP_DIR)/mk/test.mk
include $(APP_DIR)/mk/tools.mk
Loading

0 comments on commit 6e587d2

Please sign in to comment.