diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index bbbe9e17c..f3891d62e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,7 +12,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: -1. Run `mizu ...` +1. Run `kubeshark ...` 2. Click on '...' 3. Scroll down to '...' 4. See error @@ -22,10 +22,10 @@ A clear and concise description of what you expected to happen. **Logs** Upload logs: -1. Run the mizu command with `--set dump-logs=true` (e.g `mizu tap --set dump-logs=true`) +1. Run the kubeshark command with `--set dump-logs=true` (e.g `kubeshark tap --set dump-logs=true`) 2. Try to reproduce the issue -3. CTRL+C on terminal tab which runs `mizu` -4. Upload the logs zip file from `~/.mizu/mizu_logs_**.zip` +3. CTRL+C on terminal tab which runs `kubeshark` +4. Upload the logs zip file from `~/.kubeshark/kubeshark_logs_**.zip` **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/.github/workflows/acceptance_tests.yml b/.github/workflows/acceptance_tests.yml index 14ffaafd5..199dc0c51 100644 --- a/.github/workflows/acceptance_tests.yml +++ b/.github/workflows/acceptance_tests.yml @@ -9,7 +9,7 @@ on: - 'develop' env: - MIZU_CI_IMAGE: mizu/ci:0.0 + KUBESHARK_CI_IMAGE: kubeshark/ci:0.0 jobs: run-acceptance-tests: @@ -33,7 +33,7 @@ jobs: context: . push: false load: true - tags: ${{ env.MIZU_CI_IMAGE }} + tags: ${{ env.KUBESHARK_CI_IMAGE }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/acceptance_tests_on_pr.yml b/.github/workflows/acceptance_tests_on_pr.yml index d9ee4da0e..a70dc1730 100644 --- a/.github/workflows/acceptance_tests_on_pr.yml +++ b/.github/workflows/acceptance_tests_on_pr.yml @@ -3,7 +3,7 @@ name: Acceptance tests on PR on: push env: - MIZU_CI_IMAGE: mizu/ci:0.0 + KUBESHARK_CI_IMAGE: kubeshark/ci:0.0 concurrency: group: acceptance-tests-on-pr-${{ github.ref }} @@ -33,7 +33,7 @@ jobs: context: . push: false load: true - tags: ${{ env.MIZU_CI_IMAGE }} + tags: ${{ env.KUBESHARK_CI_IMAGE }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/build-custom-branch.yml b/.github/workflows/build-custom-branch.yml deleted file mode 100644 index f26059863..000000000 --- a/.github/workflows/build-custom-branch.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build Custom Branch - -on: push - -concurrency: - group: custom-branch-build-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Push custom branch image to GCR - runs-on: ubuntu-latest - if: ${{ contains(github.event.head_commit.message, '#build_and_publish_custom_image') }} - - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - - id: 'auth' - uses: 'google-github-actions/auth@v0' - with: - credentials_json: '${{ secrets.GCR_JSON_KEY }}' - - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v0' - - - name: Get base image name - shell: bash - run: echo "##[set-output name=image;]$(echo gcr.io/up9-docker-hub/mizu/${GITHUB_REF#refs/heads/})" - id: base_image_step - - - name: Login to GCR - uses: docker/login-action@v1 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GCR_JSON_KEY }} - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: ${{ steps.base_image_step.outputs.image }}:latest \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd9040de8..5b1f6a28d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: - 'main' concurrency: - group: mizu-pr-validation-${{ github.ref }} + group: kubeshark-pr-validation-${{ github.ref }} cancel-in-progress: true jobs: @@ -57,6 +57,6 @@ jobs: with: context: . push: false - tags: up9inc/mizu:devlatest + tags: kubeshark/kubeshark:devlatest cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8484dbd3..00bca0583 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: - 'main' concurrency: - group: mizu-publish-${{ github.ref }} + group: kubeshark-publish-${{ github.ref }} cancel-in-progress: true jobs: @@ -55,7 +55,7 @@ jobs: uses: docker/metadata-action@v3 with: images: | - up9inc/mizu + kubeshark/kubeshark tags: | type=raw,${{ steps.versioning.outputs.version }} type=raw,value=latest,enable=${{ steps.condval.outputs.value == 'stable' }} @@ -66,10 +66,10 @@ jobs: suffix=-${{ matrix.target }},onlatest=true - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASS }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 @@ -118,16 +118,16 @@ jobs: uses: docker/metadata-action@v3 with: images: | - up9inc/mizu + kubeshark/kubeshark tags: | type=raw,${{ steps.versioning.outputs.version }} type=raw,value=latest,enable=${{ steps.condval.outputs.value == 'stable' }} type=raw,value=dev-latest,enable=${{ steps.condval.outputs.value == 'dev' }} - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASS }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Create manifest run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f1191d106..4dff0deff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: - 'main' concurrency: - group: mizu-tests-validation-${{ github.ref }} + group: kubeshark-tests-validation-${{ github.ref }} cancel-in-progress: true jobs: diff --git a/.gitignore b/.gitignore index 55adc15fd..c2ed24bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -53,7 +53,7 @@ tap/extensions/*/expect **/node_modules/** **/dist/** *.editorconfig -ui/up9-mizu-common-0.0.0.tgz +ui/up9-kubeshark-common-0.0.0.tgz # Ignore *.log files *.log diff --git a/Dockerfile b/Dockerfile index fcc95f2cd..0503c00f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ FROM node:16 AS front-end WORKDIR /app/ui-build COPY ui/package.json ui/package-lock.json ./ -COPY --from=front-end-common ["/app/ui-build/up9-mizu-common-0.0.0.tgz", "."] +COPY --from=front-end-common ["/app/ui-build/up9-kubeshark-common-0.0.0.tgz", "."] RUN npm i COPY ui . RUN npm run build @@ -54,14 +54,14 @@ ENV BPF_TARGET=arm64 BPF_CFLAGS="-O2 -g -D__TARGET_ARCH_arm64" ### Builder image for x86-64 to AArch64 cross-compilation -FROM up9inc/linux-arm64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 AS builder-from-amd64-to-arm64v8 +FROM kubeshark/linux-arm64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 AS builder-from-amd64-to-arm64v8 ENV CGO_ENABLED=1 GOOS=linux ENV GOARCH=arm64 CGO_CFLAGS="-I/work/libpcap -I/work/capstone/include" ENV BPF_TARGET=arm64 BPF_CFLAGS="-O2 -g -D__TARGET_ARCH_arm64 -I/usr/xcc/aarch64-linux-musl-cross/aarch64-linux-musl/include/" ### Builder image for AArch64 to x86-64 cross-compilation -FROM up9inc/linux-x86_64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 AS builder-from-arm64v8-to-amd64 +FROM kubeshark/linux-x86_64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 AS builder-from-arm64v8-to-amd64 ENV CGO_ENABLED=1 GOOS=linux ENV GOARCH=amd64 CGO_CFLAGS="-I/libpcap -I/capstone/include" ENV BPF_TARGET=amd64 BPF_CFLAGS="-O2 -g -D__TARGET_ARCH_x86 -I/usr/local/musl/x86_64-unknown-linux-musl/include/" @@ -110,10 +110,10 @@ RUN GOARCH=${BUILDARCH} go generate tls_tapper.go WORKDIR /app/agent-build RUN go build -ldflags="-extldflags=-static -s -w \ - -X 'github.com/up9inc/mizu/agent/pkg/version.GitCommitHash=${COMMIT_HASH}' \ - -X 'github.com/up9inc/mizu/agent/pkg/version.Branch=${GIT_BRANCH}' \ - -X 'github.com/up9inc/mizu/agent/pkg/version.BuildTimestamp=${BUILD_TIMESTAMP}' \ - -X 'github.com/up9inc/mizu/agent/pkg/version.Ver=${VER}'" -o mizuagent . + -X 'github.com/kubeshark/kubeshark/agent/pkg/version.GitCommitHash=${COMMIT_HASH}' \ + -X 'github.com/kubeshark/kubeshark/agent/pkg/version.Branch=${GIT_BRANCH}' \ + -X 'github.com/kubeshark/kubeshark/agent/pkg/version.BuildTimestamp=${BUILD_TIMESTAMP}' \ + -X 'github.com/kubeshark/kubeshark/agent/pkg/version.Ver=${VER}'" -o kubesharkagent . # Download Basenine executable, verify the sha1sum ADD https://github.com/up9inc/basenine/releases/download/v0.8.3/basenine_linux_${GOARCH} ./basenine_linux_${GOARCH} @@ -133,9 +133,9 @@ WORKDIR /app/data/ WORKDIR /app # Copy binary and config files from /build to root folder of scratch container. -COPY --from=builder ["/app/agent-build/mizuagent", "."] +COPY --from=builder ["/app/agent-build/kubesharkagent", "."] COPY --from=builder ["/app/agent-build/basenine", "/usr/local/bin/basenine"] COPY --from=front-end ["/app/ui-build/build", "site"] # this script runs both apiserver and passivetapper and exits either if one of them exits, preventing a scenario where the container runs without one process -ENTRYPOINT ["/app/mizuagent"] +ENTRYPOINT ["/app/kubesharkagent"] diff --git a/Makefile b/Makefile index 1afe22cfa..1159f3182 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ help: ## This help. # Variables and lists TS_SUFFIX="$(shell date '+%s')" GIT_BRANCH="$(shell git branch | grep \* | cut -d ' ' -f2 | tr '[:upper:]' '[:lower:]' | tr '/' '_')" -BUCKET_PATH=static.up9.io/mizu/$(GIT_BRANCH) +BUCKET_PATH=static.up9.io/kubeshark/$(GIT_BRANCH) export VER?=0.0 ARCH=$(shell uname -m) ifeq ($(ARCH),$(filter $(ARCH),aarch64 arm64)) @@ -39,8 +39,8 @@ cli-debug: ## Build CLI. @echo "building cli"; cd cli && $(MAKE) build-debug agent: bpf ## Build agent. - @(echo "building mizu agent .." ) - @(cd agent; go build -o build/mizuagent main.go) + @(echo "building kubeshark agent .." ) + @(cd agent; go build -o build/kubesharkagent main.go) @ls -l agent/build bpf: $(BPF_O_FILES) @@ -50,8 +50,8 @@ $(BPF_O_FILES): $(wildcard tap/tlstapper/bpf/**/*.[ch]) @(./tap/tlstapper/bpf-builder/build.sh) agent-debug: ## Build agent for debug. - @(echo "building mizu agent for debug.." ) - @(cd agent; go build -gcflags="all=-N -l" -o build/mizuagent main.go) + @(echo "building kubeshark agent for debug.." ) + @(cd agent; go build -gcflags="all=-N -l" -o build/kubesharkagent main.go) @ls -l agent/build docker: ## Build and publish agent docker image. @@ -59,7 +59,7 @@ docker: ## Build and publish agent docker image. agent-docker: ## Build agent docker image. @echo "Building agent docker image" - @docker build -t up9inc/mizu:devlatest . + @docker build -t kubeshark/kubeshark:devlatest . push: push-docker push-cli ## Build and publish agent docker image & CLI. diff --git a/README.md b/README.md index 27a88ae8c..f211b33f5 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,94 @@ -![Mizu: The API Traffic Viewer for Kubernetes](assets/mizu-logo.svg) +

+ Kubeshark: Traffic viewer for Kubernetes. +

- - GitHub License + + GitHub License - - GitHub Latest Release + + GitHub Latest Release - - Docker pulls + + Docker pulls - - Image size + + Image size - + Slack

-# The API Traffic Viewer for Kubernetes +Kubeshark is an **observability and monitoring tool for** [**Kubernetes**](https://kubernetes.io/), enabling **dynamic analysis** of the microservices, detecting **anomalies** and **triggering functions** when certain patterns appear in runtime. -A simple-yet-powerful API traffic viewer for Kubernetes enabling you to view all API communication between microservices to help your debug and troubleshoot regressions. +Think of Kubeshark as a **Kubernetes-aware** combination of [**Wireshark**](https://www.wireshark.org/), [**BPF Compiler Collection (BCC) tools**](https://github.com/iovisor/bcc) and beyond. -Think TCPDump and Wireshark re-invented for Kubernetes. +![Simple UI](assets/kubeshark-ui.png) -![Simple UI](assets/mizu-ui.png) +## Quickstart -## Quickstart and documentation +Installing Kubeshark can't be any easier. Either choose the right binary, download and use directly from [the releases section](https://github.com/kubeshark/kubeshark/releases/), or use a shell script to download the right binary for your operating system and CPU architecture: -You can run Mizu on any Kubernetes cluster (version of 1.16.0 or higher) in a matter of seconds. See the [Mizu Getting Started Guide](https://getmizu.io/docs/) for how. +```shell +sh <(curl -Ls https://kubeshark.co/install) +``` -For more comprehensive documentation, start with the [docs](https://getmizu.io/docs/mizu/mizu-cli). +## Deploy -## Working in this repo +Once you have the Kubeshark CLI installed on your system, run the command below to deploy the Kubeshark container into your Kubernetes cluster. -We ❤️ pull requests! See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for info on contributing changes.
-In the wiki you can find an intorduction to [mizu components](https://github.com/up9inc/mizu/wiki/Introduction-to-Mizu), and [development workflows](https://github.com/up9inc/mizu/wiki/Development-Workflows). +```shell +kubeshark tap +``` +### Troubleshooting Installation +If something doesn't work or simply to play it safe prior to installing, make sure that: + +> Kubeshark images are hosted on Docker Hub. Make sure you have access to https://hub.docker.com/ + +> Make sure `kubeshark` executable in your `PATH`. + +### Select Pods + +#### Monitoring a Specific Pod: + +```shell +kubeshark tap catalogue-b87b45784-sxc8q +``` + +#### Monitoring a Set of Pods Using Regex: + +```shell +kubeshark tap "(catalo*|front-end*)" +``` + +### Specify the Namespace + +By default, Kubeshark is deployed into the `default` namespace. +To specify a different namespace: + +``` +kubeshark tap -n sock-shop +``` + +### Specify All Namespaces + +The default deployment strategy of Kubeshark waits for the new pods +to be created. To simply deploy to all existing namespaces run: + +``` +kubeshark tap -A +``` + +## Documentation + +Visit our documentation website: [docs.kubeshark.co](https://docs.kubeshark.co) + +The documentation resources are open-source and can be found on GitHub: [kubeshark/docs](https://github.com/kubeshark/docs) + +## Contributing + +We ❤️ pull requests! See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for the contribution guide. ## Code of Conduct diff --git a/acceptanceTests/cypress.config.js b/acceptanceTests/cypress.config.js index 506441092..2f771b736 100644 --- a/acceptanceTests/cypress.config.js +++ b/acceptanceTests/cypress.config.js @@ -14,9 +14,9 @@ module.exports = defineConfig({ greenFilterColor: 'rgb(210, 250, 210)', redFilterColor: 'rgb(250, 214, 220)', bodyJsonClass: '.hljs', - mizuWidth: 1920, - normalMizuHeight: 1080, - hugeMizuHeight: 3500, + kubesharkWidth: 1920, + normalKubesharkHeight: 1080, + hugeKubesharkHeight: 3500, }, e2e: { // We've imported your old cypress plugins here. diff --git a/acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js b/acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js index 30b85445b..c065463e1 100644 --- a/acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js +++ b/acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js @@ -14,19 +14,19 @@ export function isValueExistsInElement(shouldInclude, content, domPathToContaine }); } -export function resizeToHugeMizu() { - cy.viewport(Cypress.env('mizuWidth'), Cypress.env('hugeMizuHeight')); +export function resizeToHugeKubeshark() { + cy.viewport(Cypress.env('kubesharkWidth'), Cypress.env('hugeKubesharkHeight')); } -export function resizeToNormalMizu() { - cy.viewport(Cypress.env('mizuWidth'), Cypress.env('normalMizuHeight')); +export function resizeToNormalKubeshark() { + cy.viewport(Cypress.env('kubesharkWidth'), Cypress.env('normalKubesharkHeight')); } export function verifyMinimumEntries() { const entriesSent = Cypress.env('entriesCount'); const minimumEntries = Math.round((0.75 * entriesSent)); - it(`Making sure that mizu shows at least ${minimumEntries} entries`, function () { + it(`Making sure that kubeshark shows at least ${minimumEntries} entries`, function () { cy.get('#total-entries').then(number => { const getNum = () => { return parseInt(number.text()); diff --git a/acceptanceTests/cypress/e2e/tests/IgnoredUserAgents.js b/acceptanceTests/cypress/e2e/tests/IgnoredUserAgents.js index 50f59953a..94074f85c 100644 --- a/acceptanceTests/cypress/e2e/tests/IgnoredUserAgents.js +++ b/acceptanceTests/cypress/e2e/tests/IgnoredUserAgents.js @@ -1,9 +1,9 @@ import { isValueExistsInElement, - resizeToHugeMizu, + resizeToHugeKubeshark, } from "../testHelpers/TrafficHelper"; -it('Loading Mizu', function () { +it('Loading Kubeshark', function () { cy.visit(Cypress.env('testUrl')); }); @@ -12,7 +12,7 @@ checkEntries(); function checkEntries() { it('checking all entries', function () { cy.get('#entries-length').should('not.have.text', '0').then(() => { - resizeToHugeMizu(); + resizeToHugeKubeshark(); cy.get('#list [id^=entry]').each(entryElement => { entryElement.click(); diff --git a/acceptanceTests/cypress/e2e/tests/NoRedact.js b/acceptanceTests/cypress/e2e/tests/NoRedact.js index ef6648b4e..a68717ccf 100644 --- a/acceptanceTests/cypress/e2e/tests/NoRedact.js +++ b/acceptanceTests/cypress/e2e/tests/NoRedact.js @@ -1,6 +1,6 @@ import {isValueExistsInElement} from '../testHelpers/TrafficHelper'; -it('Loading Mizu', function () { +it('Loading Kubeshark', function () { cy.visit(Cypress.env('testUrl')); }); diff --git a/acceptanceTests/cypress/e2e/tests/Rabbit.js b/acceptanceTests/cypress/e2e/tests/Rabbit.js index 137c622e6..e9e8542ee 100644 --- a/acceptanceTests/cypress/e2e/tests/Rabbit.js +++ b/acceptanceTests/cypress/e2e/tests/Rabbit.js @@ -1,6 +1,6 @@ import {checkFilterByMethod, valueTabs,} from "../testHelpers/TrafficHelper"; -it('opening mizu', function () { +it('opening kubeshark', function () { cy.visit(Cypress.env('testUrl')); }); diff --git a/acceptanceTests/cypress/e2e/tests/Redact.js b/acceptanceTests/cypress/e2e/tests/Redact.js index 79db59b51..d30245b1a 100644 --- a/acceptanceTests/cypress/e2e/tests/Redact.js +++ b/acceptanceTests/cypress/e2e/tests/Redact.js @@ -1,6 +1,6 @@ import {isValueExistsInElement} from '../testHelpers/TrafficHelper'; -it('Loading Mizu', function () { +it('Loading Kubeshark', function () { cy.visit(Cypress.env('testUrl')); }); diff --git a/acceptanceTests/cypress/e2e/tests/Redis.js b/acceptanceTests/cypress/e2e/tests/Redis.js index ba264896b..694902887 100644 --- a/acceptanceTests/cypress/e2e/tests/Redis.js +++ b/acceptanceTests/cypress/e2e/tests/Redis.js @@ -1,6 +1,6 @@ import {checkFilterByMethod, valueTabs,} from "../testHelpers/TrafficHelper"; -it('opening mizu', function () { +it('opening kubeshark', function () { cy.visit(Cypress.env('testUrl')); }); diff --git a/acceptanceTests/cypress/e2e/tests/UiTest.js b/acceptanceTests/cypress/e2e/tests/UiTest.js index 12f7b2460..8094edb4d 100644 --- a/acceptanceTests/cypress/e2e/tests/UiTest.js +++ b/acceptanceTests/cypress/e2e/tests/UiTest.js @@ -3,8 +3,8 @@ import { getEntryId, leftOnHoverCheck, leftTextCheck, - resizeToHugeMizu, - resizeToNormalMizu, + resizeToHugeKubeshark, + resizeToNormalKubeshark, rightOnHoverCheck, rightTextCheck, verifyMinimumEntries, @@ -20,7 +20,7 @@ podsArray.forEach((podStr, index) => { podsArray[index] = getExpectedDetailsDict(podAndNamespaceArr[0], podAndNamespaceArr[1]); }); -it('opening mizu', function () { +it('opening kubeshark', function () { cy.visit(Cypress.env('testUrl')); }); @@ -98,11 +98,11 @@ if (Cypress.env('shouldCheckSrcAndDest')) { }); checkFilter({ - filter: `dst.name == "httpbin.mizu-tests"`, + filter: `dst.name == "httpbin.kubeshark-tests"`, leftSidePath: '> :nth-child(3) > :nth-child(2) > :nth-child(3) > :nth-child(2)', - leftSideExpectedText: 'httpbin.mizu-tests', + leftSideExpectedText: 'httpbin.kubeshark-tests', rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(2) > :nth-child(3) > :nth-child(2)', - rightSideExpectedText: 'httpbin.mizu-tests', + rightSideExpectedText: 'httpbin.kubeshark-tests', applyByCtrlEnter: false, numberOfRecords: 20 }); @@ -224,7 +224,7 @@ function checkFilter(filterDetails) { checkRightSideResponseBody(); }); - resizeToHugeMizu(); + resizeToHugeKubeshark(); // checking only 'leftTextCheck' on all entries because the rest of the checks require more time cy.get(`#list [id^=entry]`).each(elem => { @@ -237,7 +237,7 @@ function checkFilter(filterDetails) { deeperCheck(leftSidePath, rightSidePath, filter, rightSideExpectedText, entriesForDeeperCheck); // reloading then waiting for the entries number to load - resizeToNormalMizu(); + resizeToNormalKubeshark(); cy.reload(); waitForFetch(numberOfRecords); pauseStream(); @@ -320,7 +320,7 @@ function serviceMapCheck() { cy.wait('@serviceMapRequest').then(({response}) => { const body = response.body; const nodeParams = { - destination: 'httpbin.mizu-tests', + destination: 'httpbin.kubeshark-tests', source: '127.0.0.1' }; serviceMapAPICheck(body, parseInt(entriesNum), nodeParams); diff --git a/acceptanceTests/go.mod b/acceptanceTests/go.mod index cc5a3b1a3..1d706712f 100644 --- a/acceptanceTests/go.mod +++ b/acceptanceTests/go.mod @@ -1,11 +1,11 @@ -module github.com/up9inc/mizu/acceptanceTests +module github.com/kubeshark/kubeshark/acceptanceTests go 1.17 require ( github.com/go-redis/redis/v8 v8.11.4 github.com/rabbitmq/amqp091-go v1.3.0 - github.com/up9inc/mizu/shared v0.0.0 + github.com/kubeshark/kubeshark/shared v0.0.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b k8s.io/apimachinery v0.23.3 k8s.io/client-go v0.23.3 @@ -47,10 +47,10 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/up9inc/mizu/logger v0.0.0 => ../logger +replace github.com/kubeshark/kubeshark/logger v0.0.0 => ../logger -replace github.com/up9inc/mizu/shared v0.0.0 => ../shared +replace github.com/kubeshark/kubeshark/shared v0.0.0 => ../shared -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../tap/api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../tap/api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../tap/dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../tap/dbgctl diff --git a/acceptanceTests/logs_test.go b/acceptanceTests/logs_test.go index a20e31b75..52730f9ca 100644 --- a/acceptanceTests/logs_test.go +++ b/acceptanceTests/logs_test.go @@ -81,27 +81,27 @@ func TestLogs(t *testing.T) { logsFileNames = append(logsFileNames, file.Name) } - if !Contains(logsFileNames, "mizu.mizu-api-server.mizu-api-server.log") { + if !Contains(logsFileNames, "kubeshark.kubeshark-api-server.kubeshark-api-server.log") { t.Errorf("api server logs not found") return } - if !Contains(logsFileNames, "mizu.mizu-api-server.basenine.log") { + if !Contains(logsFileNames, "kubeshark.kubeshark-api-server.basenine.log") { t.Errorf("basenine logs not found") return } - if !Contains(logsFileNames, "mizu_cli.log") { + if !Contains(logsFileNames, "kubeshark_cli.log") { t.Errorf("cli logs not found") return } - if !Contains(logsFileNames, "mizu_events.log") { + if !Contains(logsFileNames, "kubeshark_events.log") { t.Errorf("events logs not found") return } - if !ContainsPartOfValue(logsFileNames, "mizu.mizu-tapper-daemon-set") { + if !ContainsPartOfValue(logsFileNames, "kubeshark.kubeshark-tapper-daemon-set") { t.Errorf("tapper logs not found") return } @@ -179,27 +179,27 @@ func TestLogsPath(t *testing.T) { logsFileNames = append(logsFileNames, file.Name) } - if !Contains(logsFileNames, "mizu.mizu-api-server.mizu-api-server.log") { + if !Contains(logsFileNames, "kubeshark.kubeshark-api-server.kubeshark-api-server.log") { t.Errorf("api server logs not found") return } - if !Contains(logsFileNames, "mizu.mizu-api-server.basenine.log") { + if !Contains(logsFileNames, "kubeshark.kubeshark-api-server.basenine.log") { t.Errorf("basenine logs not found") return } - if !Contains(logsFileNames, "mizu_cli.log") { + if !Contains(logsFileNames, "kubeshark_cli.log") { t.Errorf("cli logs not found") return } - if !Contains(logsFileNames, "mizu_events.log") { + if !Contains(logsFileNames, "kubeshark_events.log") { t.Errorf("events logs not found") return } - if !ContainsPartOfValue(logsFileNames, "mizu.mizu-tapper-daemon-set") { + if !ContainsPartOfValue(logsFileNames, "kubeshark.kubeshark-tapper-daemon-set") { t.Errorf("tapper logs not found") return } diff --git a/acceptanceTests/setup.sh b/acceptanceTests/setup.sh index f207d173d..603fec713 100755 --- a/acceptanceTests/setup.sh +++ b/acceptanceTests/setup.sh @@ -29,33 +29,33 @@ fi echo "Starting minikube..." minikube start --cpus 2 --memory 6000 -echo "Creating mizu tests namespaces" -kubectl create namespace mizu-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl create namespace mizu-tests2 --dry-run=client -o yaml | kubectl apply -f - +echo "Creating kubeshark tests namespaces" +kubectl create namespace kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create namespace kubeshark-tests2 --dry-run=client -o yaml | kubectl apply -f - echo "Creating httpbin deployments" -kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl create deployment httpbin2 --image=kennethreitz/httpbin -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create deployment httpbin --image=kennethreitz/httpbin -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create deployment httpbin2 --image=kennethreitz/httpbin -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl create deployment httpbin --image=kennethreitz/httpbin -n mizu-tests2 --dry-run=client -o yaml | kubectl apply -f - +kubectl create deployment httpbin --image=kennethreitz/httpbin -n kubeshark-tests2 --dry-run=client -o yaml | kubectl apply -f - echo "Creating redis deployment" -kubectl create deployment redis --image=redis -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create deployment redis --image=redis -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - echo "Creating rabbitmq deployment" -kubectl create deployment rabbitmq --image=rabbitmq -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl create deployment rabbitmq --image=rabbitmq -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - echo "Creating httpbin services" -kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl expose deployment httpbin2 --type=NodePort --port=80 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl expose deployment httpbin --type=NodePort --port=80 -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl expose deployment httpbin2 --type=NodePort --port=80 -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - -kubectl expose deployment httpbin --type=NodePort --port=80 -n mizu-tests2 --dry-run=client -o yaml | kubectl apply -f - +kubectl expose deployment httpbin --type=NodePort --port=80 -n kubeshark-tests2 --dry-run=client -o yaml | kubectl apply -f - echo "Creating redis service" -kubectl expose deployment redis --type=LoadBalancer --port=6379 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl expose deployment redis --type=LoadBalancer --port=6379 -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - echo "Creating rabbitmq service" -kubectl expose deployment rabbitmq --type=LoadBalancer --port=5672 -n mizu-tests --dry-run=client -o yaml | kubectl apply -f - +kubectl expose deployment rabbitmq --type=LoadBalancer --port=5672 -n kubeshark-tests --dry-run=client -o yaml | kubectl apply -f - echo "Starting proxy" rm -f ${PROXY_LOG} @@ -64,15 +64,15 @@ PID1=$! echo "kubectl proxy process id is ${PID1} and log of proxy in ${PROXY_LOG}" if [[ -z "${CI}" ]]; then - echo "Setting env var of mizu ci image" - export MIZU_CI_IMAGE="mizu/ci:0.0" + echo "Setting env var of kubeshark ci image" + export KUBESHARK_CI_IMAGE="kubeshark/ci:0.0" echo "Build agent image" - docker build -t "${MIZU_CI_IMAGE}" . + docker build -t "${KUBESHARK_CI_IMAGE}" . else echo "not building docker image in CI because it is created as separate step" fi -minikube image load "${MIZU_CI_IMAGE}" +minikube image load "${KUBESHARK_CI_IMAGE}" echo "Build cli" cd cli && make build GIT_BRANCH=ci SUFFIX=ci diff --git a/acceptanceTests/tap_test.go b/acceptanceTests/tap_test.go index a48069b4c..03e49bcef 100644 --- a/acceptanceTests/tap_test.go +++ b/acceptanceTests/tap_test.go @@ -15,7 +15,7 @@ func TestTap(t *testing.T) { basicTapTest(t, false) } -func basicTapTest(t *testing.T, shouldCheckSrcAndDest bool, extraArgs... string) { +func basicTapTest(t *testing.T, shouldCheckSrcAndDest bool, extraArgs ...string) { if testing.Short() { t.Skip("ignored acceptance test") } @@ -67,8 +67,8 @@ func basicTapTest(t *testing.T, shouldCheckSrcAndDest bool, extraArgs... string) } expectedPods := []PodDescriptor{ - {Name: "httpbin", Namespace: "mizu-tests"}, - {Name: "httpbin2", Namespace: "mizu-tests"}, + {Name: "httpbin", Namespace: "kubeshark-tests"}, + {Name: "httpbin2", Namespace: "kubeshark-tests"}, } var expectedPodsStr string @@ -134,7 +134,7 @@ func TestTapGuiPort(t *testing.T) { } RunCypressTests(t, fmt.Sprintf("npx cypress run --spec \"cypress/e2e/tests/GuiPort.js\" --env name=%v,namespace=%v,port=%d", - "httpbin", "mizu-tests", guiPort)) + "httpbin", "kubeshark-tests", guiPort)) }) } } @@ -145,9 +145,9 @@ func TestTapAllNamespaces(t *testing.T) { } expectedPods := []PodDescriptor{ - {Name: "httpbin", Namespace: "mizu-tests"}, - {Name: "httpbin2", Namespace: "mizu-tests"}, - {Name: "httpbin", Namespace: "mizu-tests2"}, + {Name: "httpbin", Namespace: "kubeshark-tests"}, + {Name: "httpbin2", Namespace: "kubeshark-tests"}, + {Name: "httpbin", Namespace: "kubeshark-tests2"}, } cliPath, cliPathErr := GetCliPath() @@ -190,9 +190,9 @@ func TestTapMultipleNamespaces(t *testing.T) { } expectedPods := []PodDescriptor{ - {Name: "httpbin", Namespace: "mizu-tests"}, - {Name: "httpbin2", Namespace: "mizu-tests"}, - {Name: "httpbin", Namespace: "mizu-tests2"}, + {Name: "httpbin", Namespace: "kubeshark-tests"}, + {Name: "httpbin2", Namespace: "kubeshark-tests"}, + {Name: "httpbin", Namespace: "kubeshark-tests2"}, } cliPath, cliPathErr := GetCliPath() @@ -240,7 +240,7 @@ func TestTapRegex(t *testing.T) { regexPodName := "httpbin2" expectedPods := []PodDescriptor{ - {Name: regexPodName, Namespace: "mizu-tests"}, + {Name: regexPodName, Namespace: "kubeshark-tests"}, } cliPath, cliPathErr := GetCliPath() @@ -365,8 +365,8 @@ func TestTapRedact(t *testing.T) { } proxyUrl := GetProxyUrl(DefaultNamespaceName, DefaultServiceName) - requestHeaders := map[string]string{"User-Header": "Mizu"} - requestBody := map[string]string{"User": "Mizu"} + requestHeaders := map[string]string{"User-Header": "Kubeshark"} + requestBody := map[string]string{"User": "Kubeshark"} for i := 0; i < DefaultEntriesCount; i++ { if _, requestErr := ExecuteHttpPostRequestWithHeaders(fmt.Sprintf("%v/post", proxyUrl), requestHeaders, requestBody); requestErr != nil { t.Errorf("failed to send proxy request, err: %v", requestErr) @@ -415,8 +415,8 @@ func TestTapNoRedact(t *testing.T) { } proxyUrl := GetProxyUrl(DefaultNamespaceName, DefaultServiceName) - requestHeaders := map[string]string{"User-Header": "Mizu"} - requestBody := map[string]string{"User": "Mizu"} + requestHeaders := map[string]string{"User-Header": "Kubeshark"} + requestBody := map[string]string{"User": "Kubeshark"} for i := 0; i < DefaultEntriesCount; i++ { if _, requestErr := ExecuteHttpPostRequestWithHeaders(fmt.Sprintf("%v/post", proxyUrl), requestHeaders, requestBody); requestErr != nil { t.Errorf("failed to send proxy request, err: %v", requestErr) @@ -526,23 +526,23 @@ func TestTapDumpLogs(t *testing.T) { return } - mizuFolderPath, mizuPathErr := GetMizuFolderPath() - if mizuPathErr != nil { - t.Errorf("failed to get mizu folder path, err: %v", mizuPathErr) + kubesharkFolderPath, kubesharkPathErr := GetKubesharkFolderPath() + if kubesharkPathErr != nil { + t.Errorf("failed to get kubeshark folder path, err: %v", kubesharkPathErr) return } - files, readErr := ioutil.ReadDir(mizuFolderPath) + files, readErr := ioutil.ReadDir(kubesharkFolderPath) if readErr != nil { - t.Errorf("failed to read mizu folder files, err: %v", readErr) + t.Errorf("failed to read kubeshark folder files, err: %v", readErr) return } var dumpLogsPath string for _, file := range files { fileName := file.Name() - if strings.Contains(fileName, "mizu_logs") { - dumpLogsPath = path.Join(mizuFolderPath, fileName) + if strings.Contains(fileName, "kubeshark_logs") { + dumpLogsPath = path.Join(kubesharkFolderPath, fileName) break } } @@ -569,27 +569,27 @@ func TestTapDumpLogs(t *testing.T) { logsFileNames = append(logsFileNames, file.Name) } - if !Contains(logsFileNames, "mizu.mizu-api-server.mizu-api-server.log") { + if !Contains(logsFileNames, "kubeshark.kubeshark-api-server.kubeshark-api-server.log") { t.Errorf("api server logs not found") return } - if !Contains(logsFileNames, "mizu.mizu-api-server.basenine.log") { + if !Contains(logsFileNames, "kubeshark.kubeshark-api-server.basenine.log") { t.Errorf("basenine logs not found") return } - if !Contains(logsFileNames, "mizu_cli.log") { + if !Contains(logsFileNames, "kubeshark_cli.log") { t.Errorf("cli logs not found") return } - if !Contains(logsFileNames, "mizu_events.log") { + if !Contains(logsFileNames, "kubeshark_events.log") { t.Errorf("events logs not found") return } - if !ContainsPartOfValue(logsFileNames, "mizu.mizu-tapper-daemon-set") { + if !ContainsPartOfValue(logsFileNames, "kubeshark.kubeshark-tapper-daemon-set") { t.Errorf("tapper logs not found") return } @@ -613,7 +613,7 @@ func TestIpResolving(t *testing.T) { } func TestRestrictedMode(t *testing.T) { - namespace := "mizu-tests" + namespace := "kubeshark-tests" t.Log("creating permissions for restricted user") if err := ApplyKubeFilesForTest( @@ -632,6 +632,6 @@ func TestRestrictedMode(t *testing.T) { return } - extraArgs := []string{"--set", fmt.Sprintf("mizu-resources-namespace=%s", namespace)} - t.Run("basic tap", func (testingT *testing.T) {basicTapTest(testingT, false, extraArgs...)}) + extraArgs := []string{"--set", fmt.Sprintf("kubeshark-resources-namespace=%s", namespace)} + t.Run("basic tap", func(testingT *testing.T) { basicTapTest(testingT, false, extraArgs...) }) } diff --git a/acceptanceTests/testsUtils.go b/acceptanceTests/testsUtils.go index 87378a033..1f0222424 100644 --- a/acceptanceTests/testsUtils.go +++ b/acceptanceTests/testsUtils.go @@ -21,14 +21,14 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/shared" ) const ( LongRetriesCount = 100 ShortRetriesCount = 10 DefaultApiServerPort = shared.DefaultApiServerPort - DefaultNamespaceName = "mizu-tests" + DefaultNamespaceName = "kubeshark-tests" DefaultServiceName = "httpbin" DefaultEntriesCount = 50 WaitAfterTapPodsReady = 3 * time.Second @@ -46,26 +46,26 @@ func GetCliPath() (string, error) { return "", filePathErr } - cliPath := path.Join(dir, "../cli/bin/mizu_ci") + cliPath := path.Join(dir, "../cli/bin/kubeshark_ci") return cliPath, nil } -func GetMizuFolderPath() (string, error) { +func GetKubesharkFolderPath() (string, error) { home, homeDirErr := os.UserHomeDir() if homeDirErr != nil { return "", homeDirErr } - return path.Join(home, ".mizu"), nil + return path.Join(home, ".kubeshark"), nil } func GetConfigPath() (string, error) { - mizuFolderPath, mizuPathError := GetMizuFolderPath() - if mizuPathError != nil { - return "", mizuPathError + kubesharkFolderPath, kubesharkPathError := GetKubesharkFolderPath() + if kubesharkPathError != nil { + return "", kubesharkPathError } - return path.Join(mizuFolderPath, "config.yaml"), nil + return path.Join(kubesharkFolderPath, "config.yaml"), nil } func GetProxyUrl(namespace string, service string) string { @@ -213,7 +213,7 @@ func DeleteKubeFile(kubeContext string, namespace string, filename string) error } func getDefaultCommandArgs() []string { - agentImageValue := os.Getenv("MIZU_CI_IMAGE") + agentImageValue := os.Getenv("KUBESHARK_CI_IMAGE") setFlag := "--set" agentImage := fmt.Sprintf("agent-image=%s", agentImageValue) imagePullPolicy := "image-pull-policy=IfNotPresent" @@ -244,7 +244,7 @@ func GetDefaultLogsCommandArgs() []string { } func GetDefaultTapNamespace() []string { - return []string{"-n", "mizu-tests"} + return []string{"-n", "kubeshark-tests"} } func GetDefaultConfigCommandArgs() []string { @@ -397,7 +397,7 @@ func GetLogsPath() (string, error) { return "", filePathErr } - logsPath := path.Join(dir, "mizu_logs.zip") + logsPath := path.Join(dir, "kubeshark_logs.zip") return logsPath, nil } diff --git a/agent/go.mod b/agent/go.mod index 0e53f4ed2..fc12994ba 100644 --- a/agent/go.mod +++ b/agent/go.mod @@ -1,4 +1,4 @@ -module github.com/up9inc/mizu/agent +module github.com/kubeshark/kubeshark/agent go 1.17 @@ -15,20 +15,20 @@ require ( github.com/google/uuid v1.3.0 github.com/gorilla/websocket v1.4.2 github.com/jinzhu/copier v0.3.5 + github.com/kubeshark/kubeshark/logger v0.0.0 + github.com/kubeshark/kubeshark/shared v0.0.0 + github.com/kubeshark/kubeshark/tap v0.0.0 + github.com/kubeshark/kubeshark/tap/api v0.0.0 + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 + github.com/kubeshark/kubeshark/tap/extensions/amqp v0.0.0 + github.com/kubeshark/kubeshark/tap/extensions/http v0.0.0 + github.com/kubeshark/kubeshark/tap/extensions/kafka v0.0.0 + github.com/kubeshark/kubeshark/tap/extensions/redis v0.0.0 github.com/nav-inc/datetime v0.1.3 github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/orcaman/concurrent-map v1.0.0 github.com/stretchr/testify v1.7.0 github.com/up9inc/basenine/client/go v0.0.0-20220612112747-3b28eeac9c51 - github.com/up9inc/mizu/logger v0.0.0 - github.com/up9inc/mizu/shared v0.0.0 - github.com/up9inc/mizu/tap v0.0.0 - github.com/up9inc/mizu/tap/api v0.0.0 - github.com/up9inc/mizu/tap/dbgctl v0.0.0 - github.com/up9inc/mizu/tap/extensions/amqp v0.0.0 - github.com/up9inc/mizu/tap/extensions/http v0.0.0 - github.com/up9inc/mizu/tap/extensions/kafka v0.0.0 - github.com/up9inc/mizu/tap/extensions/redis v0.0.0 github.com/wI2L/jsondiff v0.1.1 k8s.io/api v0.23.3 k8s.io/apimachinery v0.23.3 @@ -144,20 +144,20 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/up9inc/mizu/logger v0.0.0 => ../logger +replace github.com/kubeshark/kubeshark/logger v0.0.0 => ../logger -replace github.com/up9inc/mizu/shared v0.0.0 => ../shared +replace github.com/kubeshark/kubeshark/shared v0.0.0 => ../shared -replace github.com/up9inc/mizu/tap v0.0.0 => ../tap +replace github.com/kubeshark/kubeshark/tap v0.0.0 => ../tap -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../tap/api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../tap/api -replace github.com/up9inc/mizu/tap/extensions/amqp v0.0.0 => ../tap/extensions/amqp +replace github.com/kubeshark/kubeshark/tap/extensions/amqp v0.0.0 => ../tap/extensions/amqp -replace github.com/up9inc/mizu/tap/extensions/http v0.0.0 => ../tap/extensions/http +replace github.com/kubeshark/kubeshark/tap/extensions/http v0.0.0 => ../tap/extensions/http -replace github.com/up9inc/mizu/tap/extensions/kafka v0.0.0 => ../tap/extensions/kafka +replace github.com/kubeshark/kubeshark/tap/extensions/kafka v0.0.0 => ../tap/extensions/kafka -replace github.com/up9inc/mizu/tap/extensions/redis v0.0.0 => ../tap/extensions/redis +replace github.com/kubeshark/kubeshark/tap/extensions/redis v0.0.0 => ../tap/extensions/redis -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../tap/dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../tap/dbgctl diff --git a/agent/go.sum b/agent/go.sum index e1708e5f1..590a8d2ae 100644 --- a/agent/go.sum +++ b/agent/go.sum @@ -101,7 +101,6 @@ github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= diff --git a/agent/main.go b/agent/main.go index 6e9f9a9d9..110f8952b 100644 --- a/agent/main.go +++ b/agent/main.go @@ -17,32 +17,32 @@ import ( "github.com/gin-contrib/pprof" "github.com/gin-contrib/static" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/entries" - "github.com/up9inc/mizu/agent/pkg/middlewares" - "github.com/up9inc/mizu/agent/pkg/models" - "github.com/up9inc/mizu/agent/pkg/oas" - "github.com/up9inc/mizu/agent/pkg/routes" - "github.com/up9inc/mizu/agent/pkg/servicemap" - "github.com/up9inc/mizu/agent/pkg/utils" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/entries" + "github.com/kubeshark/kubeshark/agent/pkg/middlewares" + "github.com/kubeshark/kubeshark/agent/pkg/models" + "github.com/kubeshark/kubeshark/agent/pkg/oas" + "github.com/kubeshark/kubeshark/agent/pkg/routes" + "github.com/kubeshark/kubeshark/agent/pkg/servicemap" + "github.com/kubeshark/kubeshark/agent/pkg/utils" - "github.com/up9inc/mizu/agent/pkg/api" - "github.com/up9inc/mizu/agent/pkg/app" - "github.com/up9inc/mizu/agent/pkg/config" + "github.com/kubeshark/kubeshark/agent/pkg/api" + "github.com/kubeshark/kubeshark/agent/pkg/app" + "github.com/kubeshark/kubeshark/agent/pkg/config" "github.com/gorilla/websocket" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/tap" + tapApi "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/dbgctl" "github.com/op/go-logging" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/tap" - tapApi "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/dbgctl" ) var tapperMode = flag.Bool("tap", false, "Run in tapper mode without API") var apiServerMode = flag.Bool("api-server", false, "Run in API server mode with API") var standaloneMode = flag.Bool("standalone", false, "Run in standalone tapper and API mode") -var apiServerAddress = flag.String("api-server-address", "", "Address of mizu API server") +var apiServerAddress = flag.String("api-server-address", "", "Address of kubeshark API server") var namespace = flag.String("namespace", "", "Resolve IPs if they belong to resources in this namespace (default is all)") var harsReaderMode = flag.Bool("hars-read", false, "Run in hars-read mode") var harsDir = flag.String("hars-dir", "", "Directory to read hars from") @@ -94,7 +94,7 @@ func hostApi(socketHarOutputChannel chan<- *tapApi.OutputChannelItem) *gin.Engin ginApp := gin.Default() ginApp.GET("/echo", func(c *gin.Context) { - c.JSON(http.StatusOK, "Here is Mizu agent") + c.JSON(http.StatusOK, "Here is Kubeshark agent") }) eventHandlers := api.RoutesEventHandlers{ @@ -240,7 +240,7 @@ func setUIFlags(uiIndexPath string) error { } func getTrafficFilteringOptions() *tapApi.TrafficFilteringOptions { - filteringOptionsJson := os.Getenv(shared.MizuFilteringOptionsEnvVar) + filteringOptionsJson := os.Getenv(shared.KubesharkFilteringOptionsEnvVar) if filteringOptionsJson == "" { return &tapApi.TrafficFilteringOptions{ IgnoredUserAgents: []string{}, @@ -249,7 +249,7 @@ func getTrafficFilteringOptions() *tapApi.TrafficFilteringOptions { var filteringOptions tapApi.TrafficFilteringOptions err := json.Unmarshal([]byte(filteringOptionsJson), &filteringOptions) if err != nil { - panic(fmt.Sprintf("env var %s's value of %s is invalid! json must match the api.TrafficFilteringOptions struct %v", shared.MizuFilteringOptionsEnvVar, filteringOptionsJson, err)) + panic(fmt.Sprintf("env var %s's value of %s is invalid! json must match the api.TrafficFilteringOptions struct %v", shared.KubesharkFilteringOptionsEnvVar, filteringOptionsJson, err)) } return &filteringOptions @@ -271,7 +271,7 @@ func pipeTapChannelToSocket(connection *websocket.Conn, messageDataChannel <-cha continue } - if dbgctl.MizuTapperDisableSending { + if dbgctl.KubesharkTapperDisableSending { continue } diff --git a/agent/pkg/api/entry_streamer_socket_connector.go b/agent/pkg/api/entry_streamer_socket_connector.go index e7d26f1eb..0ee1e59bf 100644 --- a/agent/pkg/api/entry_streamer_socket_connector.go +++ b/agent/pkg/api/entry_streamer_socket_connector.go @@ -3,9 +3,9 @@ package api import ( "fmt" + "github.com/kubeshark/kubeshark/agent/pkg/models" + tapApi "github.com/kubeshark/kubeshark/tap/api" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/agent/pkg/models" - tapApi "github.com/up9inc/mizu/tap/api" ) type EntryStreamerSocketConnector interface { diff --git a/agent/pkg/api/main.go b/agent/pkg/api/main.go index c08a6bf47..f1ab042ad 100644 --- a/agent/pkg/api/main.go +++ b/agent/pkg/api/main.go @@ -11,19 +11,19 @@ import ( "strings" "time" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/oas" - "github.com/up9inc/mizu/agent/pkg/servicemap" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/oas" + "github.com/kubeshark/kubeshark/agent/pkg/servicemap" - "github.com/up9inc/mizu/agent/pkg/har" - "github.com/up9inc/mizu/agent/pkg/holder" - "github.com/up9inc/mizu/agent/pkg/providers" + "github.com/kubeshark/kubeshark/agent/pkg/har" + "github.com/kubeshark/kubeshark/agent/pkg/holder" + "github.com/kubeshark/kubeshark/agent/pkg/providers" - "github.com/up9inc/mizu/agent/pkg/resolver" - "github.com/up9inc/mizu/agent/pkg/utils" + "github.com/kubeshark/kubeshark/agent/pkg/resolver" + "github.com/kubeshark/kubeshark/agent/pkg/utils" - "github.com/up9inc/mizu/logger" - tapApi "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + tapApi "github.com/kubeshark/kubeshark/tap/api" ) var k8sResolver *resolver.Resolver @@ -106,27 +106,27 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension namespace = item.Namespace } - mizuEntry := extension.Dissector.Analyze(item, resolvedSource, resolvedDestination, namespace) + kubesharkEntry := extension.Dissector.Analyze(item, resolvedSource, resolvedDestination, namespace) - data, err := json.Marshal(mizuEntry) + data, err := json.Marshal(kubesharkEntry) if err != nil { logger.Log.Errorf("Error while marshaling entry: %v", err) continue } entryInserter := dependency.GetInstance(dependency.EntriesInserter).(EntryInserter) - if err := entryInserter.Insert(mizuEntry); err != nil { + if err := entryInserter.Insert(kubesharkEntry); err != nil { logger.Log.Errorf("Error inserting entry, err: %v", err) } - summary := extension.Dissector.Summarize(mizuEntry) + summary := extension.Dissector.Summarize(kubesharkEntry) providers.EntryAdded(len(data), summary) serviceMapGenerator := dependency.GetInstance(dependency.ServiceMapGeneratorDependency).(servicemap.ServiceMapSink) - serviceMapGenerator.NewTCPEntry(mizuEntry.Source, mizuEntry.Destination, &item.Protocol) + serviceMapGenerator.NewTCPEntry(kubesharkEntry.Source, kubesharkEntry.Destination, &item.Protocol) oasGenerator := dependency.GetInstance(dependency.OasGeneratorDependency).(oas.OasGeneratorSink) - oasGenerator.HandleEntry(mizuEntry) + oasGenerator.HandleEntry(kubesharkEntry) } } diff --git a/agent/pkg/api/socket_data_inserter.go b/agent/pkg/api/socket_data_inserter.go index f49719ace..cad953a2a 100644 --- a/agent/pkg/api/socket_data_inserter.go +++ b/agent/pkg/api/socket_data_inserter.go @@ -3,12 +3,13 @@ package api import ( "encoding/json" "fmt" - basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/tap/api" "sync" "time" + + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/tap/api" + basenine "github.com/up9inc/basenine/client/go" ) type EntryInserter interface { @@ -50,7 +51,7 @@ func (e *BasenineEntryInserter) Insert(entry *api.Entry) error { return nil } -func initializeConnection() *basenine.Connection{ +func initializeConnection() *basenine.Connection { for { connection, err := basenine.NewConnection(shared.BasenineHost, shared.BaseninePort) if err != nil { diff --git a/agent/pkg/api/socket_data_streamer.go b/agent/pkg/api/socket_data_streamer.go index 0a9df3ba0..32e55cb49 100644 --- a/agent/pkg/api/socket_data_streamer.go +++ b/agent/pkg/api/socket_data_streamer.go @@ -5,11 +5,11 @@ import ( "encoding/json" "time" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + tapApi "github.com/kubeshark/kubeshark/tap/api" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - tapApi "github.com/up9inc/mizu/tap/api" ) type EntryStreamer interface { diff --git a/agent/pkg/api/socket_routes.go b/agent/pkg/api/socket_routes.go index 78eb7f224..867dde5b9 100644 --- a/agent/pkg/api/socket_routes.go +++ b/agent/pkg/api/socket_routes.go @@ -8,10 +8,10 @@ import ( "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/up9inc/mizu/agent/pkg/models" - "github.com/up9inc/mizu/agent/pkg/utils" - "github.com/up9inc/mizu/logger" - tapApi "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/agent/pkg/models" + "github.com/kubeshark/kubeshark/agent/pkg/utils" + "github.com/kubeshark/kubeshark/logger" + tapApi "github.com/kubeshark/kubeshark/tap/api" ) var ( diff --git a/agent/pkg/api/socket_server_handlers.go b/agent/pkg/api/socket_server_handlers.go index 72288e5ca..624bb9dc8 100644 --- a/agent/pkg/api/socket_server_handlers.go +++ b/agent/pkg/api/socket_server_handlers.go @@ -6,15 +6,15 @@ import ( "sync" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/models" - "github.com/up9inc/mizu/agent/pkg/providers/tappedPods" - "github.com/up9inc/mizu/agent/pkg/providers/tappers" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/models" + "github.com/kubeshark/kubeshark/agent/pkg/providers/tappedPods" + "github.com/kubeshark/kubeshark/agent/pkg/providers/tappers" - tapApi "github.com/up9inc/mizu/tap/api" + tapApi "github.com/kubeshark/kubeshark/tap/api" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" ) type BrowserClient struct { diff --git a/agent/pkg/api/utils.go b/agent/pkg/api/utils.go index 625f246f6..5948feaa7 100644 --- a/agent/pkg/api/utils.go +++ b/agent/pkg/api/utils.go @@ -3,9 +3,9 @@ package api import ( "encoding/json" - "github.com/up9inc/mizu/agent/pkg/providers/tappedPods" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/agent/pkg/providers/tappedPods" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" ) func BroadcastTappedPodsStatus() { diff --git a/agent/pkg/app/main.go b/agent/pkg/app/main.go index 406c0005d..15caeba51 100644 --- a/agent/pkg/app/main.go +++ b/agent/pkg/app/main.go @@ -6,18 +6,18 @@ import ( "time" "github.com/antelman107/net-wait-go/wait" + "github.com/kubeshark/kubeshark/agent/pkg/api" + "github.com/kubeshark/kubeshark/agent/pkg/providers" + "github.com/kubeshark/kubeshark/agent/pkg/utils" + "github.com/kubeshark/kubeshark/logger" + tapApi "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/dbgctl" + amqpExt "github.com/kubeshark/kubeshark/tap/extensions/amqp" + httpExt "github.com/kubeshark/kubeshark/tap/extensions/http" + kafkaExt "github.com/kubeshark/kubeshark/tap/extensions/kafka" + redisExt "github.com/kubeshark/kubeshark/tap/extensions/redis" "github.com/op/go-logging" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/agent/pkg/api" - "github.com/up9inc/mizu/agent/pkg/providers" - "github.com/up9inc/mizu/agent/pkg/utils" - "github.com/up9inc/mizu/logger" - tapApi "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/dbgctl" - amqpExt "github.com/up9inc/mizu/tap/extensions/amqp" - httpExt "github.com/up9inc/mizu/tap/extensions/http" - kafkaExt "github.com/up9inc/mizu/tap/extensions/kafka" - redisExt "github.com/up9inc/mizu/tap/extensions/redis" ) var ( @@ -42,7 +42,7 @@ func LoadExtensions() { ProtocolsMap[k] = v } - if !dbgctl.MizuTapperDisableNonHttpExtensions { + if !dbgctl.KubesharkTapperDisableNonHttpExtensions { extensionAmqp := &tapApi.Extension{} dissectorAmqp := amqpExt.NewDissector() dissectorAmqp.Register(extensionAmqp) diff --git a/agent/pkg/config/config.go b/agent/pkg/config/config.go index 6a38e61e9..3065c4875 100644 --- a/agent/pkg/config/config.go +++ b/agent/pkg/config/config.go @@ -3,9 +3,10 @@ package config import ( "encoding/json" "fmt" - "github.com/up9inc/mizu/shared" "io/ioutil" "os" + + "github.com/kubeshark/kubeshark/shared" ) // these values are used when the config.json file is not present @@ -14,7 +15,7 @@ const ( DefaultDatabasePath string = "./entries" ) -var Config *shared.MizuAgentConfig +var Config *shared.KubesharkAgentConfig func LoadConfig() error { if Config != nil { @@ -45,8 +46,8 @@ func applyDefaultConfig() error { return nil } -func getDefaultConfig() (*shared.MizuAgentConfig, error) { - return &shared.MizuAgentConfig{ +func getDefaultConfig() (*shared.KubesharkAgentConfig, error) { + return &shared.KubesharkAgentConfig{ MaxDBSizeBytes: defaultMaxDatabaseSizeBytes, AgentDatabasePath: DefaultDatabasePath, }, nil diff --git a/agent/pkg/controllers/db_controller.go b/agent/pkg/controllers/db_controller.go index 265c16d6c..2a464bdcd 100644 --- a/agent/pkg/controllers/db_controller.go +++ b/agent/pkg/controllers/db_controller.go @@ -4,10 +4,10 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/kubeshark/kubeshark/agent/pkg/app" + "github.com/kubeshark/kubeshark/agent/pkg/config" + "github.com/kubeshark/kubeshark/shared" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/agent/pkg/app" - "github.com/up9inc/mizu/agent/pkg/config" - "github.com/up9inc/mizu/shared" ) func Flush(c *gin.Context) { diff --git a/agent/pkg/controllers/entries_controller.go b/agent/pkg/controllers/entries_controller.go index f0e128d7f..ee80399aa 100644 --- a/agent/pkg/controllers/entries_controller.go +++ b/agent/pkg/controllers/entries_controller.go @@ -3,14 +3,14 @@ package controllers import ( "net/http" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/entries" - "github.com/up9inc/mizu/agent/pkg/models" - "github.com/up9inc/mizu/agent/pkg/validation" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/entries" + "github.com/kubeshark/kubeshark/agent/pkg/models" + "github.com/kubeshark/kubeshark/agent/pkg/validation" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func HandleEntriesError(c *gin.Context, err error) bool { diff --git a/agent/pkg/controllers/metadata_controller.go b/agent/pkg/controllers/metadata_controller.go index 223c8582a..4b830c90c 100644 --- a/agent/pkg/controllers/metadata_controller.go +++ b/agent/pkg/controllers/metadata_controller.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/version" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/agent/pkg/version" + "github.com/kubeshark/kubeshark/shared" ) func GetVersion(c *gin.Context) { diff --git a/agent/pkg/controllers/oas_controller.go b/agent/pkg/controllers/oas_controller.go index 9b8814ec6..2a86da297 100644 --- a/agent/pkg/controllers/oas_controller.go +++ b/agent/pkg/controllers/oas_controller.go @@ -5,9 +5,9 @@ import ( "github.com/chanced/openapi" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/oas" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/oas" + "github.com/kubeshark/kubeshark/logger" ) func GetOASServers(c *gin.Context) { diff --git a/agent/pkg/controllers/oas_controller_test.go b/agent/pkg/controllers/oas_controller_test.go index d86a633aa..60e377928 100644 --- a/agent/pkg/controllers/oas_controller_test.go +++ b/agent/pkg/controllers/oas_controller_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/oas" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/oas" ) func TestGetOASServers(t *testing.T) { diff --git a/agent/pkg/controllers/query_controller.go b/agent/pkg/controllers/query_controller.go index f74230f8b..f6197a60a 100644 --- a/agent/pkg/controllers/query_controller.go +++ b/agent/pkg/controllers/query_controller.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/kubeshark/kubeshark/shared" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/shared" ) type ValidateResponse struct { diff --git a/agent/pkg/controllers/replay_controller.go b/agent/pkg/controllers/replay_controller.go index 7bbfdbf50..2b276fd3e 100644 --- a/agent/pkg/controllers/replay_controller.go +++ b/agent/pkg/controllers/replay_controller.go @@ -5,9 +5,9 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/replay" - "github.com/up9inc/mizu/agent/pkg/validation" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/agent/pkg/replay" + "github.com/kubeshark/kubeshark/agent/pkg/validation" + "github.com/kubeshark/kubeshark/logger" ) const ( diff --git a/agent/pkg/controllers/service_map_controller.go b/agent/pkg/controllers/service_map_controller.go index 065cd8361..d0de2fea9 100644 --- a/agent/pkg/controllers/service_map_controller.go +++ b/agent/pkg/controllers/service_map_controller.go @@ -3,8 +3,8 @@ package controllers import ( "net/http" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/servicemap" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/servicemap" "github.com/gin-gonic/gin" ) diff --git a/agent/pkg/controllers/service_map_controller_test.go b/agent/pkg/controllers/service_map_controller_test.go index 41d595f8f..bfc3707e8 100644 --- a/agent/pkg/controllers/service_map_controller_test.go +++ b/agent/pkg/controllers/service_map_controller_test.go @@ -7,12 +7,12 @@ import ( "net/http/httptest" "testing" - "github.com/up9inc/mizu/agent/pkg/dependency" - "github.com/up9inc/mizu/agent/pkg/servicemap" + "github.com/kubeshark/kubeshark/agent/pkg/dependency" + "github.com/kubeshark/kubeshark/agent/pkg/servicemap" "github.com/gin-gonic/gin" + tapApi "github.com/kubeshark/kubeshark/tap/api" "github.com/stretchr/testify/suite" - tapApi "github.com/up9inc/mizu/tap/api" ) const ( @@ -43,7 +43,7 @@ var ProtocolHttp = &tapApi.Protocol{ }, LongName: "Hypertext Transfer Protocol -- HTTP/1.1", Macro: "http", - BackgroundColor: "#205cf5", + BackgroundColor: "#326de6", ForegroundColor: "#ffffff", FontSize: 12, ReferenceLink: "https://datatracker.ietf.org/doc/html/rfc2616", diff --git a/agent/pkg/controllers/status_controller.go b/agent/pkg/controllers/status_controller.go index c565ec972..e643a735d 100644 --- a/agent/pkg/controllers/status_controller.go +++ b/agent/pkg/controllers/status_controller.go @@ -9,15 +9,15 @@ import ( core "k8s.io/api/core/v1" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/api" - "github.com/up9inc/mizu/agent/pkg/holder" - "github.com/up9inc/mizu/agent/pkg/providers" - "github.com/up9inc/mizu/agent/pkg/providers/tappedPods" - "github.com/up9inc/mizu/agent/pkg/providers/tappers" - "github.com/up9inc/mizu/agent/pkg/validation" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/agent/pkg/api" + "github.com/kubeshark/kubeshark/agent/pkg/holder" + "github.com/kubeshark/kubeshark/agent/pkg/providers" + "github.com/kubeshark/kubeshark/agent/pkg/providers/tappedPods" + "github.com/kubeshark/kubeshark/agent/pkg/providers/tappers" + "github.com/kubeshark/kubeshark/agent/pkg/validation" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/shared/kubernetes" ) func HealthCheck(c *gin.Context) { diff --git a/agent/pkg/entries/entries_provider.go b/agent/pkg/entries/entries_provider.go index 09973a299..8462764d6 100644 --- a/agent/pkg/entries/entries_provider.go +++ b/agent/pkg/entries/entries_provider.go @@ -6,12 +6,12 @@ import ( "fmt" "time" + "github.com/kubeshark/kubeshark/agent/pkg/app" + "github.com/kubeshark/kubeshark/agent/pkg/models" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + tapApi "github.com/kubeshark/kubeshark/tap/api" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/agent/pkg/app" - "github.com/up9inc/mizu/agent/pkg/models" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - tapApi "github.com/up9inc/mizu/tap/api" ) type EntriesProvider interface { diff --git a/agent/pkg/har/types.go b/agent/pkg/har/types.go index a2333c78e..fe2b385b2 100644 --- a/agent/pkg/har/types.go +++ b/agent/pkg/har/types.go @@ -5,7 +5,7 @@ import ( "time" "unicode/utf8" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) /* diff --git a/agent/pkg/har/utils.go b/agent/pkg/har/utils.go index cbeafd636..44f727d05 100644 --- a/agent/pkg/har/utils.go +++ b/agent/pkg/har/utils.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func BuildHeaders(rawHeaders map[string]interface{}) ([]Header, string, string, string, string, string) { diff --git a/agent/pkg/holder/main.go b/agent/pkg/holder/main.go index 54b83f118..7799e4083 100644 --- a/agent/pkg/holder/main.go +++ b/agent/pkg/holder/main.go @@ -1,6 +1,6 @@ package holder -import "github.com/up9inc/mizu/agent/pkg/resolver" +import "github.com/kubeshark/kubeshark/agent/pkg/resolver" var k8sResolver *resolver.Resolver diff --git a/agent/pkg/models/models.go b/agent/pkg/models/models.go index 1823225e4..363bc37c1 100644 --- a/agent/pkg/models/models.go +++ b/agent/pkg/models/models.go @@ -3,11 +3,11 @@ package models import ( "encoding/json" - "github.com/up9inc/mizu/agent/pkg/har" - tapApi "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/agent/pkg/har" + tapApi "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/shared" basenine "github.com/up9inc/basenine/client/go" - "github.com/up9inc/mizu/shared" ) type EntriesRequest struct { diff --git a/agent/pkg/oas/counters.go b/agent/pkg/oas/counters.go index 3a8f28fd5..7d9f60f23 100644 --- a/agent/pkg/oas/counters.go +++ b/agent/pkg/oas/counters.go @@ -2,9 +2,10 @@ package oas import ( "fmt" - "github.com/chanced/openapi" "math" "strings" + + "github.com/chanced/openapi" ) type Counter struct { @@ -66,8 +67,8 @@ func (m *CounterMap) addOther(other *CounterMap) { } func setCounterMsgIfOk(oldStr string, cnt *Counter) string { - tpl := "Mizu observed %d entries (%d failed), at %.3f hits/s, average response time is %.3f seconds" - if oldStr == "" || (strings.HasPrefix(oldStr, "Mizu ") && strings.HasSuffix(oldStr, " seconds")) { + tpl := "Kubeshark observed %d entries (%d failed), at %.3f hits/s, average response time is %.3f seconds" + if oldStr == "" || (strings.HasPrefix(oldStr, "Kubeshark ") && strings.HasSuffix(oldStr, " seconds")) { return fmt.Sprintf(tpl, cnt.Entries, cnt.Failures, cnt.SumDuration/float64(cnt.Entries), cnt.SumRT/float64(cnt.Entries)) } return oldStr diff --git a/agent/pkg/oas/feeder_test.go b/agent/pkg/oas/feeder_test.go index e12e557d3..05cb61b19 100644 --- a/agent/pkg/oas/feeder_test.go +++ b/agent/pkg/oas/feeder_test.go @@ -14,9 +14,9 @@ import ( "strings" "testing" - "github.com/up9inc/mizu/agent/pkg/har" + "github.com/kubeshark/kubeshark/agent/pkg/har" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func getFiles(baseDir string) (result []string, err error) { diff --git a/agent/pkg/oas/ignores.go b/agent/pkg/oas/ignores.go index fd3195688..33af79ef3 100644 --- a/agent/pkg/oas/ignores.go +++ b/agent/pkg/oas/ignores.go @@ -24,7 +24,7 @@ var ignoredHeaders = []string{ "keep-alive", "etag", "alt-svc", "x-csrf-token", "x-ua-compatible", "vary", "x-powered-by", "age", "allow", "www-authenticate", "expect-ct", "timing-allow-origin", "referrer-policy", "x-aspnet-version", "x-aspnetmvc-version", "x-timer", "x-abuse-info", "x-mod-pagespeed", - "duration_ms", // UP9 custom + "duration_ms", } var ignoredHeaderPrefixes = []string{ diff --git a/agent/pkg/oas/oas-samples/carts.json b/agent/pkg/oas/oas-samples/carts.json index bf8768ff5..c5dbe08ad 100644 --- a/agent/pkg/oas/oas-samples/carts.json +++ b/agent/pkg/oas/oas-samples/carts.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "http://carts", - "description": "Mizu observed 3 entries (0 failed), at 2.287 hits/s, average response time is 0.017 seconds", + "description": "Kubeshark observed 3 entries (0 failed), at 2.287 hits/s, average response time is 0.017 seconds", "version": "1.0" }, "servers": [ @@ -14,7 +14,7 @@ "/carts/{cartId}/items": { "get": { "summary": "/carts/{cartId}/items", - "description": "Mizu observed 3 entries (0 failed), at 2.287 hits/s, average response time is 0.017 seconds", + "description": "Kubeshark observed 3 entries (0 failed), at 2.287 hits/s, average response time is 0.017 seconds", "operationId": "84c9b926-1f73-4ab4-b381-3c124528959f", "responses": { "200": { @@ -93,4 +93,4 @@ "sumRT": 0.05, "sumDuration": 6.859940528869629 } -} \ No newline at end of file +} diff --git a/agent/pkg/oas/oas-samples/catalogue.json b/agent/pkg/oas/oas-samples/catalogue.json index c64b2335e..77ec7ae3f 100644 --- a/agent/pkg/oas/oas-samples/catalogue.json +++ b/agent/pkg/oas/oas-samples/catalogue.json @@ -12,7 +12,7 @@ "catalogue" ], "summary": "/catalogue", - "description": "Mizu observed 3 entries (0 failed), at 2.647 hits/s, average response time is 0.008 seconds", + "description": "Kubeshark observed 3 entries (0 failed), at 2.647 hits/s, average response time is 0.008 seconds", "operationId": "dd6c3dbe-6b6b-4ddd-baed-757e237ddb8a", "parameters": [ { @@ -221,7 +221,7 @@ "catalogue" ], "summary": "/catalogue/size", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.013 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.013 seconds", "operationId": "2315e69d-9d66-48cf-b3d3-fec9c30bd28b", "parameters": [ { @@ -298,7 +298,7 @@ "catalogue" ], "summary": "/catalogue/{id}", - "description": "Mizu observed 4 entries (0 failed), at 1.899 hits/s, average response time is 0.003 seconds", + "description": "Kubeshark observed 4 entries (0 failed), at 1.899 hits/s, average response time is 0.003 seconds", "parameters": [ { "name": "non-required-header", @@ -412,7 +412,7 @@ "/tags": { "get": { "summary": "/tags", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.007 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.007 seconds", "operationId": "c4d7d0ed-1a78-4370-a049-efe3abc631a6", "responses": { "200": { @@ -482,4 +482,4 @@ "sumRT": 0.05899999999999999, "sumDuration": 15.538749694824219 } -} \ No newline at end of file +} diff --git a/agent/pkg/oas/oas-samples/httpbin.org.json b/agent/pkg/oas/oas-samples/httpbin.org.json index b6b6ece19..2ec586f1f 100644 --- a/agent/pkg/oas/oas-samples/httpbin.org.json +++ b/agent/pkg/oas/oas-samples/httpbin.org.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "https://httpbin.org", - "description": "Mizu observed 19 entries (0 failed), at 0.106 hits/s, average response time is 0.172 seconds", + "description": "Kubeshark observed 19 entries (0 failed), at 0.106 hits/s, average response time is 0.172 seconds", "version": "1.0" }, "servers": [ @@ -14,7 +14,7 @@ "/appears-once": { "get": { "summary": "/appears-once", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", "operationId": "2d34623e-fde8-4720-8390-9a7439051755", "responses": { "200": { @@ -53,7 +53,7 @@ "/appears-twice": { "get": { "summary": "/appears-twice", - "description": "Mizu observed 2 entries (0 failed), at 0.500 hits/s, average response time is 0.630 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.500 hits/s, average response time is 0.630 seconds", "operationId": "9c5330f3-8062-468b-b5a3-df1ad82b4846", "responses": { "200": { @@ -92,7 +92,7 @@ "/body-optional": { "post": { "summary": "/body-optional", - "description": "Mizu observed 3 entries (0 failed), at 0.003 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 3 entries (0 failed), at 0.003 hits/s, average response time is 0.001 seconds", "operationId": "34f3d66c-b1f7-4dca-9cab-987fcc8ae472", "responses": { "200": { @@ -140,7 +140,7 @@ "/body-required": { "post": { "summary": "/body-required", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "ff6add53-ab1c-4d4e-b590-0835fa318276", "responses": { "200": { @@ -189,7 +189,7 @@ "/form-multipart": { "post": { "summary": "/form-multipart", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "153f0925-9fc7-4e9f-9d33-f1470f25f0f7", "responses": { "200": { @@ -261,7 +261,7 @@ "/form-urlencoded": { "post": { "summary": "/form-urlencoded", - "description": "Mizu observed 2 entries (0 failed), at 0.500 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.500 hits/s, average response time is 0.001 seconds", "operationId": "c92189f5-5636-46eb-ac71-92b17941a568", "responses": { "200": { @@ -348,7 +348,7 @@ "param-patterns" ], "summary": "/param-patterns/prefix-gibberish-fine/{prefixgibberishfineId}", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "85270437-7aae-4a5b-b988-3662092463d0", "responses": { "200": { @@ -406,7 +406,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}", - "description": "Mizu observed 2 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "da597734-1cf5-4d3b-917b-6b02dacf7b7b", "responses": { "200": { @@ -477,7 +477,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}/1", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "e965a245-9cfc-48ed-94e1-f765eadb3960", "responses": { "200": { @@ -548,7 +548,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}/static", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "7af420dc-f8b7-450f-8f6f-18b039aa3cde", "responses": { "200": { @@ -619,7 +619,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}/{param1}", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "02a1771d-2d50-4a8c-8be2-29c7e59b8435", "responses": { "200": { @@ -702,7 +702,7 @@ "/{Id}": { "get": { "summary": "/{Id}", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", "operationId": "77ec4910-d47a-46a5-8234-fb80a11034b4", "responses": { "200": { @@ -761,7 +761,7 @@ "/{Id}/sub1": { "get": { "summary": "/{Id}/sub1", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.111 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.111 seconds", "operationId": "198675eb-9faf-407b-83fa-0483a730bbbe", "responses": { "200": { @@ -819,7 +819,7 @@ "/{Id}/sub2": { "get": { "summary": "/{Id}/sub2", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.630 seconds", "operationId": "31d880f1-152f-4dd6-84a7-463e13b694a5", "responses": { "200": { @@ -894,4 +894,4 @@ "sumRT": 3.273999999999999, "sumDuration": 2.0100011825561523 } -} \ No newline at end of file +} diff --git a/agent/pkg/oas/oas-samples/trcc-api-service.json b/agent/pkg/oas/oas-samples/trcc-api-service.json index 982e95fec..9f4a5e5c0 100644 --- a/agent/pkg/oas/oas-samples/trcc-api-service.json +++ b/agent/pkg/oas/oas-samples/trcc-api-service.json @@ -9,7 +9,7 @@ "/hc": { "get": { "summary": "/hc", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "c9fdb168-cd8a-48d2-ac37-887ddadb810c", "responses": { "200": { @@ -51,7 +51,7 @@ "models" ], "summary": "/models/aaa/blacklist", - "description": "Mizu observed 2 entries (0 failed), at 0.420 hits/s, average response time is 0.002 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.420 hits/s, average response time is 0.002 seconds", "operationId": "aa04b7c2-11fc-49bd-86b5-fec0a336216d", "responses": { "200": { @@ -93,7 +93,7 @@ "models" ], "summary": "/models/andrey2/blacklist", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "a61a1b56-7205-4246-99de-baec013a53d9", "responses": { "200": { @@ -135,7 +135,7 @@ "models" ], "summary": "/models/default/blacklist", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "371ca033-3863-4546-bc7e-03b291a7a188", "responses": { "200": { @@ -177,7 +177,7 @@ "models" ], "summary": "/models/roee/blacklist", - "description": "Mizu observed 2 entries (0 failed), at 0.211 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.211 hits/s, average response time is 0.001 seconds", "operationId": "fba33b70-58d1-43e4-9223-38e854e78a77", "responses": { "200": { @@ -219,7 +219,7 @@ "models" ], "summary": "/models/roee/status", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.001 seconds", "operationId": "0653c2af-ef3f-43cd-b7e1-48f951d34fa2", "responses": { "200": { @@ -298,7 +298,7 @@ "models" ], "summary": "/models/{id}/blacklist", - "description": "Mizu observed 39 entries (0 failed), at 0.078 hits/s, average response time is 0.001 seconds", + "description": "Kubeshark observed 39 entries (0 failed), at 0.078 hits/s, average response time is 0.001 seconds", "operationId": "ce1b76bc-9bff-4438-a21d-0a7a6e5be503", "responses": { "200": { @@ -371,7 +371,7 @@ "models" ], "summary": "/models/{id}/status", - "description": "Mizu observed 7 entries (0 failed), at 0.543 hits/s, average response time is 0.193 seconds", + "description": "Kubeshark observed 7 entries (0 failed), at 0.543 hits/s, average response time is 0.193 seconds", "operationId": "2c46cc41-1ec7-4636-b97e-13e4a7296c65", "responses": { "200": { @@ -444,7 +444,7 @@ "models" ], "summary": "/models/{id}/suites/all/runs", - "description": "Mizu observed 69 entries (0 failed), at 0.093 hits/s, average response time is 0.029 seconds", + "description": "Kubeshark observed 69 entries (0 failed), at 0.093 hits/s, average response time is 0.029 seconds", "operationId": "6776caf3-87e7-4515-899d-4d4d6cfc0bb8", "responses": { "200": { @@ -520,7 +520,7 @@ "models" ], "summary": "/models/{id}/suites/all/runs/state", - "description": "Mizu observed 2 entries (0 failed), at 0.997 hits/s, average response time is 0.514 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.997 hits/s, average response time is 0.514 seconds", "operationId": "fe8186fa-b221-46e1-8130-9be1f00a7c2d", "responses": { "200": { @@ -622,7 +622,7 @@ "proxies" ], "summary": "/proxies", - "description": "Mizu observed 2 entries (0 failed), at 1.587 hits/s, average response time is 0.386 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 1.587 hits/s, average response time is 0.386 seconds", "operationId": "bff7bf3e-effa-43ad-8fce-bab2847a77aa", "responses": { "200": { @@ -674,7 +674,7 @@ "proxies" ], "summary": "/proxies/", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 1.022 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 1.022 seconds", "operationId": "9c12fbeb-b4cd-40a7-8962-5b9b01619a8e", "parameters": [ { @@ -748,7 +748,7 @@ "proxies" ], "summary": "/proxies/local", - "description": "Mizu observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.610 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.000 hits/s, average response time is 0.610 seconds", "operationId": "0f676cec-87ba-4a03-ac72-f48c3e90d5b8", "responses": { "200": { @@ -1568,7 +1568,7 @@ "/tapping/state": { "get": { "summary": "/tapping/state", - "description": "Mizu observed 8 entries (0 failed), at 0.760 hits/s, average response time is 0.258 seconds", + "description": "Kubeshark observed 8 entries (0 failed), at 0.760 hits/s, average response time is 0.258 seconds", "operationId": "b0c1e867-43ee-4f94-bcf8-58cd0ba0f5c8", "responses": { "200": { @@ -1630,7 +1630,7 @@ }, "post": { "summary": "/tapping/state", - "description": "Mizu observed 6 entries (1 failed), at 0.570 hits/s, average response time is 0.431 seconds", + "description": "Kubeshark observed 6 entries (1 failed), at 0.570 hits/s, average response time is 0.431 seconds", "operationId": "4245a3e5-ebff-4a5b-a7d7-a7fbae4b0fce", "responses": { "200": { @@ -1784,4 +1784,4 @@ "sumRT": 11.506999999999994, "sumDuration": 29.188997983932495 } -} \ No newline at end of file +} diff --git a/agent/pkg/oas/oas_generator.go b/agent/pkg/oas/oas_generator.go index b007d06cf..ef68d02bf 100644 --- a/agent/pkg/oas/oas_generator.go +++ b/agent/pkg/oas/oas_generator.go @@ -5,9 +5,9 @@ import ( "net/url" "sync" - "github.com/up9inc/mizu/agent/pkg/har" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/agent/pkg/har" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" ) var ( @@ -16,7 +16,7 @@ var ( ) type OasGeneratorSink interface { - HandleEntry(mizuEntry *api.Entry) + HandleEntry(kubesharkEntry *api.Entry) } type OasGenerator interface { @@ -58,34 +58,34 @@ func (g *defaultOasGenerator) IsStarted() bool { return g.started } -func (g *defaultOasGenerator) HandleEntry(mizuEntry *api.Entry) { +func (g *defaultOasGenerator) HandleEntry(kubesharkEntry *api.Entry) { if !g.started { return } - if mizuEntry.Protocol.Name == "http" { - dest := mizuEntry.Destination.Name + if kubesharkEntry.Protocol.Name == "http" { + dest := kubesharkEntry.Destination.Name if dest == "" { - logger.Log.Debugf("OAS: Unresolved entry %d", mizuEntry.Id) + logger.Log.Debugf("OAS: Unresolved entry %d", kubesharkEntry.Id) return } - entry, err := har.NewEntry(mizuEntry.Request, mizuEntry.Response, mizuEntry.StartTime, mizuEntry.ElapsedTime) + entry, err := har.NewEntry(kubesharkEntry.Request, kubesharkEntry.Response, kubesharkEntry.StartTime, kubesharkEntry.ElapsedTime) if err != nil { - logger.Log.Warningf("Failed to turn MizuEntry %d into HAR Entry: %s", mizuEntry.Id, err) + logger.Log.Warningf("Failed to turn KubesharkEntry %d into HAR Entry: %s", kubesharkEntry.Id, err) return } entryWSource := &EntryWithSource{ Entry: *entry, - Source: mizuEntry.Source.Name, + Source: kubesharkEntry.Source.Name, Destination: dest, - Id: mizuEntry.Id, + Id: kubesharkEntry.Id, } g.handleHARWithSource(entryWSource) } else { - logger.Log.Debugf("OAS: Unsupported protocol in entry %d: %s", mizuEntry.Id, mizuEntry.Protocol.Name) + logger.Log.Debugf("OAS: Unsupported protocol in entry %d: %s", kubesharkEntry.Id, kubesharkEntry.Protocol.Name) } } diff --git a/agent/pkg/oas/oas_generator_test.go b/agent/pkg/oas/oas_generator_test.go index e7e748e9a..54dfad5c4 100644 --- a/agent/pkg/oas/oas_generator_test.go +++ b/agent/pkg/oas/oas_generator_test.go @@ -2,7 +2,7 @@ package oas import ( "encoding/json" - "github.com/up9inc/mizu/agent/pkg/har" + "github.com/kubeshark/kubeshark/agent/pkg/har" "testing" "time" ) diff --git a/agent/pkg/oas/specgen.go b/agent/pkg/oas/specgen.go index d4528f454..b680f67ff 100644 --- a/agent/pkg/oas/specgen.go +++ b/agent/pkg/oas/specgen.go @@ -16,10 +16,10 @@ import ( "github.com/chanced/openapi" "github.com/google/uuid" + "github.com/kubeshark/kubeshark/logger" "github.com/nav-inc/datetime" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/agent/pkg/har" + "github.com/kubeshark/kubeshark/agent/pkg/har" "time" ) diff --git a/agent/pkg/oas/specgen_test.go b/agent/pkg/oas/specgen_test.go index eaba63eec..4a5c78a80 100644 --- a/agent/pkg/oas/specgen_test.go +++ b/agent/pkg/oas/specgen_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/chanced/openapi" - "github.com/up9inc/mizu/agent/pkg/har" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/agent/pkg/har" + "github.com/kubeshark/kubeshark/logger" "github.com/wI2L/jsondiff" ) @@ -23,7 +23,7 @@ func outputSpec(label string, spec *openapi.OpenAPI, t *testing.T) string { panic(err) } - if os.Getenv("MIZU_OAS_WRITE_FILES") != "" { + if os.Getenv("KUBESHARK_OAS_WRITE_FILES") != "" { path := "./oas-samples" err := os.MkdirAll(path, 0o755) if err != nil { @@ -169,7 +169,7 @@ func TestFileSingle(t *testing.T) { t.FailNow() } - if os.Getenv("MIZU_OAS_WRITE_FILES") != "" { + if os.Getenv("KUBESHARK_OAS_WRITE_FILES") != "" { err = ioutil.WriteFile(file+".spec.json", []byte(specText), 0644) if err != nil { panic(err) diff --git a/agent/pkg/oas/test_artifacts/params.har.spec.json b/agent/pkg/oas/test_artifacts/params.har.spec.json index dddf4a205..188ee39f4 100644 --- a/agent/pkg/oas/test_artifacts/params.har.spec.json +++ b/agent/pkg/oas/test_artifacts/params.har.spec.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "https://httpbin.org", - "description": "Mizu observed 19 entries (0 failed), at 0.10 hits/s, average response time is 0.17 seconds", + "description": "Kubeshark observed 19 entries (0 failed), at 0.10 hits/s, average response time is 0.17 seconds", "version": "1.0" }, "servers": [ @@ -14,7 +14,7 @@ "/appears-once": { "get": { "summary": "/appears-once", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.63 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.63 seconds", "operationId": "", "responses": { "200": { @@ -53,7 +53,7 @@ "/appears-twice": { "get": { "summary": "/appears-twice", - "description": "Mizu observed 2 entries (0 failed), at 0.50 hits/s, average response time is 0.63 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.50 hits/s, average response time is 0.63 seconds", "operationId": "", "responses": { "200": { @@ -92,7 +92,7 @@ "/body-optional": { "post": { "summary": "/body-optional", - "description": "Mizu observed 3 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 3 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -140,7 +140,7 @@ "/body-required": { "post": { "summary": "/body-required", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -189,7 +189,7 @@ "/form-multipart": { "post": { "summary": "/form-multipart", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -261,7 +261,7 @@ "/form-urlencoded": { "post": { "summary": "/form-urlencoded", - "description": "Mizu observed 2 entries (0 failed), at 0.50 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.50 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -348,7 +348,7 @@ "param-patterns" ], "summary": "/param-patterns/prefix-gibberish-fine/{prefixgibberishfineId}", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -406,7 +406,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}", - "description": "Mizu observed 2 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 2 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -477,7 +477,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}/1", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -548,7 +548,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}/static", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -619,7 +619,7 @@ "param-patterns" ], "summary": "/param-patterns/{parampatternId}/{param1}", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.00 seconds", "operationId": "", "responses": { "200": { @@ -702,7 +702,7 @@ "/{Id}": { "get": { "summary": "/{Id}", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.63 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.63 seconds", "operationId": "", "responses": { "200": { @@ -761,7 +761,7 @@ "/{Id}/sub1": { "get": { "summary": "/{Id}/sub1", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.11 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.11 seconds", "operationId": "", "responses": { "200": { @@ -819,7 +819,7 @@ "/{Id}/sub2": { "get": { "summary": "/{Id}/sub2", - "description": "Mizu observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.63 seconds", + "description": "Kubeshark observed 1 entries (0 failed), at 0.00 hits/s, average response time is 0.63 seconds", "operationId": "", "responses": { "200": { @@ -894,4 +894,4 @@ "sumRT": 3.27, "sumDuration": 2.01 } -} \ No newline at end of file +} diff --git a/agent/pkg/oas/tree.go b/agent/pkg/oas/tree.go index 532a8d9c2..7305d7845 100644 --- a/agent/pkg/oas/tree.go +++ b/agent/pkg/oas/tree.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/chanced/openapi" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) type NodePath = []string diff --git a/agent/pkg/oas/utils.go b/agent/pkg/oas/utils.go index 89b7639cc..2324645c3 100644 --- a/agent/pkg/oas/utils.go +++ b/agent/pkg/oas/utils.go @@ -6,10 +6,10 @@ import ( "strconv" "strings" - "github.com/up9inc/mizu/agent/pkg/har" + "github.com/kubeshark/kubeshark/agent/pkg/har" "github.com/chanced/openapi" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func exampleResolver(ref string) (*openapi.ExampleObj, error) { diff --git a/agent/pkg/providers/stats_provider.go b/agent/pkg/providers/stats_provider.go index 8f03f3a47..1563e2b20 100644 --- a/agent/pkg/providers/stats_provider.go +++ b/agent/pkg/providers/stats_provider.go @@ -9,8 +9,8 @@ import ( "time" "github.com/jinzhu/copier" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" ) type GeneralStats struct { diff --git a/agent/pkg/providers/stats_provider_test.go b/agent/pkg/providers/stats_provider_test.go index 96f227f8d..7ee892411 100644 --- a/agent/pkg/providers/stats_provider_test.go +++ b/agent/pkg/providers/stats_provider_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/up9inc/mizu/agent/pkg/providers" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/agent/pkg/providers" + "github.com/kubeshark/kubeshark/tap/api" ) func TestNoEntryAddedCount(t *testing.T) { diff --git a/agent/pkg/providers/tappedPods/tapped_pods_provider.go b/agent/pkg/providers/tappedPods/tapped_pods_provider.go index db52a718b..c6b2052b9 100644 --- a/agent/pkg/providers/tappedPods/tapped_pods_provider.go +++ b/agent/pkg/providers/tappedPods/tapped_pods_provider.go @@ -5,10 +5,10 @@ import ( "strings" "sync" - "github.com/up9inc/mizu/agent/pkg/providers/tappers" - "github.com/up9inc/mizu/agent/pkg/utils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/agent/pkg/providers/tappers" + "github.com/kubeshark/kubeshark/agent/pkg/utils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" ) const FilePath = shared.DataDirPath + "tapped-pods.json" diff --git a/agent/pkg/providers/tappers/tappers_provider.go b/agent/pkg/providers/tappers/tappers_provider.go index 9bdc63939..1f2066949 100644 --- a/agent/pkg/providers/tappers/tappers_provider.go +++ b/agent/pkg/providers/tappers/tappers_provider.go @@ -4,9 +4,9 @@ import ( "os" "sync" - "github.com/up9inc/mizu/agent/pkg/utils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/agent/pkg/utils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" ) const FilePath = shared.DataDirPath + "tappers-status.json" diff --git a/agent/pkg/replay/replay.go b/agent/pkg/replay/replay.go index fbb078634..28720994b 100644 --- a/agent/pkg/replay/replay.go +++ b/agent/pkg/replay/replay.go @@ -10,9 +10,9 @@ import ( "time" "github.com/google/uuid" - "github.com/up9inc/mizu/agent/pkg/app" - tapApi "github.com/up9inc/mizu/tap/api" - mizuhttp "github.com/up9inc/mizu/tap/extensions/http" + "github.com/kubeshark/kubeshark/agent/pkg/app" + tapApi "github.com/kubeshark/kubeshark/tap/api" + kubesharkhttp "github.com/kubeshark/kubeshark/tap/extensions/http" ) var ( @@ -71,8 +71,8 @@ func getEntryFromRequestResponse(extension *tapApi.Extension, request *http.Requ IsRequest: true, CaptureTime: captureTime, CaptureSize: 0, - Payload: &mizuhttp.HTTPPayload{ - Type: mizuhttp.TypeHttpRequest, + Payload: &kubesharkhttp.HTTPPayload{ + Type: kubesharkhttp.TypeHttpRequest, Data: request, }, }, @@ -80,8 +80,8 @@ func getEntryFromRequestResponse(extension *tapApi.Extension, request *http.Requ IsRequest: false, CaptureTime: captureTime, CaptureSize: 0, - Payload: &mizuhttp.HTTPPayload{ - Type: mizuhttp.TypeHttpResponse, + Payload: &kubesharkhttp.HTTPPayload{ + Type: kubesharkhttp.TypeHttpResponse, Data: response, }, }, @@ -121,7 +121,7 @@ func ExecuteRequest(replayData *Details, timeout time.Duration) *Response { for headerKey, headerValue := range replayData.Headers { request.Header.Add(headerKey, headerValue) } - request.Header.Add("x-mizu", uuid.New().String()) + request.Header.Add("x-kubeshark", uuid.New().String()) response, requestErr := client.Do(request) if requestErr != nil { diff --git a/agent/pkg/replay/replay_internal_test.go b/agent/pkg/replay/replay_internal_test.go index 33ed9647c..25b4bd38a 100644 --- a/agent/pkg/replay/replay_internal_test.go +++ b/agent/pkg/replay/replay_internal_test.go @@ -11,8 +11,8 @@ import ( "encoding/json" "github.com/google/uuid" - tapApi "github.com/up9inc/mizu/tap/api" - mizuhttp "github.com/up9inc/mizu/tap/extensions/http" + tapApi "github.com/kubeshark/kubeshark/tap/api" + kubesharkhttp "github.com/kubeshark/kubeshark/tap/extensions/http" ) func TestValid(t *testing.T) { @@ -60,7 +60,7 @@ func TestValid(t *testing.T) { for headerKey, headerValue := range replayData.Headers { request.Header.Add(headerKey, headerValue) } - request.Header.Add("x-mizu", uuid.New().String()) + request.Header.Add("x-kubeshark", uuid.New().String()) response, requestErr := client.Do(request) if requestErr != nil { @@ -68,7 +68,7 @@ func TestValid(t *testing.T) { } extensionHttp := &tapApi.Extension{} - dissectorHttp := mizuhttp.NewDissector() + dissectorHttp := kubesharkhttp.NewDissector() dissectorHttp.Register(extensionHttp) extensionHttp.Dissector = dissectorHttp extension := extensionHttp diff --git a/agent/pkg/resolver/README.md b/agent/pkg/resolver/README.md index 032cb4b06..629620969 100644 --- a/agent/pkg/resolver/README.md +++ b/agent/pkg/resolver/README.md @@ -1,29 +1,29 @@ ## Usage diff --git a/agent/pkg/resolver/resolver.go b/agent/pkg/resolver/resolver.go index 6b461d28d..090d73e71 100644 --- a/agent/pkg/resolver/resolver.go +++ b/agent/pkg/resolver/resolver.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" k8serrors "k8s.io/apimachinery/pkg/api/errors" cmap "github.com/orcaman/concurrent-map" diff --git a/agent/pkg/routes/db_routes.go b/agent/pkg/routes/db_routes.go index aa55e9c6b..ac4858f5f 100644 --- a/agent/pkg/routes/db_routes.go +++ b/agent/pkg/routes/db_routes.go @@ -1,7 +1,7 @@ package routes import ( - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" "github.com/gin-gonic/gin" ) diff --git a/agent/pkg/routes/entries_routes.go b/agent/pkg/routes/entries_routes.go index 00ccdbd1f..41aac0218 100644 --- a/agent/pkg/routes/entries_routes.go +++ b/agent/pkg/routes/entries_routes.go @@ -2,7 +2,7 @@ package routes import ( "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" ) // EntriesRoutes defines the group of har entries routes. diff --git a/agent/pkg/routes/metadata_routes.go b/agent/pkg/routes/metadata_routes.go index 7428c5598..ef359a64f 100644 --- a/agent/pkg/routes/metadata_routes.go +++ b/agent/pkg/routes/metadata_routes.go @@ -1,7 +1,7 @@ package routes import ( - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" "github.com/gin-gonic/gin" ) diff --git a/agent/pkg/routes/oas_routes.go b/agent/pkg/routes/oas_routes.go index d683539b9..551886bf2 100644 --- a/agent/pkg/routes/oas_routes.go +++ b/agent/pkg/routes/oas_routes.go @@ -2,7 +2,7 @@ package routes import ( "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" ) // OASRoutes methods to access OAS spec diff --git a/agent/pkg/routes/query_routes.go b/agent/pkg/routes/query_routes.go index 164d1ef9e..742c3a86a 100644 --- a/agent/pkg/routes/query_routes.go +++ b/agent/pkg/routes/query_routes.go @@ -2,7 +2,7 @@ package routes import ( "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" ) func QueryRoutes(ginApp *gin.Engine) { diff --git a/agent/pkg/routes/replay_routes.go b/agent/pkg/routes/replay_routes.go index d585e8232..76a93e1bf 100644 --- a/agent/pkg/routes/replay_routes.go +++ b/agent/pkg/routes/replay_routes.go @@ -2,7 +2,7 @@ package routes import ( "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" ) // ReplayRoutes defines the group of replay routes. diff --git a/agent/pkg/routes/service_map_routes.go b/agent/pkg/routes/service_map_routes.go index 5331efcc6..e12bb17ed 100644 --- a/agent/pkg/routes/service_map_routes.go +++ b/agent/pkg/routes/service_map_routes.go @@ -2,7 +2,7 @@ package routes import ( "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" ) func ServiceMapRoutes(ginApp *gin.Engine) { diff --git a/agent/pkg/routes/status_routes.go b/agent/pkg/routes/status_routes.go index 3110930cf..39cac1e7e 100644 --- a/agent/pkg/routes/status_routes.go +++ b/agent/pkg/routes/status_routes.go @@ -2,7 +2,7 @@ package routes import ( "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/agent/pkg/controllers" + "github.com/kubeshark/kubeshark/agent/pkg/controllers" ) func StatusRoutes(ginApp *gin.Engine) { diff --git a/agent/pkg/servicemap/models.go b/agent/pkg/servicemap/models.go index ba0639b3b..89707f4c5 100644 --- a/agent/pkg/servicemap/models.go +++ b/agent/pkg/servicemap/models.go @@ -1,7 +1,7 @@ package servicemap import ( - tapApi "github.com/up9inc/mizu/tap/api" + tapApi "github.com/kubeshark/kubeshark/tap/api" ) type ServiceMapStatus struct { diff --git a/agent/pkg/servicemap/servicemap.go b/agent/pkg/servicemap/servicemap.go index b186fedf0..17820ba47 100644 --- a/agent/pkg/servicemap/servicemap.go +++ b/agent/pkg/servicemap/servicemap.go @@ -5,8 +5,8 @@ import ( "github.com/jinzhu/copier" - "github.com/up9inc/mizu/logger" - tapApi "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + tapApi "github.com/kubeshark/kubeshark/tap/api" ) const ( diff --git a/agent/pkg/servicemap/servicemap_test.go b/agent/pkg/servicemap/servicemap_test.go index 2106b00c4..de0f0ca5a 100644 --- a/agent/pkg/servicemap/servicemap_test.go +++ b/agent/pkg/servicemap/servicemap_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" + tapApi "github.com/kubeshark/kubeshark/tap/api" "github.com/stretchr/testify/suite" - tapApi "github.com/up9inc/mizu/tap/api" ) const ( @@ -57,7 +57,7 @@ var ( }, LongName: "Hypertext Transfer Protocol -- HTTP/1.1", Macro: "http", - BackgroundColor: "#205cf5", + BackgroundColor: "#326de6", ForegroundColor: "#ffffff", FontSize: 12, ReferenceLink: "https://datatracker.ietf.org/doc/html/rfc2616", diff --git a/agent/pkg/utils/utils.go b/agent/pkg/utils/utils.go index cfbc7ae85..83e17b0d3 100644 --- a/agent/pkg/utils/utils.go +++ b/agent/pkg/utils/utils.go @@ -12,8 +12,8 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" ) var ( diff --git a/assets/mizu-example.png b/assets/kubeshark-example.png similarity index 100% rename from assets/mizu-example.png rename to assets/kubeshark-example.png diff --git a/assets/kubeshark-logo.svg b/assets/kubeshark-logo.svg new file mode 100644 index 000000000..251506761 --- /dev/null +++ b/assets/kubeshark-logo.svg @@ -0,0 +1,94 @@ + + + + + + + + + + diff --git a/assets/kubeshark-ui-clean.png b/assets/kubeshark-ui-clean.png new file mode 100644 index 000000000..dc1b1d87c Binary files /dev/null and b/assets/kubeshark-ui-clean.png differ diff --git a/assets/kubeshark-ui.png b/assets/kubeshark-ui.png new file mode 100644 index 000000000..a450a398e Binary files /dev/null and b/assets/kubeshark-ui.png differ diff --git a/assets/mizu-logo.svg b/assets/mizu-logo.svg deleted file mode 100644 index cbf980097..000000000 --- a/assets/mizu-logo.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/mizu-ui.png b/assets/mizu-ui.png deleted file mode 100644 index 0a27eface..000000000 Binary files a/assets/mizu-ui.png and /dev/null differ diff --git a/cli/Makefile b/cli/Makefile index 112a403db..16a962fe0 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -15,9 +15,9 @@ help: ## This help. @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) install: - go install mizu.go + go install kubeshark.go -build-debug: ## Build mizu CLI for debug +build-debug: ## Build kubeshark CLI for debug export GCLFAGS='-gcflags="all=-N -l"' ${MAKE} build-base @@ -25,15 +25,15 @@ build: export LDFLAGS_EXT='-s -w' ${MAKE} build-base -build-base: ## Build mizu CLI binary (select platform via GOOS / GOARCH env variables). +build-base: ## Build kubeshark CLI binary (select platform via GOOS / GOARCH env variables). go build ${GCLFAGS} -ldflags="${LDFLAGS_EXT} \ - -X 'github.com/up9inc/mizu/cli/mizu.GitCommitHash=$(COMMIT_HASH)' \ - -X 'github.com/up9inc/mizu/cli/mizu.Branch=$(GIT_BRANCH)' \ - -X 'github.com/up9inc/mizu/cli/mizu.BuildTimestamp=$(BUILD_TIMESTAMP)' \ - -X 'github.com/up9inc/mizu/cli/mizu.Platform=$(SUFFIX)' \ - -X 'github.com/up9inc/mizu/cli/mizu.Ver=$(VER)'" \ - -o bin/mizu_$(SUFFIX) mizu.go - (cd bin && shasum -a 256 mizu_${SUFFIX} > mizu_${SUFFIX}.sha256) + -X 'github.com/kubeshark/kubeshark/cli/kubeshark.GitCommitHash=$(COMMIT_HASH)' \ + -X 'github.com/kubeshark/kubeshark/cli/kubeshark.Branch=$(GIT_BRANCH)' \ + -X 'github.com/kubeshark/kubeshark/cli/kubeshark.BuildTimestamp=$(BUILD_TIMESTAMP)' \ + -X 'github.com/kubeshark/kubeshark/cli/kubeshark.Platform=$(SUFFIX)' \ + -X 'github.com/kubeshark/kubeshark/cli/kubeshark.Ver=$(VER)'" \ + -o bin/kubeshark_$(SUFFIX) kubeshark.go + (cd bin && shasum -a 256 kubeshark_${SUFFIX} > kubeshark_${SUFFIX}.sha256) build-all: ## Build for all supported platforms. echo "Compiling for every OS and Platform" && \ @@ -43,7 +43,7 @@ build-all: ## Build for all supported platforms. $(MAKE) build GOOS=darwin GOARCH=amd64 && \ $(MAKE) build GOOS=darwin GOARCH=arm64 && \ $(MAKE) build GOOS=windows GOARCH=amd64 && \ - mv ./bin/mizu_windows_amd64 ./bin/mizu.exe && \ + mv ./bin/kubeshark_windows_amd64 ./bin/kubeshark.exe && \ echo "---------" && \ find ./bin -ls diff --git a/cli/README.md.TEMPLATE b/cli/README.md.TEMPLATE index 61105895c..5765a2127 100644 --- a/cli/README.md.TEMPLATE +++ b/cli/README.md.TEMPLATE @@ -1,35 +1,35 @@ -# Mizu release _VER_ -Mizu CHANGELOG is now part of [Mizu wiki](https://github.com/up9inc/mizu/wiki/CHANGELOG) +# Kubeshark release _VER_ +Kubeshark CHANGELOG is now part of [Kubeshark wiki](https://github.com/kubeshark/kubeshark/wiki/CHANGELOG) -## Download Mizu for your platform +## Download Kubeshark for your platform **Mac** (x86-64/Intel) ``` -curl -Lo mizu https://github.com/up9inc/mizu/releases/download/_VER_/mizu_darwin_amd64 && chmod 755 mizu +curl -Lo kubeshark https://github.com/kubeshark/kubeshark/releases/download/_VER_/kubeshark_darwin_amd64 && chmod 755 kubeshark ``` **Mac** (AArch64/Apple M1 silicon) ``` -rm -f mizu && curl -Lo mizu https://github.com/up9inc/mizu/releases/download/_VER_/mizu_darwin_arm64 && chmod 755 mizu +rm -f kubeshark && curl -Lo kubeshark https://github.com/kubeshark/kubeshark/releases/download/_VER_/kubeshark_darwin_arm64 && chmod 755 kubeshark ``` **Linux** (x86-64) ``` -curl -Lo mizu https://github.com/up9inc/mizu/releases/download/_VER_/mizu_linux_amd64 && chmod 755 mizu +curl -Lo kubeshark https://github.com/kubeshark/kubeshark/releases/download/_VER_/kubeshark_linux_amd64 && chmod 755 kubeshark ``` **Linux** (AArch64) ``` -curl -Lo mizu https://github.com/up9inc/mizu/releases/download/_VER_/mizu_linux_arm64 && chmod 755 mizu +curl -Lo kubeshark https://github.com/kubeshark/kubeshark/releases/download/_VER_/kubeshark_linux_arm64 && chmod 755 kubeshark ``` **Windows** (x86-64) ``` -curl -LO https://github.com/up9inc/mizu/releases/download/_VER_/mizu.exe +curl -LO https://github.com/kubeshark/kubeshark/releases/download/_VER_/kubeshark.exe ``` ### Checksums SHA256 checksums available for compiled binaries. -Run `shasum -a 256 -c mizu_OS_ARCH.sha256` to verify. +Run `shasum -a 256 -c kubeshark_OS_ARCH.sha256` to verify. diff --git a/cli/apiserver/provider.go b/cli/apiserver/provider.go index f0a22b3f9..57c34a903 100644 --- a/cli/apiserver/provider.go +++ b/cli/apiserver/provider.go @@ -7,11 +7,11 @@ import ( "net/http" "time" - "github.com/up9inc/mizu/cli/utils" + "github.com/kubeshark/kubeshark/cli/utils" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" core "k8s.io/api/core/v1" ) diff --git a/cli/bucket/provider.go b/cli/bucket/provider.go index e007952a0..0e223854f 100644 --- a/cli/bucket/provider.go +++ b/cli/bucket/provider.go @@ -2,22 +2,22 @@ package bucket import ( "fmt" - "github.com/up9inc/mizu/cli/utils" + "github.com/kubeshark/kubeshark/cli/utils" "io/ioutil" "net/http" "time" ) type Provider struct { - url string - client *http.Client + url string + client *http.Client } const DefaultTimeout = 2 * time.Second func NewProvider(url string, timeout time.Duration) *Provider { return &Provider{ - url: url, + url: url, client: &http.Client{ Timeout: timeout, }, diff --git a/cli/cmd/check.go b/cli/cmd/check.go index 7e9673f05..adb40c6e2 100644 --- a/cli/cmd/check.go +++ b/cli/cmd/check.go @@ -2,16 +2,16 @@ package cmd import ( "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/logger" ) var checkCmd = &cobra.Command{ Use: "check", - Short: "Check the Mizu installation for potential problems", + Short: "Check the Kubeshark installation for potential problems", RunE: func(cmd *cobra.Command, args []string) error { - runMizuCheck() + runKubesharkCheck() return nil }, } @@ -24,7 +24,7 @@ func init() { logger.Log.Debug(err) } - checkCmd.Flags().Bool(configStructs.PreTapCheckName, defaultCheckConfig.PreTap, "Check pre-tap Mizu installation for potential problems") - checkCmd.Flags().Bool(configStructs.PreInstallCheckName, defaultCheckConfig.PreInstall, "Check pre-install Mizu installation for potential problems") + checkCmd.Flags().Bool(configStructs.PreTapCheckName, defaultCheckConfig.PreTap, "Check pre-tap Kubeshark installation for potential problems") + checkCmd.Flags().Bool(configStructs.PreInstallCheckName, defaultCheckConfig.PreInstall, "Check pre-install Kubeshark installation for potential problems") checkCmd.Flags().Bool(configStructs.ImagePullCheckName, defaultCheckConfig.ImagePull, "Test connectivity to container image registry by creating and removing a temporary pod in 'default' namespace") } diff --git a/cli/cmd/check/imagePullInCluster.go b/cli/cmd/check/imagePullInCluster.go index 4a23869c8..0ebbf77c5 100644 --- a/cli/cmd/check/imagePullInCluster.go +++ b/cli/cmd/check/imagePullInCluster.go @@ -6,9 +6,9 @@ import ( "regexp" "time" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -17,7 +17,7 @@ func ImagePullInCluster(ctx context.Context, kubernetesProvider *kubernetes.Prov logger.Log.Infof("\nimage-pull-in-cluster\n--------------------") namespace := "default" - podName := "mizu-test" + podName := "kubeshark-test" defer func() { if err := kubernetesProvider.RemovePod(ctx, namespace, podName); err != nil { @@ -31,11 +31,11 @@ func ImagePullInCluster(ctx context.Context, kubernetesProvider *kubernetes.Prov } if err := checkImagePulled(ctx, kubernetesProvider, namespace, podName); err != nil { - logger.Log.Errorf("%v cluster is not able to pull mizu containers from docker hub, err: %v", fmt.Sprintf(uiUtils.Red, "✗"), err) + logger.Log.Errorf("%v cluster is not able to pull kubeshark containers from docker hub, err: %v", fmt.Sprintf(uiUtils.Red, "✗"), err) return false } - logger.Log.Infof("%v cluster is able to pull mizu containers from docker hub", fmt.Sprintf(uiUtils.Green, "√")) + logger.Log.Infof("%v cluster is able to pull kubeshark containers from docker hub", fmt.Sprintf(uiUtils.Green, "√")) return true } @@ -85,7 +85,7 @@ func createImagePullInClusterPod(ctx context.Context, kubernetesProvider *kubern Containers: []core.Container{ { Name: "probe", - Image: "up9inc/busybox", + Image: "kubeshark/busybox", ImagePullPolicy: "Always", Command: []string{"cat"}, Stdin: true, diff --git a/cli/cmd/check/kubernetesApi.go b/cli/cmd/check/kubernetesApi.go index 9b8fa6080..fbc4f077a 100644 --- a/cli/cmd/check/kubernetesApi.go +++ b/cli/cmd/check/kubernetesApi.go @@ -3,11 +3,11 @@ package check import ( "fmt" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" - "github.com/up9inc/mizu/shared/semver" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" + "github.com/kubeshark/kubeshark/shared/semver" ) func KubernetesApi() (*kubernetes.Provider, *semver.SemVersion, bool) { diff --git a/cli/cmd/check/kubernetesPermissions.go b/cli/cmd/check/kubernetesPermissions.go index df807b652..caae3d594 100644 --- a/cli/cmd/check/kubernetesPermissions.go +++ b/cli/cmd/check/kubernetesPermissions.go @@ -6,11 +6,11 @@ import ( "fmt" "strings" - "github.com/up9inc/mizu/cli/bucket" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/bucket" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" rbac "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" @@ -41,7 +41,7 @@ func TapKubernetesPermissions(ctx context.Context, embedFS embed.FS, kubernetesP switch resource := obj.(type) { case *rbac.Role: - return checkRulesPermissions(ctx, kubernetesProvider, resource.Rules, config.Config.MizuResourcesNamespace) + return checkRulesPermissions(ctx, kubernetesProvider, resource.Rules, config.Config.KubesharkResourcesNamespace) case *rbac.ClusterRole: return checkRulesPermissions(ctx, kubernetesProvider, resource.Rules, "") } diff --git a/cli/cmd/check/kubernetesResources.go b/cli/cmd/check/kubernetesResources.go index 87bdd87cd..320f23ce6 100644 --- a/cli/cmd/check/kubernetesResources.go +++ b/cli/cmd/check/kubernetesResources.go @@ -4,29 +4,29 @@ import ( "context" "fmt" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" ) func KubernetesResources(ctx context.Context, kubernetesProvider *kubernetes.Provider) bool { logger.Log.Infof("\nk8s-components\n--------------------") - exist, err := kubernetesProvider.DoesNamespaceExist(ctx, config.Config.MizuResourcesNamespace) - allResourcesExist := checkResourceExist(config.Config.MizuResourcesNamespace, "namespace", exist, err) + exist, err := kubernetesProvider.DoesNamespaceExist(ctx, config.Config.KubesharkResourcesNamespace) + allResourcesExist := checkResourceExist(config.Config.KubesharkResourcesNamespace, "namespace", exist, err) - exist, err = kubernetesProvider.DoesConfigMapExist(ctx, config.Config.MizuResourcesNamespace, kubernetes.ConfigMapName) + exist, err = kubernetesProvider.DoesConfigMapExist(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.ConfigMapName) allResourcesExist = checkResourceExist(kubernetes.ConfigMapName, "config map", exist, err) && allResourcesExist - exist, err = kubernetesProvider.DoesServiceAccountExist(ctx, config.Config.MizuResourcesNamespace, kubernetes.ServiceAccountName) + exist, err = kubernetesProvider.DoesServiceAccountExist(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.ServiceAccountName) allResourcesExist = checkResourceExist(kubernetes.ServiceAccountName, "service account", exist, err) && allResourcesExist if config.Config.IsNsRestrictedMode() { - exist, err = kubernetesProvider.DoesRoleExist(ctx, config.Config.MizuResourcesNamespace, kubernetes.RoleName) + exist, err = kubernetesProvider.DoesRoleExist(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.RoleName) allResourcesExist = checkResourceExist(kubernetes.RoleName, "role", exist, err) && allResourcesExist - exist, err = kubernetesProvider.DoesRoleBindingExist(ctx, config.Config.MizuResourcesNamespace, kubernetes.RoleBindingName) + exist, err = kubernetesProvider.DoesRoleBindingExist(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.RoleBindingName) allResourcesExist = checkResourceExist(kubernetes.RoleBindingName, "role binding", exist, err) && allResourcesExist } else { exist, err = kubernetesProvider.DoesClusterRoleExist(ctx, kubernetes.ClusterRoleName) @@ -36,7 +36,7 @@ func KubernetesResources(ctx context.Context, kubernetesProvider *kubernetes.Pro allResourcesExist = checkResourceExist(kubernetes.ClusterRoleBindingName, "cluster role binding", exist, err) && allResourcesExist } - exist, err = kubernetesProvider.DoesServiceExist(ctx, config.Config.MizuResourcesNamespace, kubernetes.ApiServerPodName) + exist, err = kubernetesProvider.DoesServiceExist(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.ApiServerPodName) allResourcesExist = checkResourceExist(kubernetes.ApiServerPodName, "service", exist, err) && allResourcesExist allResourcesExist = checkPodResourcesExist(ctx, kubernetesProvider) && allResourcesExist @@ -45,7 +45,7 @@ func KubernetesResources(ctx context.Context, kubernetesProvider *kubernetes.Pro } func checkPodResourcesExist(ctx context.Context, kubernetesProvider *kubernetes.Provider) bool { - if pods, err := kubernetesProvider.ListPodsByAppLabel(ctx, config.Config.MizuResourcesNamespace, kubernetes.ApiServerPodName); err != nil { + if pods, err := kubernetesProvider.ListPodsByAppLabel(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.ApiServerPodName); err != nil { logger.Log.Errorf("%v error checking if '%v' pod is running, err: %v", fmt.Sprintf(uiUtils.Red, "✗"), kubernetes.ApiServerPodName, err) return false } else if len(pods) == 0 { @@ -58,7 +58,7 @@ func checkPodResourcesExist(ctx context.Context, kubernetesProvider *kubernetes. logger.Log.Infof("%v '%v' pod running", fmt.Sprintf(uiUtils.Green, "√"), kubernetes.ApiServerPodName) - if pods, err := kubernetesProvider.ListPodsByAppLabel(ctx, config.Config.MizuResourcesNamespace, kubernetes.TapperPodName); err != nil { + if pods, err := kubernetesProvider.ListPodsByAppLabel(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.TapperPodName); err != nil { logger.Log.Errorf("%v error checking if '%v' pods are running, err: %v", fmt.Sprintf(uiUtils.Red, "✗"), kubernetes.TapperPodName, err) return false } else { diff --git a/cli/cmd/check/kubernetesVersion.go b/cli/cmd/check/kubernetesVersion.go index 6e346e423..80add4349 100644 --- a/cli/cmd/check/kubernetesVersion.go +++ b/cli/cmd/check/kubernetesVersion.go @@ -3,10 +3,10 @@ package check import ( "fmt" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" - "github.com/up9inc/mizu/shared/semver" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" + "github.com/kubeshark/kubeshark/shared/semver" ) func KubernetesVersion(kubernetesVersion *semver.SemVersion) bool { diff --git a/cli/cmd/check/serverConnection.go b/cli/cmd/check/serverConnection.go index 7190a5d79..d05eb9d0a 100644 --- a/cli/cmd/check/serverConnection.go +++ b/cli/cmd/check/serverConnection.go @@ -5,21 +5,21 @@ import ( "fmt" "regexp" - "github.com/up9inc/mizu/cli/apiserver" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/apiserver" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" ) func ServerConnection(kubernetesProvider *kubernetes.Provider) bool { logger.Log.Infof("\nAPI-server-connectivity\n--------------------") - serverUrl := fmt.Sprintf("http://%s", kubernetes.GetMizuApiServerProxiedHostAndPath(config.Config.Tap.GuiPort)) + serverUrl := fmt.Sprintf("http://%s", kubernetes.GetKubesharkApiServerProxiedHostAndPath(config.Config.Tap.GuiPort)) apiServerProvider := apiserver.NewProvider(serverUrl, 1, apiserver.DefaultTimeout) if err := apiServerProvider.TestConnection(); err == nil { - logger.Log.Infof("%v found Mizu server tunnel available and connected successfully to API server", fmt.Sprintf(uiUtils.Green, "√")) + logger.Log.Infof("%v found Kubeshark server tunnel available and connected successfully to API server", fmt.Sprintf(uiUtils.Green, "√")) return true } @@ -46,7 +46,7 @@ func checkProxy(serverUrl string, kubernetesProvider *kubernetes.Provider) error ctx, cancel := context.WithCancel(context.Background()) defer cancel() - httpServer, err := kubernetes.StartProxy(kubernetesProvider, config.Config.Tap.ProxyHost, config.Config.Tap.GuiPort, config.Config.MizuResourcesNamespace, kubernetes.ApiServerPodName, cancel) + httpServer, err := kubernetes.StartProxy(kubernetesProvider, config.Config.Tap.ProxyHost, config.Config.Tap.GuiPort, config.Config.KubesharkResourcesNamespace, kubernetes.ApiServerPodName, cancel) if err != nil { return err } @@ -68,7 +68,7 @@ func checkPortForward(serverUrl string, kubernetesProvider *kubernetes.Provider) defer cancel() podRegex, _ := regexp.Compile(kubernetes.ApiServerPodName) - forwarder, err := kubernetes.NewPortForward(kubernetesProvider, config.Config.MizuResourcesNamespace, podRegex, config.Config.Tap.GuiPort, ctx, cancel) + forwarder, err := kubernetes.NewPortForward(kubernetesProvider, config.Config.KubesharkResourcesNamespace, podRegex, config.Config.Tap.GuiPort, ctx, cancel) if err != nil { return err } diff --git a/cli/cmd/checkRunner.go b/cli/cmd/checkRunner.go index 33879ac7d..27ca67cc1 100644 --- a/cli/cmd/checkRunner.go +++ b/cli/cmd/checkRunner.go @@ -5,10 +5,10 @@ import ( "embed" "fmt" - "github.com/up9inc/mizu/cli/cmd/check" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/cli/cmd/check" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" ) var ( @@ -16,8 +16,8 @@ var ( embedFS embed.FS ) -func runMizuCheck() { - logger.Log.Infof("Mizu checks\n===================") +func runKubesharkCheck() { + logger.Log.Infof("Kubeshark checks\n===================") ctx, cancel := context.WithCancel(context.Background()) defer cancel() // cancel will be called when this function exits diff --git a/cli/cmd/clean.go b/cli/cmd/clean.go index 63b18b136..958775ba9 100644 --- a/cli/cmd/clean.go +++ b/cli/cmd/clean.go @@ -6,7 +6,7 @@ import ( var cleanCmd = &cobra.Command{ Use: "clean", - Short: "Removes all mizu resources", + Short: "Removes all kubeshark resources", RunE: func(cmd *cobra.Command, args []string) error { performCleanCommand() return nil diff --git a/cli/cmd/cleanRunner.go b/cli/cmd/cleanRunner.go index d9858c0ac..74b07aeb5 100644 --- a/cli/cmd/cleanRunner.go +++ b/cli/cmd/cleanRunner.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/up9inc/mizu/cli/config" + "github.com/kubeshark/kubeshark/cli/config" ) func performCleanCommand() { @@ -10,5 +10,5 @@ func performCleanCommand() { return } - finishMizuExecution(kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.MizuResourcesNamespace) + finishKubesharkExecution(kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.KubesharkResourcesNamespace) } diff --git a/cli/cmd/common.go b/cli/cmd/common.go index 0c35e372b..a812c7d8d 100644 --- a/cli/cmd/common.go +++ b/cli/cmd/common.go @@ -9,26 +9,26 @@ import ( "regexp" "time" - "github.com/up9inc/mizu/cli/apiserver" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/cli/errormessage" - "github.com/up9inc/mizu/cli/mizu" - "github.com/up9inc/mizu/cli/mizu/fsUtils" - "github.com/up9inc/mizu/cli/resources" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/cli/apiserver" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/cli/errormessage" + "github.com/kubeshark/kubeshark/cli/kubeshark" + "github.com/kubeshark/kubeshark/cli/kubeshark/fsUtils" + "github.com/kubeshark/kubeshark/cli/resources" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/shared" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" ) func GetApiServerUrl(port uint16) string { - return fmt.Sprintf("http://%s", kubernetes.GetMizuApiServerProxiedHostAndPath(port)) + return fmt.Sprintf("http://%s", kubernetes.GetKubesharkApiServerProxiedHostAndPath(port)) } func startProxyReportErrorIfAny(kubernetesProvider *kubernetes.Provider, ctx context.Context, cancel context.CancelFunc, port uint16) { - httpServer, err := kubernetes.StartProxy(kubernetesProvider, config.Config.Tap.ProxyHost, port, config.Config.MizuResourcesNamespace, kubernetes.ApiServerPodName, cancel) + httpServer, err := kubernetes.StartProxy(kubernetesProvider, config.Config.Tap.ProxyHost, port, config.Config.KubesharkResourcesNamespace, kubernetes.ApiServerPodName, cancel) if err != nil { logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error occured while running k8s proxy %v\n"+ "Try setting different port by using --%s", errormessage.FormatError(err), configStructs.GuiPortTapName)) @@ -44,7 +44,7 @@ func startProxyReportErrorIfAny(kubernetesProvider *kubernetes.Provider, ctx con } podRegex, _ := regexp.Compile(kubernetes.ApiServerPodName) - if _, err := kubernetes.NewPortForward(kubernetesProvider, config.Config.MizuResourcesNamespace, podRegex, port, ctx, cancel); err != nil { + if _, err := kubernetes.NewPortForward(kubernetesProvider, config.Config.KubesharkResourcesNamespace, podRegex, port, ctx, cancel); err != nil { logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error occured while running port forward %v\n"+ "Try setting different port by using --%s", errormessage.FormatError(err), configStructs.GuiPortTapName)) cancel() @@ -89,32 +89,32 @@ func getKubernetesProviderForCli() (*kubernetes.Provider, error) { func handleKubernetesProviderError(err error) { var clusterBehindProxyErr *kubernetes.ClusterBehindProxyError if ok := errors.As(err, &clusterBehindProxyErr); ok { - logger.Log.Errorf("cannot establish http-proxy connection to the Kubernetes cluster. If you’re using Lens or similar tool, please run mizu with regular kubectl config using --%v %v=$HOME/.kube/config flag", config.SetCommandName, config.KubeConfigPathConfigName) + logger.Log.Errorf("cannot establish http-proxy connection to the Kubernetes cluster. If you’re using Lens or similar tool, please run kubeshark with regular kubectl config using --%v %v=$HOME/.kube/config flag", config.SetCommandName, config.KubeConfigPathConfigName) } else { logger.Log.Error(err) } } -func finishMizuExecution(kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, mizuResourcesNamespace string) { +func finishKubesharkExecution(kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, kubesharkResourcesNamespace string) { removalCtx, cancel := context.WithTimeout(context.Background(), cleanupTimeout) defer cancel() dumpLogsIfNeeded(removalCtx, kubernetesProvider) - resources.CleanUpMizuResources(removalCtx, cancel, kubernetesProvider, isNsRestrictedMode, mizuResourcesNamespace) + resources.CleanUpKubesharkResources(removalCtx, cancel, kubernetesProvider, isNsRestrictedMode, kubesharkResourcesNamespace) } func dumpLogsIfNeeded(ctx context.Context, kubernetesProvider *kubernetes.Provider) { if !config.Config.DumpLogs { return } - mizuDir := mizu.GetMizuFolderPath() - filePath := path.Join(mizuDir, fmt.Sprintf("mizu_logs_%s.zip", time.Now().Format("2006_01_02__15_04_05"))) + kubesharkDir := kubeshark.GetKubesharkFolderPath() + filePath := path.Join(kubesharkDir, fmt.Sprintf("kubeshark_logs_%s.zip", time.Now().Format("2006_01_02__15_04_05"))) if err := fsUtils.DumpLogs(ctx, kubernetesProvider, filePath); err != nil { logger.Log.Errorf("Failed dump logs %v", err) } } -func getSerializedMizuAgentConfig(mizuAgentConfig *shared.MizuAgentConfig) (string, error) { - serializedConfig, err := json.Marshal(mizuAgentConfig) +func getSerializedKubesharkAgentConfig(kubesharkAgentConfig *shared.KubesharkAgentConfig) (string, error) { + serializedConfig, err := json.Marshal(kubesharkAgentConfig) if err != nil { return "", err } diff --git a/cli/cmd/config.go b/cli/cmd/config.go index 7414073ab..66939dc70 100644 --- a/cli/cmd/config.go +++ b/cli/cmd/config.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" ) var configCmd = &cobra.Command{ diff --git a/cli/cmd/goUtils/funcWrappers.go b/cli/cmd/goUtils/funcWrappers.go index 16eb2c6c9..01855ec80 100644 --- a/cli/cmd/goUtils/funcWrappers.go +++ b/cli/cmd/goUtils/funcWrappers.go @@ -4,7 +4,7 @@ import ( "reflect" "runtime/debug" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func HandleExcWrapper(fn interface{}, params ...interface{}) (result []reflect.Value) { diff --git a/cli/cmd/install.go b/cli/cmd/install.go index b6b42c05c..0624a3d80 100644 --- a/cli/cmd/install.go +++ b/cli/cmd/install.go @@ -2,16 +2,16 @@ package cmd import ( "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/logger" ) var installCmd = &cobra.Command{ Use: "install", - Short: "Installs mizu components", + Short: "Installs kubeshark components", RunE: func(cmd *cobra.Command, args []string) error { - runMizuInstall() + runKubesharkInstall() return nil }, } @@ -24,5 +24,5 @@ func init() { logger.Log.Debug(err) } - installCmd.Flags().BoolP(configStructs.OutInstallName, "o", defaultInstallConfig.Out, "print (to stdout) Kubernetes manifest used to install Mizu Pro edition") + installCmd.Flags().BoolP(configStructs.OutInstallName, "o", defaultInstallConfig.Out, "print (to stdout) Kubernetes manifest used to install Kubeshark Pro edition") } diff --git a/cli/cmd/installRunner.go b/cli/cmd/installRunner.go index fa6ac3118..c37dfd3b3 100644 --- a/cli/cmd/installRunner.go +++ b/cli/cmd/installRunner.go @@ -4,12 +4,13 @@ import ( "fmt" "strings" - "github.com/up9inc/mizu/cli/bucket" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/cli/bucket" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/logger" ) -func runMizuInstall() { +func runKubesharkInstall() { + // TODO: Remove this function if config.Config.Install.Out { bucketProvider := bucket.NewProvider(config.Config.Install.TemplateUrl, bucket.DefaultTimeout) installTemplate, err := bucketProvider.GetInstallTemplate(config.Config.Install.TemplateName) @@ -23,10 +24,10 @@ func runMizuInstall() { } var sb strings.Builder - sb.WriteString("Hello! This command can be used to install Mizu Pro edition on your Kubernetes cluster.") + sb.WriteString("Hello! This command can be used to install Kubeshark Pro edition on your Kubernetes cluster.") sb.WriteString("\nPlease run:") - sb.WriteString("\n\tmizu install -o | kubectl apply -n mizu -f -") - sb.WriteString("\n\nor use helm chart as described in https://getmizu.io/docs/installing-mizu/centralized-installation\n") + sb.WriteString("\n\tkubeshark install -o | kubectl apply -n kubeshark -f -") + sb.WriteString("\n\nor use helm chart as described in https://getkubeshark.io/docs/installing-kubeshark/centralized-installation\n") fmt.Print(sb.String()) } diff --git a/cli/cmd/logs.go b/cli/cmd/logs.go index cbcdbafcb..466cf3ee4 100644 --- a/cli/cmd/logs.go +++ b/cli/cmd/logs.go @@ -4,12 +4,12 @@ import ( "context" "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/cli/errormessage" + "github.com/kubeshark/kubeshark/cli/kubeshark/fsUtils" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/cli/errormessage" - "github.com/up9inc/mizu/cli/mizu/fsUtils" - "github.com/up9inc/mizu/logger" ) var logsCmd = &cobra.Command{ @@ -44,5 +44,5 @@ func init() { logger.Log.Debug(err) } - logsCmd.Flags().StringP(configStructs.FileLogsName, "f", defaultLogsConfig.FileStr, "Path for zip file (default current \\mizu_logs.zip)") + logsCmd.Flags().StringP(configStructs.FileLogsName, "f", defaultLogsConfig.FileStr, "Path for zip file (default current \\kubeshark_logs.zip)") } diff --git a/cli/cmd/permissionFiles/permissions-all-namespaces-debug-optional.yaml b/cli/cmd/permissionFiles/permissions-all-namespaces-debug-optional.yaml index 93fabd504..02540a150 100644 --- a/cli/cmd/permissionFiles/permissions-all-namespaces-debug-optional.yaml +++ b/cli/cmd/permissionFiles/permissions-all-namespaces-debug-optional.yaml @@ -2,7 +2,7 @@ kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-debug-clusterrole + name: kubeshark-runner-debug-clusterrole rules: - apiGroups: ["events.k8s.io"] resources: ["events"] @@ -14,12 +14,12 @@ rules: kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-debug-clusterrolebindings + name: kubeshark-runner-debug-clusterrolebindings subjects: - kind: User name: user-with-clusterwide-access apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole - name: mizu-runner-debug-clusterrole + name: kubeshark-runner-debug-clusterrole apiGroup: rbac.authorization.k8s.io diff --git a/cli/cmd/permissionFiles/permissions-all-namespaces-ip-resolution-optional.yaml b/cli/cmd/permissionFiles/permissions-all-namespaces-ip-resolution-optional.yaml index 859d1a86b..1f9b654fa 100644 --- a/cli/cmd/permissionFiles/permissions-all-namespaces-ip-resolution-optional.yaml +++ b/cli/cmd/permissionFiles/permissions-all-namespaces-ip-resolution-optional.yaml @@ -1,8 +1,8 @@ -# This example shows permissions that are required for Mizu to resolve IPs to service names +# This example shows permissions that are required for Kubeshark to resolve IPs to service names kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-resolver-clusterrole + name: kubeshark-resolver-clusterrole rules: - apiGroups: [""] resources: ["serviceaccounts"] @@ -26,12 +26,12 @@ rules: kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-resolver-clusterrolebindings + name: kubeshark-resolver-clusterrolebindings subjects: - kind: User name: user-with-clusterwide-access apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole - name: mizu-resolver-clusterrole + name: kubeshark-resolver-clusterrole apiGroup: rbac.authorization.k8s.io diff --git a/cli/cmd/permissionFiles/permissions-all-namespaces-tap.yaml b/cli/cmd/permissionFiles/permissions-all-namespaces-tap.yaml index 65fa5f38b..af6464dce 100644 --- a/cli/cmd/permissionFiles/permissions-all-namespaces-tap.yaml +++ b/cli/cmd/permissionFiles/permissions-all-namespaces-tap.yaml @@ -1,8 +1,8 @@ -# This example shows the permissions that are required in order to run the `mizu tap` command +# This example shows the permissions that are required in order to run the `kubeshark tap` command kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-clusterrole + name: kubeshark-runner-clusterrole rules: - apiGroups: [""] resources: ["pods"] @@ -29,12 +29,12 @@ rules: kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-clusterrolebindings + name: kubeshark-runner-clusterrolebindings subjects: - kind: User name: user-with-clusterwide-access apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole - name: mizu-runner-clusterrole + name: kubeshark-runner-clusterrole apiGroup: rbac.authorization.k8s.io diff --git a/cli/cmd/permissionFiles/permissions-ns-debug-optional.yaml b/cli/cmd/permissionFiles/permissions-ns-debug-optional.yaml index 631f3ae71..e634fad50 100644 --- a/cli/cmd/permissionFiles/permissions-ns-debug-optional.yaml +++ b/cli/cmd/permissionFiles/permissions-ns-debug-optional.yaml @@ -2,7 +2,7 @@ kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-debug-role + name: kubeshark-runner-debug-role rules: - apiGroups: ["events.k8s.io"] resources: ["events"] @@ -14,12 +14,12 @@ rules: kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-debug-rolebindings + name: kubeshark-runner-debug-rolebindings subjects: - kind: User name: user-with-restricted-access apiGroup: rbac.authorization.k8s.io roleRef: kind: Role - name: mizu-runner-debug-role + name: kubeshark-runner-debug-role apiGroup: rbac.authorization.k8s.io diff --git a/cli/cmd/permissionFiles/permissions-ns-ip-resolution-optional.yaml b/cli/cmd/permissionFiles/permissions-ns-ip-resolution-optional.yaml index 54bf50a56..2fee82bca 100644 --- a/cli/cmd/permissionFiles/permissions-ns-ip-resolution-optional.yaml +++ b/cli/cmd/permissionFiles/permissions-ns-ip-resolution-optional.yaml @@ -1,8 +1,8 @@ -# This example shows permissions that are required for Mizu to resolve IPs to service names in namespace-restricted mode +# This example shows permissions that are required for Kubeshark to resolve IPs to service names in namespace-restricted mode kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-resolver-role + name: kubeshark-resolver-role rules: - apiGroups: [""] resources: ["serviceaccounts"] @@ -26,12 +26,12 @@ rules: kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-resolver-rolebindings + name: kubeshark-resolver-rolebindings subjects: - kind: User name: user-with-restricted-access apiGroup: rbac.authorization.k8s.io roleRef: kind: Role - name: mizu-resolver-role + name: kubeshark-resolver-role apiGroup: rbac.authorization.k8s.io diff --git a/cli/cmd/permissionFiles/permissions-ns-tap.yaml b/cli/cmd/permissionFiles/permissions-ns-tap.yaml index 6bfe9b816..26f939fe9 100644 --- a/cli/cmd/permissionFiles/permissions-ns-tap.yaml +++ b/cli/cmd/permissionFiles/permissions-ns-tap.yaml @@ -1,8 +1,8 @@ -# This example shows the permissions that are required in order to run the `mizu tap` command in namespace-restricted mode +# This example shows the permissions that are required in order to run the `kubeshark tap` command in namespace-restricted mode kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-role + name: kubeshark-runner-role rules: - apiGroups: [""] resources: ["pods"] @@ -26,12 +26,12 @@ rules: kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mizu-runner-rolebindings + name: kubeshark-runner-rolebindings subjects: - kind: User name: user-with-restricted-access apiGroup: rbac.authorization.k8s.io roleRef: kind: Role - name: mizu-runner-role + name: kubeshark-runner-role apiGroup: rbac.authorization.k8s.io diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 5e5ff1582..620ec6376 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -5,20 +5,20 @@ import ( "time" "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/kubeshark" + "github.com/kubeshark/kubeshark/cli/kubeshark/fsUtils" + "github.com/kubeshark/kubeshark/cli/kubeshark/version" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/mizu" - "github.com/up9inc/mizu/cli/mizu/fsUtils" - "github.com/up9inc/mizu/cli/mizu/version" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" ) var rootCmd = &cobra.Command{ - Use: "mizu", + Use: "kubeshark", Short: "A web traffic viewer for kubernetes", Long: `A web traffic viewer for kubernetes -Further info is available at https://github.com/up9inc/mizu`, +Further info is available at https://github.com/kubeshark/kubeshark`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if err := config.InitConfig(cmd); err != nil { logger.Log.Fatal(err) @@ -51,8 +51,8 @@ func printNewVersionIfNeeded(versionChan chan string) { // Execute adds all child commands to the root command and sets flags appropriately. // This is called by main.main(). It only needs to happen once to the tapCmd. func Execute() { - if err := fsUtils.EnsureDir(mizu.GetMizuFolderPath()); err != nil { - logger.Log.Errorf("Failed to use mizu folder, %v", err) + if err := fsUtils.EnsureDir(kubeshark.GetKubesharkFolderPath()); err != nil { + logger.Log.Errorf("Failed to use kubeshark folder, %v", err) } logger.InitLogger(fsUtils.GetLogFilePath()) diff --git a/cli/cmd/tap.go b/cli/cmd/tap.go index c9efa7308..91de9c9b5 100644 --- a/cli/cmd/tap.go +++ b/cli/cmd/tap.go @@ -4,11 +4,11 @@ import ( "errors" "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/cli/errormessage" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/cli/errormessage" - "github.com/up9inc/mizu/logger" ) var tapCmd = &cobra.Command{ @@ -17,7 +17,7 @@ var tapCmd = &cobra.Command{ Long: `Record the ingoing traffic of a kubernetes pod. Supported protocols are HTTP and gRPC.`, RunE: func(cmd *cobra.Command, args []string) error { - RunMizuTap() + RunKubesharkTap() return nil }, PreRunE: func(cmd *cobra.Command, args []string) error { @@ -31,7 +31,7 @@ Supported protocols are HTTP and gRPC.`, return errormessage.FormatError(err) } - logger.Log.Infof("Mizu will store up to %s of traffic, old traffic will be cleared once the limit is reached.", config.Config.Tap.HumanMaxEntriesDBSize) + logger.Log.Infof("Kubeshark will store up to %s of traffic, old traffic will be cleared once the limit is reached.", config.Config.Tap.HumanMaxEntriesDBSize) return nil }, diff --git a/cli/cmd/tapRunner.go b/cli/cmd/tapRunner.go index 1fe45dbde..97a652dbf 100644 --- a/cli/cmd/tapRunner.go +++ b/cli/cmd/tapRunner.go @@ -8,37 +8,37 @@ import ( "strings" "time" - "github.com/up9inc/mizu/cli/resources" - "github.com/up9inc/mizu/cli/utils" + "github.com/kubeshark/kubeshark/cli/resources" + "github.com/kubeshark/kubeshark/cli/utils" core "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/up9inc/mizu/cli/apiserver" - "github.com/up9inc/mizu/cli/cmd/goUtils" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/cli/errormessage" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/shared/kubernetes" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/cli/apiserver" + "github.com/kubeshark/kubeshark/cli/cmd/goUtils" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/cli/errormessage" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/shared/kubernetes" + "github.com/kubeshark/kubeshark/tap/api" ) const cleanupTimeout = time.Minute type tapState struct { - startTime time.Time - targetNamespaces []string - mizuServiceAccountExists bool + startTime time.Time + targetNamespaces []string + kubesharkServiceAccountExists bool } var state tapState var apiProvider *apiserver.Provider -func RunMizuTap() { +func RunKubesharkTap() { state.startTime = time.Now() apiProvider = apiserver.NewProvider(GetApiServerUrl(config.Config.Tap.GuiPort), apiserver.DefaultRetries, apiserver.DefaultTimeout) @@ -53,17 +53,17 @@ func RunMizuTap() { state.targetNamespaces = getNamespaces(kubernetesProvider) - mizuAgentConfig := getTapMizuAgentConfig() - serializedMizuConfig, err := getSerializedMizuAgentConfig(mizuAgentConfig) + kubesharkAgentConfig := getTapKubesharkAgentConfig() + serializedKubesharkConfig, err := getSerializedKubesharkAgentConfig(kubesharkAgentConfig) if err != nil { - logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error serializing mizu config: %v", errormessage.FormatError(err))) + logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error serializing kubeshark config: %v", errormessage.FormatError(err))) return } if config.Config.IsNsRestrictedMode() { - if len(state.targetNamespaces) != 1 || !shared.Contains(state.targetNamespaces, config.Config.MizuResourcesNamespace) { - logger.Log.Errorf("Not supported mode. Mizu can't resolve IPs in other namespaces when running in namespace restricted mode.\n"+ - "You can use the same namespace for --%s and --%s", configStructs.NamespacesTapName, config.MizuResourcesNamespaceConfigName) + if len(state.targetNamespaces) != 1 || !shared.Contains(state.targetNamespaces, config.Config.KubesharkResourcesNamespace) { + logger.Log.Errorf("Not supported mode. Kubeshark can't resolve IPs in other namespaces when running in namespace restricted mode.\n"+ + "You can use the same namespace for --%s and --%s", configStructs.NamespacesTapName, config.KubesharkResourcesNamespaceConfigName) return } } @@ -85,13 +85,13 @@ func RunMizuTap() { return } - logger.Log.Infof("Waiting for Mizu Agent to start...") - if state.mizuServiceAccountExists, err = resources.CreateTapMizuResources(ctx, kubernetesProvider, serializedMizuConfig, config.Config.IsNsRestrictedMode(), config.Config.MizuResourcesNamespace, config.Config.AgentImage, config.Config.Tap.MaxEntriesDBSizeBytes(), config.Config.Tap.ApiServerResources, config.Config.ImagePullPolicy(), config.Config.LogLevel(), config.Config.Tap.Profiler); err != nil { + logger.Log.Infof("Waiting for Kubeshark Agent to start...") + if state.kubesharkServiceAccountExists, err = resources.CreateTapKubesharkResources(ctx, kubernetesProvider, serializedKubesharkConfig, config.Config.IsNsRestrictedMode(), config.Config.KubesharkResourcesNamespace, config.Config.AgentImage, config.Config.Tap.MaxEntriesDBSizeBytes(), config.Config.Tap.ApiServerResources, config.Config.ImagePullPolicy(), config.Config.LogLevel(), config.Config.Tap.Profiler); err != nil { var statusError *k8serrors.StatusError if errors.As(err, &statusError) && (statusError.ErrStatus.Reason == metav1.StatusReasonAlreadyExists) { - logger.Log.Info("Mizu is already running in this namespace, change the `mizu-resources-namespace` configuration or run `mizu clean` to remove the currently running Mizu instance") + logger.Log.Info("Kubeshark is already running in this namespace, change the `kubeshark-resources-namespace` configuration or run `kubeshark clean` to remove the currently running Kubeshark instance") } else { - defer resources.CleanUpMizuResources(ctx, cancel, kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.MizuResourcesNamespace) + defer resources.CleanUpKubesharkResources(ctx, cancel, kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.KubesharkResourcesNamespace) logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error creating resources: %v", errormessage.FormatError(err))) } @@ -108,28 +108,28 @@ func RunMizuTap() { } func finishTapExecution(kubernetesProvider *kubernetes.Provider) { - finishMizuExecution(kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.MizuResourcesNamespace) + finishKubesharkExecution(kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.KubesharkResourcesNamespace) } -func getTapMizuAgentConfig() *shared.MizuAgentConfig { - mizuAgentConfig := shared.MizuAgentConfig{ - MaxDBSizeBytes: config.Config.Tap.MaxEntriesDBSizeBytes(), - InsertionFilter: config.Config.Tap.GetInsertionFilter(), - AgentImage: config.Config.AgentImage, - PullPolicy: config.Config.ImagePullPolicyStr, - LogLevel: config.Config.LogLevel(), - TapperResources: config.Config.Tap.TapperResources, - MizuResourcesNamespace: config.Config.MizuResourcesNamespace, - AgentDatabasePath: shared.DataDirPath, - ServiceMap: config.Config.ServiceMap, - OAS: config.Config.OAS, +func getTapKubesharkAgentConfig() *shared.KubesharkAgentConfig { + kubesharkAgentConfig := shared.KubesharkAgentConfig{ + MaxDBSizeBytes: config.Config.Tap.MaxEntriesDBSizeBytes(), + InsertionFilter: config.Config.Tap.GetInsertionFilter(), + AgentImage: config.Config.AgentImage, + PullPolicy: config.Config.ImagePullPolicyStr, + LogLevel: config.Config.LogLevel(), + TapperResources: config.Config.Tap.TapperResources, + KubesharkResourcesNamespace: config.Config.KubesharkResourcesNamespace, + AgentDatabasePath: shared.DataDirPath, + ServiceMap: config.Config.ServiceMap, + OAS: config.Config.OAS, } - return &mizuAgentConfig + return &kubesharkAgentConfig } /* -this function is a bit problematic as it might be detached from the actual pods the mizu api server will tap. +this function is a bit problematic as it might be detached from the actual pods the kubeshark api server will tap. The alternative would be to wait for api server to be ready and then query it for the pods it listens to, this has the arguably worse drawback of taking a relatively very long time before the user sees which pods are targeted, if any. */ @@ -148,21 +148,21 @@ func printTappedPodsPreview(ctx context.Context, kubernetesProvider *kubernetes. } func startTapperSyncer(ctx context.Context, cancel context.CancelFunc, provider *kubernetes.Provider, targetNamespaces []string, startTime time.Time) error { - tapperSyncer, err := kubernetes.CreateAndStartMizuTapperSyncer(ctx, provider, kubernetes.TapperSyncerConfig{ - TargetNamespaces: targetNamespaces, - PodFilterRegex: *config.Config.Tap.PodRegex(), - MizuResourcesNamespace: config.Config.MizuResourcesNamespace, - AgentImage: config.Config.AgentImage, - TapperResources: config.Config.Tap.TapperResources, - ImagePullPolicy: config.Config.ImagePullPolicy(), - LogLevel: config.Config.LogLevel(), - MizuApiFilteringOptions: api.TrafficFilteringOptions{ + tapperSyncer, err := kubernetes.CreateAndStartKubesharkTapperSyncer(ctx, provider, kubernetes.TapperSyncerConfig{ + TargetNamespaces: targetNamespaces, + PodFilterRegex: *config.Config.Tap.PodRegex(), + KubesharkResourcesNamespace: config.Config.KubesharkResourcesNamespace, + AgentImage: config.Config.AgentImage, + TapperResources: config.Config.Tap.TapperResources, + ImagePullPolicy: config.Config.ImagePullPolicy(), + LogLevel: config.Config.LogLevel(), + KubesharkApiFilteringOptions: api.TrafficFilteringOptions{ IgnoredUserAgents: config.Config.Tap.IgnoredUserAgents, }, - MizuServiceAccountExists: state.mizuServiceAccountExists, - ServiceMesh: config.Config.Tap.ServiceMesh, - Tls: config.Config.Tap.Tls, - MaxLiveStreams: config.Config.Tap.MaxLiveStreams, + KubesharkServiceAccountExists: state.kubesharkServiceAccountExists, + ServiceMesh: config.Config.Tap.ServiceMesh, + Tls: config.Config.Tap.Tls, + MaxLiveStreams: config.Config.Tap.MaxLiveStreams, }, startTime) if err != nil { @@ -174,14 +174,14 @@ func startTapperSyncer(ctx context.Context, cancel context.CancelFunc, provider select { case syncerErr, ok := <-tapperSyncer.ErrorOut: if !ok { - logger.Log.Debug("mizuTapperSyncer err channel closed, ending listener loop") + logger.Log.Debug("kubesharkTapperSyncer err channel closed, ending listener loop") return } logger.Log.Errorf(uiUtils.Error, getErrorDisplayTextForK8sTapManagerError(syncerErr)) cancel() case _, ok := <-tapperSyncer.TapPodChangesOut: if !ok { - logger.Log.Debug("mizuTapperSyncer pod changes channel closed, ending listener loop") + logger.Log.Debug("kubesharkTapperSyncer pod changes channel closed, ending listener loop") return } if err := apiProvider.ReportTappedPods(tapperSyncer.CurrentlyTappedPods); err != nil { @@ -189,14 +189,14 @@ func startTapperSyncer(ctx context.Context, cancel context.CancelFunc, provider } case tapperStatus, ok := <-tapperSyncer.TapperStatusChangedOut: if !ok { - logger.Log.Debug("mizuTapperSyncer tapper status changed channel closed, ending listener loop") + logger.Log.Debug("kubesharkTapperSyncer tapper status changed channel closed, ending listener loop") return } if err := apiProvider.ReportTapperStatus(tapperStatus); err != nil { logger.Log.Debugf("[Error] failed update tapper status %v", err) } case <-ctx.Done(): - logger.Log.Debug("mizuTapperSyncer event listener loop exiting due to context done") + logger.Log.Debug("kubesharkTapperSyncer event listener loop exiting due to context done") return } } @@ -210,7 +210,7 @@ func printNoPodsFoundSuggestion(targetNamespaces []string) { if !shared.Contains(targetNamespaces, kubernetes.K8sAllNamespaces) { suggestionStr = ". You can also try selecting a different namespace with -n or tap all namespaces with -A" } - logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Did not find any currently running pods that match the regex argument, mizu will automatically tap matching pods if any are created later%s", suggestionStr)) + logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Did not find any currently running pods that match the regex argument, kubeshark will automatically tap matching pods if any are created later%s", suggestionStr)) } func getErrorDisplayTextForK8sTapManagerError(err kubernetes.K8sTapManagerError) string { @@ -229,7 +229,7 @@ func getErrorDisplayTextForK8sTapManagerError(err kubernetes.K8sTapManagerError) func watchApiServerPod(ctx context.Context, kubernetesProvider *kubernetes.Provider, cancel context.CancelFunc) { podExactRegex := regexp.MustCompile(fmt.Sprintf("^%s$", kubernetes.ApiServerPodName)) podWatchHelper := kubernetes.NewPodWatchHelper(kubernetesProvider, podExactRegex) - eventChan, errorChan := kubernetes.FilteredWatch(ctx, podWatchHelper, []string{config.Config.MizuResourcesNamespace}, podWatchHelper) + eventChan, errorChan := kubernetes.FilteredWatch(ctx, podWatchHelper, []string{config.Config.KubesharkResourcesNamespace}, podWatchHelper) isPodReady := false apiServerTimeoutSec := config.GetIntEnvConfig(config.ApiServerTimeoutSec, 120) @@ -274,12 +274,12 @@ func watchApiServerPod(ctx context.Context, kubernetesProvider *kubernetes.Provi continue } - logger.Log.Errorf("[ERROR] Agent creation, watching %v namespace, error: %v", config.Config.MizuResourcesNamespace, err) + logger.Log.Errorf("[ERROR] Agent creation, watching %v namespace, error: %v", config.Config.KubesharkResourcesNamespace, err) cancel() case <-timeAfter: if !isPodReady { - logger.Log.Errorf(uiUtils.Error, "Mizu API server was not ready in time") + logger.Log.Errorf(uiUtils.Error, "Kubeshark API server was not ready in time") cancel() } case <-ctx.Done(): @@ -292,7 +292,7 @@ func watchApiServerPod(ctx context.Context, kubernetesProvider *kubernetes.Provi func watchApiServerEvents(ctx context.Context, kubernetesProvider *kubernetes.Provider, cancel context.CancelFunc) { podExactRegex := regexp.MustCompile(fmt.Sprintf("^%s", kubernetes.ApiServerPodName)) eventWatchHelper := kubernetes.NewEventWatchHelper(kubernetesProvider, podExactRegex, "pod") - eventChan, errorChan := kubernetes.FilteredWatch(ctx, eventWatchHelper, []string{config.Config.MizuResourcesNamespace}, eventWatchHelper) + eventChan, errorChan := kubernetes.FilteredWatch(ctx, eventWatchHelper, []string{config.Config.KubesharkResourcesNamespace}, eventWatchHelper) for { select { case wEvent, ok := <-eventChan: @@ -303,7 +303,7 @@ func watchApiServerEvents(ctx context.Context, kubernetesProvider *kubernetes.Pr event, err := wEvent.ToEvent() if err != nil { - logger.Log.Debugf("[ERROR] parsing Mizu resource event: %+v", err) + logger.Log.Debugf("[ERROR] parsing Kubeshark resource event: %+v", err) continue } @@ -322,7 +322,7 @@ func watchApiServerEvents(ctx context.Context, kubernetesProvider *kubernetes.Pr switch event.Reason { case "FailedScheduling", "Failed": - logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Mizu API Server status: %s - %s", event.Reason, event.Note)) + logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Kubeshark API Server status: %s - %s", event.Reason, event.Note)) cancel() } @@ -344,12 +344,12 @@ func postApiServerStarted(ctx context.Context, kubernetesProvider *kubernetes.Pr startProxyReportErrorIfAny(kubernetesProvider, ctx, cancel, config.Config.Tap.GuiPort) if err := startTapperSyncer(ctx, cancel, kubernetesProvider, state.targetNamespaces, state.startTime); err != nil { - logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error starting mizu tapper syncer: %v", errormessage.FormatError(err))) + logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error starting kubeshark tapper syncer: %v", errormessage.FormatError(err))) cancel() } url := GetApiServerUrl(config.Config.Tap.GuiPort) - logger.Log.Infof("Mizu is available at %s", url) + logger.Log.Infof("Kubeshark is available at %s", url) if !config.Config.HeadlessMode { uiUtils.OpenBrowser(url) } diff --git a/cli/cmd/version.go b/cli/cmd/version.go index 99295ad1d..86187b07f 100644 --- a/cli/cmd/version.go +++ b/cli/cmd/version.go @@ -4,13 +4,13 @@ import ( "strconv" "time" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/logger" "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/kubeshark" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/mizu" ) var versionCmd = &cobra.Command{ @@ -18,12 +18,12 @@ var versionCmd = &cobra.Command{ Short: "Print version info", RunE: func(cmd *cobra.Command, args []string) error { if config.Config.Version.DebugInfo { - timeStampInt, _ := strconv.ParseInt(mizu.BuildTimestamp, 10, 0) - logger.Log.Infof("Version: %s \nBranch: %s (%s)", mizu.Ver, mizu.Branch, mizu.GitCommitHash) - logger.Log.Infof("Build Time: %s (%s)", mizu.BuildTimestamp, time.Unix(timeStampInt, 0)) + timeStampInt, _ := strconv.ParseInt(kubeshark.BuildTimestamp, 10, 0) + logger.Log.Infof("Version: %s \nBranch: %s (%s)", kubeshark.Ver, kubeshark.Branch, kubeshark.GitCommitHash) + logger.Log.Infof("Build Time: %s (%s)", kubeshark.BuildTimestamp, time.Unix(timeStampInt, 0)) } else { - logger.Log.Infof("Version: %s (%s)", mizu.Ver, mizu.Branch) + logger.Log.Infof("Version: %s (%s)", kubeshark.Ver, kubeshark.Branch) } return nil }, diff --git a/cli/cmd/view.go b/cli/cmd/view.go index 472ae6f2c..328fae329 100644 --- a/cli/cmd/view.go +++ b/cli/cmd/view.go @@ -2,16 +2,16 @@ package cmd import ( "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/logger" "github.com/spf13/cobra" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/logger" ) var viewCmd = &cobra.Command{ Use: "view", Short: "Open GUI in browser", RunE: func(cmd *cobra.Command, args []string) error { - runMizuView() + runKubesharkView() return nil }, } diff --git a/cli/cmd/viewRunner.go b/cli/cmd/viewRunner.go index dab9309cc..ce032645e 100644 --- a/cli/cmd/viewRunner.go +++ b/cli/cmd/viewRunner.go @@ -5,17 +5,17 @@ import ( "fmt" "net/http" - "github.com/up9inc/mizu/cli/utils" + "github.com/kubeshark/kubeshark/cli/utils" - "github.com/up9inc/mizu/cli/apiserver" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/mizu/fsUtils" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/apiserver" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/kubeshark/fsUtils" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" ) -func runMizuView() { +func runKubesharkView() { kubernetesProvider, err := getKubernetesProviderForCli() if err != nil { return @@ -27,14 +27,14 @@ func runMizuView() { url := config.Config.View.Url if url == "" { - exists, err := kubernetesProvider.DoesServiceExist(ctx, config.Config.MizuResourcesNamespace, kubernetes.ApiServerPodName) + exists, err := kubernetesProvider.DoesServiceExist(ctx, config.Config.KubesharkResourcesNamespace, kubernetes.ApiServerPodName) if err != nil { - logger.Log.Errorf("Failed to found mizu service %v", err) + logger.Log.Errorf("Failed to found kubeshark service %v", err) cancel() return } if !exists { - logger.Log.Infof("%s service not found, you should run `mizu tap` command first", kubernetes.ApiServerPodName) + logger.Log.Infof("%s service not found, you should run `kubeshark tap` command first", kubernetes.ApiServerPodName) cancel() return } @@ -56,7 +56,7 @@ func runMizuView() { return } - logger.Log.Infof("Mizu is available at %s", url) + logger.Log.Infof("Kubeshark is available at %s", url) if !config.Config.HeadlessMode { uiUtils.OpenBrowser(url) diff --git a/cli/config/config.go b/cli/config/config.go index dc7c65165..718db5d59 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -9,13 +9,13 @@ import ( "strconv" "strings" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" "github.com/creasty/defaults" + "github.com/kubeshark/kubeshark/cli/uiUtils" "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/up9inc/mizu/cli/uiUtils" "gopkg.in/yaml.v3" ) @@ -43,7 +43,7 @@ func InitConfig(cmd *cobra.Command) error { if err := loadConfigFile(configFilePath, &Config); err != nil { if configFilePathFlag.Changed || !os.IsNotExist(err) { return fmt.Errorf("invalid config, %w\n"+ - "you can regenerate the file by removing it (%v) and using `mizu config -r`", err, configFilePath) + "you can regenerate the file by removing it (%v) and using `kubeshark config -r`", err, configFilePath) } } diff --git a/cli/config/configStruct.go b/cli/config/configStruct.go index b5d10001b..70129a341 100644 --- a/cli/config/configStruct.go +++ b/cli/config/configStruct.go @@ -6,39 +6,39 @@ import ( "path" "path/filepath" + "github.com/kubeshark/kubeshark/cli/config/configStructs" + "github.com/kubeshark/kubeshark/cli/kubeshark" + "github.com/kubeshark/kubeshark/shared" "github.com/op/go-logging" - "github.com/up9inc/mizu/cli/config/configStructs" - "github.com/up9inc/mizu/cli/mizu" - "github.com/up9inc/mizu/shared" v1 "k8s.io/api/core/v1" "k8s.io/client-go/util/homedir" ) const ( - MizuResourcesNamespaceConfigName = "mizu-resources-namespace" - ConfigFilePathCommandName = "config-path" - KubeConfigPathConfigName = "kube-config-path" + KubesharkResourcesNamespaceConfigName = "kubeshark-resources-namespace" + ConfigFilePathCommandName = "config-path" + KubeConfigPathConfigName = "kube-config-path" ) type ConfigStruct struct { - Tap configStructs.TapConfig `yaml:"tap"` - Check configStructs.CheckConfig `yaml:"check"` - Install configStructs.InstallConfig `yaml:"install"` - Version configStructs.VersionConfig `yaml:"version"` - View configStructs.ViewConfig `yaml:"view"` - Logs configStructs.LogsConfig `yaml:"logs"` - Config configStructs.ConfigConfig `yaml:"config,omitempty"` - AgentImage string `yaml:"agent-image,omitempty" readonly:""` - ImagePullPolicyStr string `yaml:"image-pull-policy" default:"Always"` - MizuResourcesNamespace string `yaml:"mizu-resources-namespace" default:"mizu"` - DumpLogs bool `yaml:"dump-logs" default:"false"` - KubeConfigPathStr string `yaml:"kube-config-path"` - KubeContext string `yaml:"kube-context"` - ConfigFilePath string `yaml:"config-path,omitempty" readonly:""` - HeadlessMode bool `yaml:"headless" default:"false"` - LogLevelStr string `yaml:"log-level,omitempty" default:"INFO" readonly:""` - ServiceMap bool `yaml:"service-map" default:"true"` - OAS shared.OASConfig `yaml:"oas"` + Tap configStructs.TapConfig `yaml:"tap"` + Check configStructs.CheckConfig `yaml:"check"` + Install configStructs.InstallConfig `yaml:"install"` + Version configStructs.VersionConfig `yaml:"version"` + View configStructs.ViewConfig `yaml:"view"` + Logs configStructs.LogsConfig `yaml:"logs"` + Config configStructs.ConfigConfig `yaml:"config,omitempty"` + AgentImage string `yaml:"agent-image,omitempty" readonly:""` + ImagePullPolicyStr string `yaml:"image-pull-policy" default:"Always"` + KubesharkResourcesNamespace string `yaml:"kubeshark-resources-namespace" default:"kubeshark"` + DumpLogs bool `yaml:"dump-logs" default:"false"` + KubeConfigPathStr string `yaml:"kube-config-path"` + KubeContext string `yaml:"kube-context"` + ConfigFilePath string `yaml:"config-path,omitempty" readonly:""` + HeadlessMode bool `yaml:"headless" default:"false"` + LogLevelStr string `yaml:"log-level,omitempty" default:"INFO" readonly:""` + ServiceMap bool `yaml:"service-map" default:"true"` + OAS shared.OASConfig `yaml:"oas"` } func (config *ConfigStruct) validate() error { @@ -50,8 +50,8 @@ func (config *ConfigStruct) validate() error { } func (config *ConfigStruct) SetDefaults() { - config.AgentImage = fmt.Sprintf("%s:%s", shared.MizuAgentImageRepo, mizu.Ver) - config.ConfigFilePath = path.Join(mizu.GetMizuFolderPath(), "config.yaml") + config.AgentImage = fmt.Sprintf("%s:%s", shared.KubesharkAgentImageRepo, kubeshark.Ver) + config.ConfigFilePath = path.Join(kubeshark.GetKubesharkFolderPath(), "config.yaml") } func (config *ConfigStruct) ImagePullPolicy() v1.PullPolicy { @@ -59,7 +59,7 @@ func (config *ConfigStruct) ImagePullPolicy() v1.PullPolicy { } func (config *ConfigStruct) IsNsRestrictedMode() bool { - return config.MizuResourcesNamespace != "mizu" // Notice "mizu" string must match the default MizuResourcesNamespace + return config.KubesharkResourcesNamespace != "kubeshark" // Notice "kubeshark" string must match the default KubesharkResourcesNamespace } func (config *ConfigStruct) KubeConfigPath() string { diff --git a/cli/config/configStructs/installConfig.go b/cli/config/configStructs/installConfig.go index bfc876a5f..fce605150 100644 --- a/cli/config/configStructs/installConfig.go +++ b/cli/config/configStructs/installConfig.go @@ -5,7 +5,7 @@ const ( ) type InstallConfig struct { - TemplateUrl string `yaml:"template-url" default:"https://storage.googleapis.com/static.up9.io/mizu/helm-template"` + TemplateUrl string `yaml:"template-url" default:"https://storage.googleapis.com/static.up9.io/kubeshark/helm-template"` TemplateName string `yaml:"template-name" default:"helm-template.yaml"` Out bool `yaml:"out"` } diff --git a/cli/config/configStructs/logsConfig.go b/cli/config/configStructs/logsConfig.go index 14c4c12b4..8f100adf4 100644 --- a/cli/config/configStructs/logsConfig.go +++ b/cli/config/configStructs/logsConfig.go @@ -18,7 +18,7 @@ func (config *LogsConfig) Validate() error { if config.FileStr == "" { _, err := os.Getwd() if err != nil { - return fmt.Errorf("failed to get PWD, %v (try using `mizu logs -f )`", err) + return fmt.Errorf("failed to get PWD, %v (try using `kubeshark logs -f )`", err) } } @@ -28,7 +28,7 @@ func (config *LogsConfig) Validate() error { func (config *LogsConfig) FilePath() string { if config.FileStr == "" { pwd, _ := os.Getwd() - return path.Join(pwd, "mizu_logs.zip") + return path.Join(pwd, "kubeshark_logs.zip") } return config.FileStr diff --git a/cli/config/configStructs/tapConfig.go b/cli/config/configStructs/tapConfig.go index edf10c510..70cb75fa1 100644 --- a/cli/config/configStructs/tapConfig.go +++ b/cli/config/configStructs/tapConfig.go @@ -8,11 +8,11 @@ import ( "regexp" "strings" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/shared" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/units" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/units" ) const ( diff --git a/cli/config/config_test.go b/cli/config/config_test.go index 35d63b519..31b28c52b 100644 --- a/cli/config/config_test.go +++ b/cli/config/config_test.go @@ -2,7 +2,7 @@ package config_test import ( "fmt" - "github.com/up9inc/mizu/cli/config" + "github.com/kubeshark/kubeshark/cli/config" "gopkg.in/yaml.v3" "reflect" "strings" diff --git a/cli/errormessage/errormessage.go b/cli/errormessage/errormessage.go index 7f9caac0d..d03aa7c92 100644 --- a/cli/errormessage/errormessage.go +++ b/cli/errormessage/errormessage.go @@ -3,9 +3,10 @@ package errormessage import ( "errors" "fmt" - "github.com/up9inc/mizu/cli/config" regexpsyntax "regexp/syntax" + "github.com/kubeshark/kubeshark/cli/config" + k8serrors "k8s.io/apimachinery/pkg/api/errors" ) @@ -15,12 +16,12 @@ func FormatError(err error) error { var errorNew error if k8serrors.IsForbidden(err) { errorNew = fmt.Errorf("insufficient permissions: %w. "+ - "supply the required permission or control Mizu's access to namespaces by setting %s "+ + "supply the required permission or control Kubeshark's access to namespaces by setting %s "+ "in the config file or setting the tapped namespace with --%s %s=", err, - config.MizuResourcesNamespaceConfigName, + config.KubesharkResourcesNamespaceConfigName, config.SetCommandName, - config.MizuResourcesNamespaceConfigName) + config.KubesharkResourcesNamespaceConfigName) } else if syntaxError, isSyntaxError := asRegexSyntaxError(err); isSyntaxError { errorNew = fmt.Errorf("regex %s is invalid: %w", syntaxError.Expr, err) } else { diff --git a/cli/go.mod b/cli/go.mod index e209005fe..4fdb23c46 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,4 +1,4 @@ -module github.com/up9inc/mizu/cli +module github.com/kubeshark/kubeshark/cli go 1.17 @@ -8,9 +8,9 @@ require ( github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/spf13/cobra v1.3.0 github.com/spf13/pflag v1.0.5 - github.com/up9inc/mizu/logger v0.0.0 - github.com/up9inc/mizu/shared v0.0.0 - github.com/up9inc/mizu/tap/api v0.0.0 + github.com/kubeshark/kubeshark/logger v0.0.0 + github.com/kubeshark/kubeshark/shared v0.0.0 + github.com/kubeshark/kubeshark/tap/api v0.0.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b k8s.io/api v0.23.3 k8s.io/apimachinery v0.23.3 @@ -69,7 +69,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday v1.6.0 // indirect github.com/stretchr/testify v1.7.0 // indirect - github.com/up9inc/mizu/tap/dbgctl v0.0.0 // indirect + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 // indirect github.com/xlab/treeprint v1.1.0 // indirect go.starlark.net v0.0.0-20220203230714-bb14e151c28f // indirect golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab // indirect @@ -96,10 +96,10 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/up9inc/mizu/logger v0.0.0 => ../logger +replace github.com/kubeshark/kubeshark/logger v0.0.0 => ../logger -replace github.com/up9inc/mizu/shared v0.0.0 => ../shared +replace github.com/kubeshark/kubeshark/shared v0.0.0 => ../shared -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../tap/api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../tap/api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../tap/dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../tap/dbgctl diff --git a/cli/kubeshark.go b/cli/kubeshark.go new file mode 100644 index 000000000..eb5de7817 --- /dev/null +++ b/cli/kubeshark.go @@ -0,0 +1,10 @@ +package main + +import ( + "github.com/kubeshark/kubeshark/cli/cmd" + "github.com/kubeshark/kubeshark/cli/cmd/goUtils" +) + +func main() { + goUtils.HandleExcWrapper(cmd.Execute) +} diff --git a/cli/kubeshark/consts.go b/cli/kubeshark/consts.go new file mode 100644 index 000000000..d431dcdb9 --- /dev/null +++ b/cli/kubeshark/consts.go @@ -0,0 +1,23 @@ +package kubeshark + +import ( + "os" + "path" +) + +var ( + Ver = "0.0" + Branch = "develop" + GitCommitHash = "" // this var is overridden using ldflags in makefile when building + BuildTimestamp = "" // this var is overridden using ldflags in makefile when building + RBACVersion = "v1" + Platform = "" +) + +func GetKubesharkFolderPath() string { + home, homeDirErr := os.UserHomeDir() + if homeDirErr != nil { + return "" + } + return path.Join(home, ".kubeshark") +} diff --git a/cli/mizu/fsUtils/dirUtils.go b/cli/kubeshark/fsUtils/dirUtils.go similarity index 100% rename from cli/mizu/fsUtils/dirUtils.go rename to cli/kubeshark/fsUtils/dirUtils.go diff --git a/cli/mizu/fsUtils/mizuLogsUtils.go b/cli/kubeshark/fsUtils/kubesharkLogsUtils.go similarity index 73% rename from cli/mizu/fsUtils/mizuLogsUtils.go rename to cli/kubeshark/fsUtils/kubesharkLogsUtils.go index f9da22ddf..e62a2bb64 100644 --- a/cli/mizu/fsUtils/mizuLogsUtils.go +++ b/cli/kubeshark/fsUtils/kubesharkLogsUtils.go @@ -8,25 +8,25 @@ import ( "path" "regexp" - "github.com/up9inc/mizu/cli/config" - "github.com/up9inc/mizu/cli/mizu" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/config" + "github.com/kubeshark/kubeshark/cli/kubeshark" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" ) func GetLogFilePath() string { - return path.Join(mizu.GetMizuFolderPath(), "mizu_cli.log") + return path.Join(kubeshark.GetKubesharkFolderPath(), "kubeshark_cli.log") } func DumpLogs(ctx context.Context, provider *kubernetes.Provider, filePath string) error { - podExactRegex := regexp.MustCompile("^" + kubernetes.MizuResourcesPrefix) - pods, err := provider.ListAllPodsMatchingRegex(ctx, podExactRegex, []string{config.Config.MizuResourcesNamespace}) + podExactRegex := regexp.MustCompile("^" + kubernetes.KubesharkResourcesPrefix) + pods, err := provider.ListAllPodsMatchingRegex(ctx, podExactRegex, []string{config.Config.KubesharkResourcesNamespace}) if err != nil { return err } if len(pods) == 0 { - return fmt.Errorf("no mizu pods found in namespace %s", config.Config.MizuResourcesNamespace) + return fmt.Errorf("no kubeshark pods found in namespace %s", config.Config.KubesharkResourcesNamespace) } newZipFile, err := os.Create(filePath) @@ -55,17 +55,17 @@ func DumpLogs(ctx context.Context, provider *kubernetes.Provider, filePath strin } } - events, err := provider.GetNamespaceEvents(ctx, config.Config.MizuResourcesNamespace) + events, err := provider.GetNamespaceEvents(ctx, config.Config.KubesharkResourcesNamespace) if err != nil { logger.Log.Debugf("Failed to get k8b events, %v", err) } else { - logger.Log.Debugf("Successfully read events for k8b namespace: %s", config.Config.MizuResourcesNamespace) + logger.Log.Debugf("Successfully read events for k8b namespace: %s", config.Config.KubesharkResourcesNamespace) } - if err := AddStrToZip(zipWriter, events, fmt.Sprintf("%s_events.log", config.Config.MizuResourcesNamespace)); err != nil { + if err := AddStrToZip(zipWriter, events, fmt.Sprintf("%s_events.log", config.Config.KubesharkResourcesNamespace)); err != nil { logger.Log.Debugf("Failed write logs, %v", err) } else { - logger.Log.Debugf("Successfully added events for k8b namespace: %s", config.Config.MizuResourcesNamespace) + logger.Log.Debugf("Successfully added events for k8b namespace: %s", config.Config.KubesharkResourcesNamespace) } if err := AddFileToZip(zipWriter, config.Config.ConfigFilePath); err != nil { diff --git a/cli/mizu/fsUtils/zipUtils.go b/cli/kubeshark/fsUtils/zipUtils.go similarity index 98% rename from cli/mizu/fsUtils/zipUtils.go rename to cli/kubeshark/fsUtils/zipUtils.go index a91a2f529..42b727a2a 100644 --- a/cli/mizu/fsUtils/zipUtils.go +++ b/cli/kubeshark/fsUtils/zipUtils.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func AddFileToZip(zipWriter *zip.Writer, filename string) error { diff --git a/cli/mizu/version/versionCheck.go b/cli/kubeshark/version/versionCheck.go similarity index 67% rename from cli/mizu/version/versionCheck.go rename to cli/kubeshark/version/versionCheck.go index 8908e0d24..af43d1307 100644 --- a/cli/mizu/version/versionCheck.go +++ b/cli/kubeshark/version/versionCheck.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/up9inc/mizu/cli/mizu" - "github.com/up9inc/mizu/cli/pkg/version" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/cli/kubeshark" + "github.com/kubeshark/kubeshark/cli/pkg/version" + "github.com/kubeshark/kubeshark/logger" "github.com/google/go-github/v37/github" ) @@ -20,7 +20,7 @@ func CheckNewerVersion(versionChan chan string) { logger.Log.Debugf("Checking for newer version...") start := time.Now() client := github.NewClient(nil) - latestRelease, _, err := client.Repositories.GetLatestRelease(context.Background(), "up9inc", "mizu") + latestRelease, _, err := client.Repositories.GetLatestRelease(context.Background(), "kubeshark", "kubeshark") if err != nil { logger.Log.Debugf("[ERROR] Failed to get latest release") versionChan <- "" @@ -57,23 +57,23 @@ func CheckNewerVersion(versionChan chan string) { gitHubVersion := string(data) gitHubVersion = gitHubVersion[:len(gitHubVersion)-1] - greater, err := version.GreaterThen(gitHubVersion, mizu.Ver) + greater, err := version.GreaterThen(gitHubVersion, kubeshark.Ver) if err != nil { - logger.Log.Debugf("[ERROR] Ver version is not valid, github version %v, current version %v", gitHubVersion, mizu.Ver) + logger.Log.Debugf("[ERROR] Ver version is not valid, github version %v, current version %v", gitHubVersion, kubeshark.Ver) versionChan <- "" return } - logger.Log.Debugf("Finished version validation, github version %v, current version %v, took %v", gitHubVersion, mizu.Ver, time.Since(start)) + logger.Log.Debugf("Finished version validation, github version %v, current version %v, took %v", gitHubVersion, kubeshark.Ver, time.Since(start)) if greater { var downloadMessage string if runtime.GOOS == "windows" { - downloadMessage = fmt.Sprintf("curl -LO %v/mizu.exe", strings.Replace(*latestRelease.HTMLURL, "tag", "download", 1)) + downloadMessage = fmt.Sprintf("curl -LO %v/kubeshark.exe", strings.Replace(*latestRelease.HTMLURL, "tag", "download", 1)) } else { - downloadMessage = fmt.Sprintf("curl -Lo mizu %v/mizu_%s_%s && chmod 755 mizu", strings.Replace(*latestRelease.HTMLURL, "tag", "download", 1), runtime.GOOS, runtime.GOARCH) + downloadMessage = fmt.Sprintf("curl -Lo kubeshark %v/kubeshark_%s_%s && chmod 755 kubeshark", strings.Replace(*latestRelease.HTMLURL, "tag", "download", 1), runtime.GOOS, runtime.GOARCH) } - versionChan <- fmt.Sprintf("Update available! %v -> %v (%s)", mizu.Ver, gitHubVersion, downloadMessage) + versionChan <- fmt.Sprintf("Update available! %v -> %v (%s)", kubeshark.Ver, gitHubVersion, downloadMessage) } else { versionChan <- "" } diff --git a/cli/mizu.go b/cli/mizu.go deleted file mode 100644 index a4a51a400..000000000 --- a/cli/mizu.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "github.com/up9inc/mizu/cli/cmd" - "github.com/up9inc/mizu/cli/cmd/goUtils" -) - -func main() { - goUtils.HandleExcWrapper(cmd.Execute) -} diff --git a/cli/mizu/consts.go b/cli/mizu/consts.go deleted file mode 100644 index b1c576f0d..000000000 --- a/cli/mizu/consts.go +++ /dev/null @@ -1,23 +0,0 @@ -package mizu - -import ( - "os" - "path" -) - -var ( - Ver = "0.0" - Branch = "develop" - GitCommitHash = "" // this var is overridden using ldflags in makefile when building - BuildTimestamp = "" // this var is overridden using ldflags in makefile when building - RBACVersion = "v1" - Platform = "" -) - -func GetMizuFolderPath() string { - home, homeDirErr := os.UserHomeDir() - if homeDirErr != nil { - return "" - } - return path.Join(home, ".mizu") -} diff --git a/cli/resources/cleanResources.go b/cli/resources/cleanResources.go index d83325960..6e298699b 100644 --- a/cli/resources/cleanResources.go +++ b/cli/resources/cleanResources.go @@ -4,24 +4,24 @@ import ( "context" "fmt" - "github.com/up9inc/mizu/cli/errormessage" - "github.com/up9inc/mizu/cli/mizu/fsUtils" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/cli/utils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/kubernetes" + "github.com/kubeshark/kubeshark/cli/errormessage" + "github.com/kubeshark/kubeshark/cli/kubeshark/fsUtils" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/cli/utils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/kubernetes" "k8s.io/apimachinery/pkg/util/wait" ) -func CleanUpMizuResources(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, mizuResourcesNamespace string) { - logger.Log.Infof("\nRemoving mizu resources") +func CleanUpKubesharkResources(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, kubesharkResourcesNamespace string) { + logger.Log.Infof("\nRemoving kubeshark resources") var leftoverResources []string if isNsRestrictedMode { - leftoverResources = cleanUpRestrictedMode(ctx, kubernetesProvider, mizuResourcesNamespace) + leftoverResources = cleanUpRestrictedMode(ctx, kubernetesProvider, kubesharkResourcesNamespace) } else { - leftoverResources = cleanUpNonRestrictedMode(ctx, cancel, kubernetesProvider, mizuResourcesNamespace) + leftoverResources = cleanUpNonRestrictedMode(ctx, cancel, kubernetesProvider, kubesharkResourcesNamespace) } if len(leftoverResources) > 0 { @@ -33,14 +33,14 @@ func CleanUpMizuResources(ctx context.Context, cancel context.CancelFunc, kubern } } -func cleanUpNonRestrictedMode(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, mizuResourcesNamespace string) []string { +func cleanUpNonRestrictedMode(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, kubesharkResourcesNamespace string) []string { leftoverResources := make([]string, 0) - if err := kubernetesProvider.RemoveNamespace(ctx, mizuResourcesNamespace); err != nil { - resourceDesc := fmt.Sprintf("Namespace %s", mizuResourcesNamespace) + if err := kubernetesProvider.RemoveNamespace(ctx, kubesharkResourcesNamespace); err != nil { + resourceDesc := fmt.Sprintf("Namespace %s", kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } else { - defer waitUntilNamespaceDeleted(ctx, cancel, kubernetesProvider, mizuResourcesNamespace) + defer waitUntilNamespaceDeleted(ctx, cancel, kubernetesProvider, kubesharkResourcesNamespace) } if resources, err := kubernetesProvider.ListManagedClusterRoles(ctx); err != nil { @@ -70,80 +70,80 @@ func cleanUpNonRestrictedMode(ctx context.Context, cancel context.CancelFunc, ku return leftoverResources } -func waitUntilNamespaceDeleted(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, mizuResourcesNamespace string) { +func waitUntilNamespaceDeleted(ctx context.Context, cancel context.CancelFunc, kubernetesProvider *kubernetes.Provider, kubesharkResourcesNamespace string) { // Call cancel if a terminating signal was received. Allows user to skip the wait. go func() { utils.WaitForFinish(ctx, cancel) }() - if err := kubernetesProvider.WaitUtilNamespaceDeleted(ctx, mizuResourcesNamespace); err != nil { + if err := kubernetesProvider.WaitUtilNamespaceDeleted(ctx, kubesharkResourcesNamespace); err != nil { switch { case ctx.Err() == context.Canceled: logger.Log.Debugf("Do nothing. User interrupted the wait") case err == wait.ErrWaitTimeout: - logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Timeout while removing Namespace %s", mizuResourcesNamespace)) + logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Timeout while removing Namespace %s", kubesharkResourcesNamespace)) default: - logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error while waiting for Namespace %s to be deleted: %v", mizuResourcesNamespace, errormessage.FormatError(err))) + logger.Log.Errorf(uiUtils.Error, fmt.Sprintf("Error while waiting for Namespace %s to be deleted: %v", kubesharkResourcesNamespace, errormessage.FormatError(err))) } } } -func cleanUpRestrictedMode(ctx context.Context, kubernetesProvider *kubernetes.Provider, mizuResourcesNamespace string) []string { +func cleanUpRestrictedMode(ctx context.Context, kubernetesProvider *kubernetes.Provider, kubesharkResourcesNamespace string) []string { leftoverResources := make([]string, 0) - if err := kubernetesProvider.RemoveService(ctx, mizuResourcesNamespace, kubernetes.ApiServerPodName); err != nil { - resourceDesc := fmt.Sprintf("Service %s in namespace %s", kubernetes.ApiServerPodName, mizuResourcesNamespace) + if err := kubernetesProvider.RemoveService(ctx, kubesharkResourcesNamespace, kubernetes.ApiServerPodName); err != nil { + resourceDesc := fmt.Sprintf("Service %s in namespace %s", kubernetes.ApiServerPodName, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } - if err := kubernetesProvider.RemoveDaemonSet(ctx, mizuResourcesNamespace, kubernetes.TapperDaemonSetName); err != nil { - resourceDesc := fmt.Sprintf("DaemonSet %s in namespace %s", kubernetes.TapperDaemonSetName, mizuResourcesNamespace) + if err := kubernetesProvider.RemoveDaemonSet(ctx, kubesharkResourcesNamespace, kubernetes.TapperDaemonSetName); err != nil { + resourceDesc := fmt.Sprintf("DaemonSet %s in namespace %s", kubernetes.TapperDaemonSetName, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } - if err := kubernetesProvider.RemoveConfigMap(ctx, mizuResourcesNamespace, kubernetes.ConfigMapName); err != nil { - resourceDesc := fmt.Sprintf("ConfigMap %s in namespace %s", kubernetes.ConfigMapName, mizuResourcesNamespace) + if err := kubernetesProvider.RemoveConfigMap(ctx, kubesharkResourcesNamespace, kubernetes.ConfigMapName); err != nil { + resourceDesc := fmt.Sprintf("ConfigMap %s in namespace %s", kubernetes.ConfigMapName, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } - if resources, err := kubernetesProvider.ListManagedServiceAccounts(ctx, mizuResourcesNamespace); err != nil { - resourceDesc := fmt.Sprintf("ServiceAccounts in namespace %s", mizuResourcesNamespace) + if resources, err := kubernetesProvider.ListManagedServiceAccounts(ctx, kubesharkResourcesNamespace); err != nil { + resourceDesc := fmt.Sprintf("ServiceAccounts in namespace %s", kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } else { for _, resource := range resources.Items { - if err := kubernetesProvider.RemoveServiceAccount(ctx, mizuResourcesNamespace, resource.Name); err != nil { - resourceDesc := fmt.Sprintf("ServiceAccount %s in namespace %s", resource.Name, mizuResourcesNamespace) + if err := kubernetesProvider.RemoveServiceAccount(ctx, kubesharkResourcesNamespace, resource.Name); err != nil { + resourceDesc := fmt.Sprintf("ServiceAccount %s in namespace %s", resource.Name, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } } } - if resources, err := kubernetesProvider.ListManagedRoles(ctx, mizuResourcesNamespace); err != nil { - resourceDesc := fmt.Sprintf("Roles in namespace %s", mizuResourcesNamespace) + if resources, err := kubernetesProvider.ListManagedRoles(ctx, kubesharkResourcesNamespace); err != nil { + resourceDesc := fmt.Sprintf("Roles in namespace %s", kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } else { for _, resource := range resources.Items { - if err := kubernetesProvider.RemoveRole(ctx, mizuResourcesNamespace, resource.Name); err != nil { - resourceDesc := fmt.Sprintf("Role %s in namespace %s", resource.Name, mizuResourcesNamespace) + if err := kubernetesProvider.RemoveRole(ctx, kubesharkResourcesNamespace, resource.Name); err != nil { + resourceDesc := fmt.Sprintf("Role %s in namespace %s", resource.Name, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } } } - if resources, err := kubernetesProvider.ListManagedRoleBindings(ctx, mizuResourcesNamespace); err != nil { - resourceDesc := fmt.Sprintf("RoleBindings in namespace %s", mizuResourcesNamespace) + if resources, err := kubernetesProvider.ListManagedRoleBindings(ctx, kubesharkResourcesNamespace); err != nil { + resourceDesc := fmt.Sprintf("RoleBindings in namespace %s", kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } else { for _, resource := range resources.Items { - if err := kubernetesProvider.RemoveRoleBinding(ctx, mizuResourcesNamespace, resource.Name); err != nil { - resourceDesc := fmt.Sprintf("RoleBinding %s in namespace %s", resource.Name, mizuResourcesNamespace) + if err := kubernetesProvider.RemoveRoleBinding(ctx, kubesharkResourcesNamespace, resource.Name); err != nil { + resourceDesc := fmt.Sprintf("RoleBinding %s in namespace %s", resource.Name, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } } } - if err := kubernetesProvider.RemovePod(ctx, mizuResourcesNamespace, kubernetes.ApiServerPodName); err != nil { - resourceDesc := fmt.Sprintf("Pod %s in namespace %s", kubernetes.ApiServerPodName, mizuResourcesNamespace) + if err := kubernetesProvider.RemovePod(ctx, kubesharkResourcesNamespace, kubernetes.ApiServerPodName); err != nil { + resourceDesc := fmt.Sprintf("Pod %s in namespace %s", kubernetes.ApiServerPodName, kubesharkResourcesNamespace) handleDeletionError(err, resourceDesc, &leftoverResources) } diff --git a/cli/resources/createResources.go b/cli/resources/createResources.go index d71fcd85c..4d65f18d3 100644 --- a/cli/resources/createResources.go +++ b/cli/resources/createResources.go @@ -4,41 +4,41 @@ import ( "context" "fmt" + "github.com/kubeshark/kubeshark/cli/errormessage" + "github.com/kubeshark/kubeshark/cli/kubeshark" + "github.com/kubeshark/kubeshark/cli/uiUtils" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/shared/kubernetes" "github.com/op/go-logging" - "github.com/up9inc/mizu/cli/errormessage" - "github.com/up9inc/mizu/cli/mizu" - "github.com/up9inc/mizu/cli/uiUtils" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/shared/kubernetes" core "k8s.io/api/core/v1" ) -func CreateTapMizuResources(ctx context.Context, kubernetesProvider *kubernetes.Provider, serializedMizuConfig string, isNsRestrictedMode bool, mizuResourcesNamespace string, agentImage string, maxEntriesDBSizeBytes int64, apiServerResources shared.Resources, imagePullPolicy core.PullPolicy, logLevel logging.Level, profiler bool) (bool, error) { +func CreateTapKubesharkResources(ctx context.Context, kubernetesProvider *kubernetes.Provider, serializedKubesharkConfig string, isNsRestrictedMode bool, kubesharkResourcesNamespace string, agentImage string, maxEntriesDBSizeBytes int64, apiServerResources shared.Resources, imagePullPolicy core.PullPolicy, logLevel logging.Level, profiler bool) (bool, error) { if !isNsRestrictedMode { - if err := createMizuNamespace(ctx, kubernetesProvider, mizuResourcesNamespace); err != nil { + if err := createKubesharkNamespace(ctx, kubernetesProvider, kubesharkResourcesNamespace); err != nil { return false, err } } - if err := createMizuConfigmap(ctx, kubernetesProvider, serializedMizuConfig, mizuResourcesNamespace); err != nil { + if err := createKubesharkConfigmap(ctx, kubernetesProvider, serializedKubesharkConfig, kubesharkResourcesNamespace); err != nil { return false, err } - mizuServiceAccountExists, err := createRBACIfNecessary(ctx, kubernetesProvider, isNsRestrictedMode, mizuResourcesNamespace, []string{"pods", "services", "endpoints"}) + kubesharkServiceAccountExists, err := createRBACIfNecessary(ctx, kubernetesProvider, isNsRestrictedMode, kubesharkResourcesNamespace, []string{"pods", "services", "endpoints"}) if err != nil { - logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Failed to ensure the resources required for IP resolving. Mizu will not resolve target IPs to names. error: %v", errormessage.FormatError(err))) + logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Failed to ensure the resources required for IP resolving. Kubeshark will not resolve target IPs to names. error: %v", errormessage.FormatError(err))) } var serviceAccountName string - if mizuServiceAccountExists { + if kubesharkServiceAccountExists { serviceAccountName = kubernetes.ServiceAccountName } else { serviceAccountName = "" } opts := &kubernetes.ApiServerOptions{ - Namespace: mizuResourcesNamespace, + Namespace: kubesharkResourcesNamespace, PodName: kubernetes.ApiServerPodName, PodImage: agentImage, KratosImage: "", @@ -52,37 +52,37 @@ func CreateTapMizuResources(ctx context.Context, kubernetesProvider *kubernetes. Profiler: profiler, } - if err := createMizuApiServerPod(ctx, kubernetesProvider, opts); err != nil { - return mizuServiceAccountExists, err + if err := createKubesharkApiServerPod(ctx, kubernetesProvider, opts); err != nil { + return kubesharkServiceAccountExists, err } - _, err = kubernetesProvider.CreateService(ctx, mizuResourcesNamespace, kubernetes.ApiServerPodName, kubernetes.ApiServerPodName) + _, err = kubernetesProvider.CreateService(ctx, kubesharkResourcesNamespace, kubernetes.ApiServerPodName, kubernetes.ApiServerPodName) if err != nil { - return mizuServiceAccountExists, err + return kubesharkServiceAccountExists, err } logger.Log.Debugf("Successfully created service: %s", kubernetes.ApiServerPodName) - return mizuServiceAccountExists, nil + return kubesharkServiceAccountExists, nil } -func createMizuNamespace(ctx context.Context, kubernetesProvider *kubernetes.Provider, mizuResourcesNamespace string) error { - _, err := kubernetesProvider.CreateNamespace(ctx, mizuResourcesNamespace) +func createKubesharkNamespace(ctx context.Context, kubernetesProvider *kubernetes.Provider, kubesharkResourcesNamespace string) error { + _, err := kubernetesProvider.CreateNamespace(ctx, kubesharkResourcesNamespace) return err } -func createMizuConfigmap(ctx context.Context, kubernetesProvider *kubernetes.Provider, serializedMizuConfig string, mizuResourcesNamespace string) error { - err := kubernetesProvider.CreateConfigMap(ctx, mizuResourcesNamespace, kubernetes.ConfigMapName, serializedMizuConfig) +func createKubesharkConfigmap(ctx context.Context, kubernetesProvider *kubernetes.Provider, serializedKubesharkConfig string, kubesharkResourcesNamespace string) error { + err := kubernetesProvider.CreateConfigMap(ctx, kubesharkResourcesNamespace, kubernetes.ConfigMapName, serializedKubesharkConfig) return err } -func createRBACIfNecessary(ctx context.Context, kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, mizuResourcesNamespace string, resources []string) (bool, error) { +func createRBACIfNecessary(ctx context.Context, kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, kubesharkResourcesNamespace string, resources []string) (bool, error) { if !isNsRestrictedMode { - if err := kubernetesProvider.CreateMizuRBAC(ctx, mizuResourcesNamespace, kubernetes.ServiceAccountName, kubernetes.ClusterRoleName, kubernetes.ClusterRoleBindingName, mizu.RBACVersion, resources); err != nil { + if err := kubernetesProvider.CreateKubesharkRBAC(ctx, kubesharkResourcesNamespace, kubernetes.ServiceAccountName, kubernetes.ClusterRoleName, kubernetes.ClusterRoleBindingName, kubeshark.RBACVersion, resources); err != nil { return false, err } } else { - if err := kubernetesProvider.CreateMizuRBACNamespaceRestricted(ctx, mizuResourcesNamespace, kubernetes.ServiceAccountName, kubernetes.RoleName, kubernetes.RoleBindingName, mizu.RBACVersion); err != nil { + if err := kubernetesProvider.CreateKubesharkRBACNamespaceRestricted(ctx, kubesharkResourcesNamespace, kubernetes.ServiceAccountName, kubernetes.RoleName, kubernetes.RoleBindingName, kubeshark.RBACVersion); err != nil { return false, err } } @@ -90,8 +90,8 @@ func createRBACIfNecessary(ctx context.Context, kubernetesProvider *kubernetes.P return true, nil } -func createMizuApiServerPod(ctx context.Context, kubernetesProvider *kubernetes.Provider, opts *kubernetes.ApiServerOptions) error { - pod, err := kubernetesProvider.GetMizuApiServerPodObject(opts, false, "", false) +func createKubesharkApiServerPod(ctx context.Context, kubernetesProvider *kubernetes.Provider, opts *kubernetes.ApiServerOptions) error { + pod, err := kubernetesProvider.GetKubesharkApiServerPodObject(opts, false, "", false) if err != nil { return err } diff --git a/cli/uiUtils/openBrowser.go b/cli/uiUtils/openBrowser.go index 9274ce63b..789dd5a17 100644 --- a/cli/uiUtils/openBrowser.go +++ b/cli/uiUtils/openBrowser.go @@ -5,7 +5,7 @@ import ( "os/exec" "runtime" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func OpenBrowser(url string) { diff --git a/cli/utils/waitUtils.go b/cli/utils/waitUtils.go index 162ea9377..89334f4fc 100644 --- a/cli/utils/waitUtils.go +++ b/cli/utils/waitUtils.go @@ -6,7 +6,7 @@ import ( "os/signal" "syscall" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func WaitForFinish(ctx context.Context, cancel context.CancelFunc) { diff --git a/devops/build-push-featurebranch.sh b/devops/build-push-featurebranch.sh index 7723b1618..720917a78 100755 --- a/devops/build-push-featurebranch.sh +++ b/devops/build-push-featurebranch.sh @@ -3,7 +3,7 @@ set -e GCP_PROJECT=up9-docker-hub REPOSITORY=gcr.io/$GCP_PROJECT -SERVER_NAME=mizu +SERVER_NAME=kubeshark GIT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2 | tr '[:upper:]' '[:lower:]') DOCKER_REPO=$REPOSITORY/$SERVER_NAME/$GIT_BRANCH diff --git a/devops/linux-arm64-musl-go-libpcap-capstone-bpf/build-push.sh b/devops/linux-arm64-musl-go-libpcap-capstone-bpf/build-push.sh index f4092dd9c..98f28e0ff 100755 --- a/devops/linux-arm64-musl-go-libpcap-capstone-bpf/build-push.sh +++ b/devops/linux-arm64-musl-go-libpcap-capstone-bpf/build-push.sh @@ -2,4 +2,4 @@ set -e # Build it on x86_64 -docker build . -t up9inc/linux-arm64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 && docker push up9inc/linux-arm64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 +docker build . -t kubeshark/linux-arm64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 && docker push kubeshark/linux-arm64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 diff --git a/devops/linux-x86_64-musl-go-libpcap-capstone-bpf/build-push.sh b/devops/linux-x86_64-musl-go-libpcap-capstone-bpf/build-push.sh index 26f8daba6..aee3e5820 100755 --- a/devops/linux-x86_64-musl-go-libpcap-capstone-bpf/build-push.sh +++ b/devops/linux-x86_64-musl-go-libpcap-capstone-bpf/build-push.sh @@ -2,4 +2,4 @@ set -e # Build it on arm64 -docker build . -t up9inc/linux-x86_64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 && docker push up9inc/linux-x86_64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 +docker build . -t kubeshark/linux-x86_64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 && docker push kubeshark/linux-x86_64-musl-go-libpcap-capstone-bpf:capstone-5.0-rc2 diff --git a/devops/ui-common-pack.sh b/devops/ui-common-pack.sh index 319b6e6d3..b419c7f21 100755 --- a/devops/ui-common-pack.sh +++ b/devops/ui-common-pack.sh @@ -9,4 +9,4 @@ echo "dst folder: $dst_folder"; cd $dst_folder/../ui-common npm i npm pack -mv up9-mizu-common-0.0.0.tgz $dst_folder +mv up9-kubeshark-common-0.0.0.tgz $dst_folder diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c27c061b0..1e02739c9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1 +1 @@ -Mizu CHANGELOG is now part of [Mizu wiki](https://github.com/up9inc/mizu/wiki/CHANGELOG) +Kubeshark CHANGELOG is now part of [Kubeshark wiki](https://github.com/kubeshark/kubeshark/wiki/CHANGELOG) diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index f152707fd..5977b5275 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at mizu@up9.com. All +reported by contacting the project team at kubeshark@up9.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 542a66a1f..dea6eaa2f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,13 +1,13 @@ -![Mizu: The API Traffic Viewer for Kubernetes](../assets/mizu-logo.svg) +![Kubeshark: The API Traffic Viewer for Kubernetes](../assets/kubeshark-logo.svg) -# Contributing to Mizu +# Contributing to Kubeshark We welcome code contributions from the community. Please read and follow the guidelines below. ## Communication -* Before starting work on a major feature, please reach out to us via [GitHub](https://github.com/up9inc/mizu), [Slack](https://join.slack.com/share/zt-u6bbs3pg-X1zhQOXOH0yEoqILgH~csw), [email](mailto:mizu@up9.com), etc. We will make sure no one else is already working on it. A _major feature_ is defined as any change that is > 100 LOC altered (not including tests), or changes any user-facing behavior +* Before starting work on a major feature, please reach out to us via [GitHub](https://github.com/kubeshark/kubeshark), [Slack](https://join.slack.com/share/zt-u6bbs3pg-X1zhQOXOH0yEoqILgH~csw), [email](mailto:kubeshark@up9.com), etc. We will make sure no one else is already working on it. A _major feature_ is defined as any change that is > 100 LOC altered (not including tests), or changes any user-facing behavior * Small patches and bug fixes don't need prior communication. ## Contribution Requirements diff --git a/docs/TESTING.md b/docs/TESTING.md index f79a575f1..fc325f737 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -1,4 +1,4 @@ -![Mizu: The API Traffic Viewer for Kubernetes](../assets/mizu-logo.svg) +![Kubeshark: The API Traffic Viewer for Kubernetes](../assets/kubeshark-logo.svg) # Testing guidelines ## Generic guidelines @@ -16,7 +16,7 @@ * In case of exported func testing * Name the test file "_test.go" * Name the test package "_test" - * Example - [Slice Utils](../cli/mizu/sliceUtils_test.go) + * Example - [Slice Utils](../cli/kubeshark/sliceUtils_test.go) * Make sure to run test coverage to make sure you covered all the cases and lines in the func ## Acceptance tests diff --git a/logger/go.mod b/logger/go.mod index e549fe70e..38be7aaae 100644 --- a/logger/go.mod +++ b/logger/go.mod @@ -1,4 +1,4 @@ -module github.com/up9inc/mizu/logger +module github.com/kubeshark/kubeshark/logger go 1.17 diff --git a/logger/logger.go b/logger/logger.go index 0ccea2cef..3d5a63c3c 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -6,7 +6,7 @@ import ( "github.com/op/go-logging" ) -var Log = logging.MustGetLogger("mizu") +var Log = logging.MustGetLogger("kubeshark") var format = logging.MustStringFormatter( `[%{time:2006-01-02T15:04:05.000-0700}] %{level:-5s} ▶ %{message} ▶ [%{pid} %{shortfile} %{shortfunc}]`, @@ -15,7 +15,7 @@ var format = logging.MustStringFormatter( func InitLogger(logPath string) { f, err := os.OpenFile(logPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { - Log.Infof("Failed to open mizu log file: %v, err %v", logPath, err) + Log.Infof("Failed to open kubeshark log file: %v, err %v", logPath, err) } fileLog := logging.NewLogBackend(f, "", 0) diff --git a/performance_analysis/README.md b/performance_analysis/README.md index cc3d677fc..77997ba87 100644 --- a/performance_analysis/README.md +++ b/performance_analysis/README.md @@ -38,7 +38,7 @@ The log file names should be named in this format `XX_DESCRIPTION.log` when XX i Example run: ``` -cd $MIZU_HOME/performance_analysis +cd $KUBESHARK_HOME/performance_analysis virtualenv venv source venv/bin/activate pip install -r requirements.txt @@ -64,7 +64,7 @@ Tapper can be run with various debug modes: * No Send - Emit the request response pair, but don't send them to the Api Server. * Regular mode -![Tapper Modes](https://github.com/up9inc/mizu/blob/debug/profile-tapper-benchmark/performance_analysis/tapper-modes.png) +![Tapper Modes](https://github.com/kubeshark/kubeshark/blob/debug/profile-tapper-benchmark/performance_analysis/tapper-modes.png) # Run benchmark with various tapper modes @@ -75,7 +75,7 @@ In order to run the benchmark you probably want: 2. An up and running Basenine 3. An up and running UI (optional) 4. An up and running test server, like nginx, that can return a known payload at a known endpoint. -5. Set MIZU_HOME environment variable to points to mizu directory +5. Set KUBESHARK_HOME environment variable to points to kubeshark directory 6. Install the `hey` tool ## Running the benchmark @@ -84,24 +84,24 @@ In order to run a benchmark use the `run_tapper_benchmark.sh` script. Example run: ``` -cd $MIZU_HOME/performance_analysis +cd $KUBESHARK_HOME/performance_analysis source venv/bin/activate # Assuming you already run plot_from_tapper_logs.py ./run_tapper_benchmark.sh ``` Running it without params use the default values, use the following environment variables for customization: ``` -export=MIZU_BENCHMARK_OUTPUT_DIR=/path/to/dir # Set the output directory for tapper logs and graph -export=MIZU_BENCHMARK_CLIENT_PERIOD=1m # How long each test run -export=MIZU_BENCHMARK_URL=http://server:port/path # The URL to use for the benchmarking process (the test server endpoint) -export=MIZU_BENCHMARK_RUN_COUNT=3 # How many times each tapper mode should run -export=MIZU_BENCHMARK_QPS=250 # How many queries per second the each client should send to the test server -export=MIZU_BENCHMARK_CLIENTS_COUNT=5 # How many clients should run in parallel during the benchmark +export=KUBESHARK_BENCHMARK_OUTPUT_DIR=/path/to/dir # Set the output directory for tapper logs and graph +export=KUBESHARK_BENCHMARK_CLIENT_PERIOD=1m # How long each test run +export=KUBESHARK_BENCHMARK_URL=http://server:port/path # The URL to use for the benchmarking process (the test server endpoint) +export=KUBESHARK_BENCHMARK_RUN_COUNT=3 # How many times each tapper mode should run +export=KUBESHARK_BENCHMARK_QPS=250 # How many queries per second the each client should send to the test server +export=KUBESHARK_BENCHMARK_CLIENTS_COUNT=5 # How many clients should run in parallel during the benchmark ``` # Example output graph An example output graph from a 15 min run with 15K payload and 1000 QPS looks like -![Example Graph](https://github.com/up9inc/mizu/blob/debug/profile-tapper-benchmark/performance_analysis/example-graph.png) +![Example Graph](https://github.com/kubeshark/kubeshark/blob/debug/profile-tapper-benchmark/performance_analysis/example-graph.png) diff --git a/performance_analysis/run_tapper_benchmark.sh b/performance_analysis/run_tapper_benchmark.sh index bebcd7825..1c98a69ab 100755 --- a/performance_analysis/run_tapper_benchmark.sh +++ b/performance_analysis/run_tapper_benchmark.sh @@ -1,12 +1,12 @@ #!/bin/bash -[ -z "$MIZU_HOME" ] && { echo "MIZU_HOME is missing"; exit 1; } -[ -z "$MIZU_BENCHMARK_OUTPUT_DIR" ] && export MIZU_BENCHMARK_OUTPUT_DIR="/tmp/mizu-benchmark-results-$(date +%d-%m-%H-%M)" -[ -z "$MIZU_BENCHMARK_CLIENT_PERIOD" ] && export MIZU_BENCHMARK_CLIENT_PERIOD="1m" -[ -z "$MIZU_BENCHMARK_URL" ] && export MIZU_BENCHMARK_URL="http://localhost:8081/data/b.1000.json" -[ -z "$MIZU_BENCHMARK_RUN_COUNT" ] && export MIZU_BENCHMARK_RUN_COUNT="3" -[ -z "$MIZU_BENCHMARK_QPS" ] && export MIZU_BENCHMARK_QPS="500" -[ -z "$MIZU_BENCHMARK_CLIENTS_COUNT" ] && export MIZU_BENCHMARK_CLIENTS_COUNT="5" +[ -z "$KUBESHARK_HOME" ] && { echo "KUBESHARK_HOME is missing"; exit 1; } +[ -z "$KUBESHARK_BENCHMARK_OUTPUT_DIR" ] && export KUBESHARK_BENCHMARK_OUTPUT_DIR="/tmp/kubeshark-benchmark-results-$(date +%d-%m-%H-%M)" +[ -z "$KUBESHARK_BENCHMARK_CLIENT_PERIOD" ] && export KUBESHARK_BENCHMARK_CLIENT_PERIOD="1m" +[ -z "$KUBESHARK_BENCHMARK_URL" ] && export KUBESHARK_BENCHMARK_URL="http://localhost:8081/data/b.1000.json" +[ -z "$KUBESHARK_BENCHMARK_RUN_COUNT" ] && export KUBESHARK_BENCHMARK_RUN_COUNT="3" +[ -z "$KUBESHARK_BENCHMARK_QPS" ] && export KUBESHARK_BENCHMARK_QPS="500" +[ -z "$KUBESHARK_BENCHMARK_CLIENTS_COUNT" ] && export KUBESHARK_BENCHMARK_CLIENTS_COUNT="5" function log() { local message=$@ @@ -17,9 +17,9 @@ function run_single_bench() { local mode_num=$1 local mode_str=$2 - log "Starting ${mode_num}_${mode_str} (runs: $MIZU_BENCHMARK_RUN_COUNT) (period: $MIZU_BENCHMARK_CLIENT_PERIOD)" + log "Starting ${mode_num}_${mode_str} (runs: $KUBESHARK_BENCHMARK_RUN_COUNT) (period: $KUBESHARK_BENCHMARK_CLIENT_PERIOD)" - for ((i=0;i<"$MIZU_BENCHMARK_RUN_COUNT";i++)); do + for ((i=0;i<"$KUBESHARK_BENCHMARK_RUN_COUNT";i++)); do log " $i: Running tapper" rm -f tapper.log tapper_args=("--tap" "--api-server-address" "ws://localhost:8899/wsTapper" "-stats" "10" "-ignore-ports" "8899,9099") @@ -29,15 +29,15 @@ function run_single_bench() { else tapper_args+=("-i" "lo") fi - nohup ./agent/build/mizuagent ${tapper_args[@]} > tapper.log 2>&1 & + nohup ./agent/build/kubesharkagent ${tapper_args[@]} > tapper.log 2>&1 & log " $i: Running client (hey)" - hey -z $MIZU_BENCHMARK_CLIENT_PERIOD -c $MIZU_BENCHMARK_CLIENTS_COUNT -q $MIZU_BENCHMARK_QPS $MIZU_BENCHMARK_URL > /dev/null || return 1 + hey -z $KUBESHARK_BENCHMARK_CLIENT_PERIOD -c $KUBESHARK_BENCHMARK_CLIENTS_COUNT -q $KUBESHARK_BENCHMARK_QPS $KUBESHARK_BENCHMARK_URL > /dev/null || return 1 log " $i: Killing tapper" - kill -9 $(ps -ef | grep agent/build/mizuagent | grep tap | grep -v grep | awk '{ print $2 }') > /dev/null 2>&1 + kill -9 $(ps -ef | grep agent/build/kubesharkagent | grep tap | grep -v grep | awk '{ print $2 }') > /dev/null 2>&1 - local output_file=$MIZU_BENCHMARK_OUTPUT_DIR/${mode_num}_${mode_str}_${i}.log + local output_file=$KUBESHARK_BENCHMARK_OUTPUT_DIR/${mode_num}_${mode_str}_${i}.log log " $i: Moving output to $output_file" mv tapper.log $output_file || return 1 done @@ -46,55 +46,55 @@ function run_single_bench() { function generate_bench_graph() { cd performance_analysis/ || return 1 source venv/bin/activate - python plot_from_tapper_logs.py $MIZU_BENCHMARK_OUTPUT_DIR/*.log || return 1 - mv graph.png $MIZU_BENCHMARK_OUTPUT_DIR || return 1 + python plot_from_tapper_logs.py $KUBESHARK_BENCHMARK_OUTPUT_DIR/*.log || return 1 + mv graph.png $KUBESHARK_BENCHMARK_OUTPUT_DIR || return 1 } -mkdir -p $MIZU_BENCHMARK_OUTPUT_DIR -rm -f $MIZU_BENCHMARK_OUTPUT_DIR/* -log "Writing output to $MIZU_BENCHMARK_OUTPUT_DIR" +mkdir -p $KUBESHARK_BENCHMARK_OUTPUT_DIR +rm -f $KUBESHARK_BENCHMARK_OUTPUT_DIR/* +log "Writing output to $KUBESHARK_BENCHMARK_OUTPUT_DIR" -cd $MIZU_HOME || exit 1 +cd $KUBESHARK_HOME || exit 1 export HOST_MODE=0 export SENSITIVE_DATA_FILTERING_OPTIONS='{}' -export MIZU_DEBUG_DISABLE_PCAP=false -export MIZU_DEBUG_DISABLE_TCP_REASSEMBLY=false -export MIZU_DEBUG_DISABLE_TCP_STREAM=false -export MIZU_DEBUG_DISABLE_NON_HTTP_EXTENSSION=false -export MIZU_DEBUG_DISABLE_DISSECTORS=false -export MIZU_DEBUG_DISABLE_EMITTING=false -export MIZU_DEBUG_DISABLE_SENDING=false +export KUBESHARK_DEBUG_DISABLE_PCAP=false +export KUBESHARK_DEBUG_DISABLE_TCP_REASSEMBLY=false +export KUBESHARK_DEBUG_DISABLE_TCP_STREAM=false +export KUBESHARK_DEBUG_DISABLE_NON_HTTP_EXTENSSION=false +export KUBESHARK_DEBUG_DISABLE_DISSECTORS=false +export KUBESHARK_DEBUG_DISABLE_EMITTING=false +export KUBESHARK_DEBUG_DISABLE_SENDING=false -export MIZU_DEBUG_DISABLE_PCAP=true +export KUBESHARK_DEBUG_DISABLE_PCAP=true run_single_bench "01" "no_pcap" || exit 1 -export MIZU_DEBUG_DISABLE_PCAP=false +export KUBESHARK_DEBUG_DISABLE_PCAP=false -export MIZU_DEBUG_DISABLE_TCP_REASSEMBLY=true +export KUBESHARK_DEBUG_DISABLE_TCP_REASSEMBLY=true run_single_bench "02" "no_assembler" || exit 1 -export MIZU_DEBUG_DISABLE_TCP_REASSEMBLY=false +export KUBESHARK_DEBUG_DISABLE_TCP_REASSEMBLY=false -export MIZU_DEBUG_DISABLE_TCP_STREAM=true +export KUBESHARK_DEBUG_DISABLE_TCP_STREAM=true run_single_bench "03" "no_tcp_stream" || exit 1 -export MIZU_DEBUG_DISABLE_TCP_STREAM=false +export KUBESHARK_DEBUG_DISABLE_TCP_STREAM=false -export MIZU_DEBUG_DISABLE_NON_HTTP_EXTENSSION=true +export KUBESHARK_DEBUG_DISABLE_NON_HTTP_EXTENSSION=true run_single_bench "04" "only_http" || exit 1 -export MIZU_DEBUG_DISABLE_NON_HTTP_EXTENSSION=false +export KUBESHARK_DEBUG_DISABLE_NON_HTTP_EXTENSSION=false -export MIZU_DEBUG_DISABLE_DISSECTORS=true +export KUBESHARK_DEBUG_DISABLE_DISSECTORS=true run_single_bench "05" "no_dissectors" || exit 1 -export MIZU_DEBUG_DISABLE_DISSECTORS=false +export KUBESHARK_DEBUG_DISABLE_DISSECTORS=false -export MIZU_DEBUG_DISABLE_EMITTING=true +export KUBESHARK_DEBUG_DISABLE_EMITTING=true run_single_bench "06" "no_emit" || exit 1 -export MIZU_DEBUG_DISABLE_EMITTING=false +export KUBESHARK_DEBUG_DISABLE_EMITTING=false -export MIZU_DEBUG_DISABLE_SENDING=true +export KUBESHARK_DEBUG_DISABLE_SENDING=true run_single_bench "07" "no_send" || exit 1 -export MIZU_DEBUG_DISABLE_SENDING=false +export KUBESHARK_DEBUG_DISABLE_SENDING=false run_single_bench "08" "normal" || exit 1 generate_bench_graph || exit 1 -log "Output written to to $MIZU_BENCHMARK_OUTPUT_DIR" +log "Output written to to $KUBESHARK_BENCHMARK_OUTPUT_DIR" diff --git a/shared/consts.go b/shared/consts.go index 8293c7940..10a631ff4 100644 --- a/shared/consts.go +++ b/shared/consts.go @@ -1,16 +1,16 @@ package shared const ( - MizuFilteringOptionsEnvVar = "SENSITIVE_DATA_FILTERING_OPTIONS" - HostModeEnvVar = "HOST_MODE" - NodeNameEnvVar = "NODE_NAME" - ConfigDirPath = "/app/config/" - DataDirPath = "/app/data/" - ConfigFileName = "mizu-config.json" - DefaultApiServerPort = 8899 - LogLevelEnvVar = "LOG_LEVEL" - MizuAgentImageRepo = "docker.io/up9inc/mizu" - BasenineHost = "127.0.0.1" - BaseninePort = "9099" - BasenineReconnectInterval = 3 + KubesharkFilteringOptionsEnvVar = "SENSITIVE_DATA_FILTERING_OPTIONS" + HostModeEnvVar = "HOST_MODE" + NodeNameEnvVar = "NODE_NAME" + ConfigDirPath = "/app/config/" + DataDirPath = "/app/data/" + ConfigFileName = "kubeshark-config.json" + DefaultApiServerPort = 8899 + LogLevelEnvVar = "LOG_LEVEL" + KubesharkAgentImageRepo = "docker.io/kubeshark/kubeshark" + BasenineHost = "127.0.0.1" + BaseninePort = "9099" + BasenineReconnectInterval = 3 ) diff --git a/shared/go.mod b/shared/go.mod index 54e6d1927..29feeb0c8 100644 --- a/shared/go.mod +++ b/shared/go.mod @@ -1,12 +1,12 @@ -module github.com/up9inc/mizu/shared +module github.com/kubeshark/kubeshark/shared go 1.17 require ( github.com/docker/go-units v0.4.0 github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 - github.com/up9inc/mizu/logger v0.0.0 - github.com/up9inc/mizu/tap/api v0.0.0 + github.com/kubeshark/kubeshark/logger v0.0.0 + github.com/kubeshark/kubeshark/tap/api v0.0.0 k8s.io/api v0.23.3 k8s.io/apimachinery v0.23.3 k8s.io/client-go v0.23.3 @@ -65,7 +65,7 @@ require ( github.com/spf13/cobra v1.3.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.7.0 // indirect - github.com/up9inc/mizu/tap/dbgctl v0.0.0 // indirect + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 // indirect github.com/xlab/treeprint v1.1.0 // indirect go.starlark.net v0.0.0-20220203230714-bb14e151c28f // indirect golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab // indirect @@ -92,8 +92,8 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/up9inc/mizu/logger v0.0.0 => ../logger +replace github.com/kubeshark/kubeshark/logger v0.0.0 => ../logger -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../tap/api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../tap/api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../tap/dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../tap/dbgctl diff --git a/shared/kubernetes/consts.go b/shared/kubernetes/consts.go index ed75398e0..7e13351e7 100644 --- a/shared/kubernetes/consts.go +++ b/shared/kubernetes/consts.go @@ -1,25 +1,25 @@ package kubernetes const ( - MizuResourcesPrefix = "mizu-" - ApiServerPodName = MizuResourcesPrefix + "api-server" - ClusterRoleBindingName = MizuResourcesPrefix + "cluster-role-binding" - ClusterRoleName = MizuResourcesPrefix + "cluster-role" + KubesharkResourcesPrefix = "kubeshark-" + ApiServerPodName = KubesharkResourcesPrefix + "api-server" + ClusterRoleBindingName = KubesharkResourcesPrefix + "cluster-role-binding" + ClusterRoleName = KubesharkResourcesPrefix + "cluster-role" K8sAllNamespaces = "" - RoleBindingName = MizuResourcesPrefix + "role-binding" - RoleName = MizuResourcesPrefix + "role" - ServiceAccountName = MizuResourcesPrefix + "service-account" - TapperDaemonSetName = MizuResourcesPrefix + "tapper-daemon-set" - TapperPodName = MizuResourcesPrefix + "tapper" - ConfigMapName = MizuResourcesPrefix + "config" + RoleBindingName = KubesharkResourcesPrefix + "role-binding" + RoleName = KubesharkResourcesPrefix + "role" + ServiceAccountName = KubesharkResourcesPrefix + "service-account" + TapperDaemonSetName = KubesharkResourcesPrefix + "tapper-daemon-set" + TapperPodName = KubesharkResourcesPrefix + "tapper" + ConfigMapName = KubesharkResourcesPrefix + "config" MinKubernetesServerVersion = "1.16.0" ) const ( - LabelPrefixApp = "app.kubernetes.io/" - LabelManagedBy = LabelPrefixApp + "managed-by" - LabelCreatedBy = LabelPrefixApp + "created-by" - LabelValueMizu = "mizu" - LabelValueMizuCLI = "mizu-cli" - LabelValueMizuAgent = "mizu-agent" + LabelPrefixApp = "app.kubernetes.io/" + LabelManagedBy = LabelPrefixApp + "managed-by" + LabelCreatedBy = LabelPrefixApp + "created-by" + LabelValueKubeshark = "kubeshark" + LabelValueKubesharkCLI = "kubeshark-cli" + LabelValueKubesharkAgent = "kubeshark-agent" ) diff --git a/shared/kubernetes/mizuTapperSyncer.go b/shared/kubernetes/kubesharkTapperSyncer.go similarity index 76% rename from shared/kubernetes/mizuTapperSyncer.go rename to shared/kubernetes/kubesharkTapperSyncer.go index c0e8ef8c3..3f152a049 100644 --- a/shared/kubernetes/mizuTapperSyncer.go +++ b/shared/kubernetes/kubesharkTapperSyncer.go @@ -6,11 +6,11 @@ import ( "regexp" "time" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/shared/debounce" + "github.com/kubeshark/kubeshark/tap/api" "github.com/op/go-logging" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/shared/debounce" - "github.com/up9inc/mizu/tap/api" core "k8s.io/api/core/v1" ) @@ -21,8 +21,8 @@ type TappedPodChangeEvent struct { Removed []core.Pod } -// MizuTapperSyncer uses a k8s pod watch to update tapper daemonsets when targeted pods are removed or created -type MizuTapperSyncer struct { +// KubesharkTapperSyncer uses a k8s pod watch to update tapper daemonsets when targeted pods are removed or created +type KubesharkTapperSyncer struct { startTime time.Time context context.Context CurrentlyTappedPods []core.Pod @@ -36,22 +36,22 @@ type MizuTapperSyncer struct { } type TapperSyncerConfig struct { - TargetNamespaces []string - PodFilterRegex regexp.Regexp - MizuResourcesNamespace string - AgentImage string - TapperResources shared.Resources - ImagePullPolicy core.PullPolicy - LogLevel logging.Level - MizuApiFilteringOptions api.TrafficFilteringOptions - MizuServiceAccountExists bool - ServiceMesh bool - Tls bool - MaxLiveStreams int + TargetNamespaces []string + PodFilterRegex regexp.Regexp + KubesharkResourcesNamespace string + AgentImage string + TapperResources shared.Resources + ImagePullPolicy core.PullPolicy + LogLevel logging.Level + KubesharkApiFilteringOptions api.TrafficFilteringOptions + KubesharkServiceAccountExists bool + ServiceMesh bool + Tls bool + MaxLiveStreams int } -func CreateAndStartMizuTapperSyncer(ctx context.Context, kubernetesProvider *Provider, config TapperSyncerConfig, startTime time.Time) (*MizuTapperSyncer, error) { - syncer := &MizuTapperSyncer{ +func CreateAndStartKubesharkTapperSyncer(ctx context.Context, kubernetesProvider *Provider, config TapperSyncerConfig, startTime time.Time) (*KubesharkTapperSyncer, error) { + syncer := &KubesharkTapperSyncer{ startTime: startTime.Truncate(time.Second), // Round down because k8s CreationTimestamp is given in 1 sec resolution. context: ctx, CurrentlyTappedPods: make([]core.Pod, 0), @@ -66,7 +66,7 @@ func CreateAndStartMizuTapperSyncer(ctx context.Context, kubernetesProvider *Pro return nil, err } - if err := syncer.updateMizuTappers(); err != nil { + if err := syncer.updateKubesharkTappers(); err != nil { return nil, err } @@ -76,10 +76,10 @@ func CreateAndStartMizuTapperSyncer(ctx context.Context, kubernetesProvider *Pro return syncer, nil } -func (tapperSyncer *MizuTapperSyncer) watchTapperPods() { - mizuResourceRegex := regexp.MustCompile(fmt.Sprintf("^%s.*", TapperPodName)) - podWatchHelper := NewPodWatchHelper(tapperSyncer.kubernetesProvider, mizuResourceRegex) - eventChan, errorChan := FilteredWatch(tapperSyncer.context, podWatchHelper, []string{tapperSyncer.config.MizuResourcesNamespace}, podWatchHelper) +func (tapperSyncer *KubesharkTapperSyncer) watchTapperPods() { + kubesharkResourceRegex := regexp.MustCompile(fmt.Sprintf("^%s.*", TapperPodName)) + podWatchHelper := NewPodWatchHelper(tapperSyncer.kubernetesProvider, kubesharkResourceRegex) + eventChan, errorChan := FilteredWatch(tapperSyncer.context, podWatchHelper, []string{tapperSyncer.config.KubesharkResourcesNamespace}, podWatchHelper) for { select { @@ -91,7 +91,7 @@ func (tapperSyncer *MizuTapperSyncer) watchTapperPods() { pod, err := wEvent.ToPod() if err != nil { - logger.Log.Debugf("[ERROR] parsing Mizu resource pod: %+v", err) + logger.Log.Debugf("[ERROR] parsing Kubeshark resource pod: %+v", err) continue } @@ -115,10 +115,10 @@ func (tapperSyncer *MizuTapperSyncer) watchTapperPods() { } } -func (tapperSyncer *MizuTapperSyncer) watchTapperEvents() { - mizuResourceRegex := regexp.MustCompile(fmt.Sprintf("^%s.*", TapperPodName)) - eventWatchHelper := NewEventWatchHelper(tapperSyncer.kubernetesProvider, mizuResourceRegex, "pod") - eventChan, errorChan := FilteredWatch(tapperSyncer.context, eventWatchHelper, []string{tapperSyncer.config.MizuResourcesNamespace}, eventWatchHelper) +func (tapperSyncer *KubesharkTapperSyncer) watchTapperEvents() { + kubesharkResourceRegex := regexp.MustCompile(fmt.Sprintf("^%s.*", TapperPodName)) + eventWatchHelper := NewEventWatchHelper(tapperSyncer.kubernetesProvider, kubesharkResourceRegex, "pod") + eventChan, errorChan := FilteredWatch(tapperSyncer.context, eventWatchHelper, []string{tapperSyncer.config.KubesharkResourcesNamespace}, eventWatchHelper) for { select { @@ -130,7 +130,7 @@ func (tapperSyncer *MizuTapperSyncer) watchTapperEvents() { event, err := wEvent.ToEvent() if err != nil { - logger.Log.Debugf("[ERROR] parsing Mizu resource event: %+v", err) + logger.Log.Debugf("[ERROR] parsing Kubeshark resource event: %+v", err) continue } @@ -143,7 +143,7 @@ func (tapperSyncer *MizuTapperSyncer) watchTapperEvents() { event.Reason, event.Note)) - pod, err1 := tapperSyncer.kubernetesProvider.GetPod(tapperSyncer.context, tapperSyncer.config.MizuResourcesNamespace, event.Regarding.Name) + pod, err1 := tapperSyncer.kubernetesProvider.GetPod(tapperSyncer.context, tapperSyncer.config.KubesharkResourcesNamespace, event.Regarding.Name) if err1 != nil { logger.Log.Debugf(fmt.Sprintf("Couldn't get tapper pod %s", event.Regarding.Name)) continue @@ -174,7 +174,7 @@ func (tapperSyncer *MizuTapperSyncer) watchTapperEvents() { } } -func (tapperSyncer *MizuTapperSyncer) watchPodsForTapping() { +func (tapperSyncer *KubesharkTapperSyncer) watchPodsForTapping() { podWatchHelper := NewPodWatchHelper(tapperSyncer.kubernetesProvider, &tapperSyncer.config.PodFilterRegex) eventChan, errorChan := FilteredWatch(tapperSyncer.context, podWatchHelper, tapperSyncer.config.TargetNamespaces, podWatchHelper) @@ -191,7 +191,7 @@ func (tapperSyncer *MizuTapperSyncer) watchPodsForTapping() { logger.Log.Debugf("Nothing changed update tappers not needed") return } - if err := tapperSyncer.updateMizuTappers(); err != nil { + if err := tapperSyncer.updateKubesharkTappers(); err != nil { tapperSyncer.ErrorOut <- K8sTapManagerError{ OriginalError: err, TapManagerReason: TapManagerTapperUpdateError, @@ -261,7 +261,7 @@ func (tapperSyncer *MizuTapperSyncer) watchPodsForTapping() { } } -func (tapperSyncer *MizuTapperSyncer) handleErrorInWatchLoop(err error, restartTappersDebouncer *debounce.Debouncer) { +func (tapperSyncer *KubesharkTapperSyncer) handleErrorInWatchLoop(err error, restartTappersDebouncer *debounce.Debouncer) { logger.Log.Debugf("Watching pods loop, got error %v, stopping `restart tappers debouncer`", err) restartTappersDebouncer.Cancel() tapperSyncer.ErrorOut <- K8sTapManagerError{ @@ -270,11 +270,11 @@ func (tapperSyncer *MizuTapperSyncer) handleErrorInWatchLoop(err error, restartT } } -func (tapperSyncer *MizuTapperSyncer) updateCurrentlyTappedPods() (err error, changesFound bool) { +func (tapperSyncer *KubesharkTapperSyncer) updateCurrentlyTappedPods() (err error, changesFound bool) { if matchingPods, err := tapperSyncer.kubernetesProvider.ListAllRunningPodsMatchingRegex(tapperSyncer.context, &tapperSyncer.config.PodFilterRegex, tapperSyncer.config.TargetNamespaces); err != nil { return err, false } else { - podsToTap := excludeMizuPods(matchingPods) + podsToTap := excludeKubesharkPods(matchingPods) addedPods, removedPods := getPodArrayDiff(tapperSyncer.CurrentlyTappedPods, podsToTap) for _, addedPod := range addedPods { logger.Log.Debugf("tapping new pod %s", addedPod.Name) @@ -295,7 +295,7 @@ func (tapperSyncer *MizuTapperSyncer) updateCurrentlyTappedPods() (err error, ch } } -func (tapperSyncer *MizuTapperSyncer) updateMizuTappers() error { +func (tapperSyncer *KubesharkTapperSyncer) updateKubesharkTappers() error { nodesToTap := make([]string, len(tapperSyncer.nodeToTappedPodMap)) i := 0 for node := range tapperSyncer.nodeToTappedPodMap { @@ -312,7 +312,7 @@ func (tapperSyncer *MizuTapperSyncer) updateMizuTappers() error { if len(tapperSyncer.nodeToTappedPodMap) > 0 { var serviceAccountName string - if tapperSyncer.config.MizuServiceAccountExists { + if tapperSyncer.config.KubesharkServiceAccountExists { serviceAccountName = ServiceAccountName } else { serviceAccountName = "" @@ -323,18 +323,18 @@ func (tapperSyncer *MizuTapperSyncer) updateMizuTappers() error { nodeNames = append(nodeNames, nodeName) } - if err := tapperSyncer.kubernetesProvider.ApplyMizuTapperDaemonSet( + if err := tapperSyncer.kubernetesProvider.ApplyKubesharkTapperDaemonSet( tapperSyncer.context, - tapperSyncer.config.MizuResourcesNamespace, + tapperSyncer.config.KubesharkResourcesNamespace, TapperDaemonSetName, tapperSyncer.config.AgentImage, TapperPodName, - fmt.Sprintf("%s.%s.svc", ApiServerPodName, tapperSyncer.config.MizuResourcesNamespace), + fmt.Sprintf("%s.%s.svc", ApiServerPodName, tapperSyncer.config.KubesharkResourcesNamespace), nodeNames, serviceAccountName, tapperSyncer.config.TapperResources, tapperSyncer.config.ImagePullPolicy, - tapperSyncer.config.MizuApiFilteringOptions, + tapperSyncer.config.KubesharkApiFilteringOptions, tapperSyncer.config.LogLevel, tapperSyncer.config.ServiceMesh, tapperSyncer.config.Tls, @@ -344,9 +344,9 @@ func (tapperSyncer *MizuTapperSyncer) updateMizuTappers() error { logger.Log.Debugf("Successfully created %v tappers", len(tapperSyncer.nodeToTappedPodMap)) } else { - if err := tapperSyncer.kubernetesProvider.ResetMizuTapperDaemonSet( + if err := tapperSyncer.kubernetesProvider.ResetKubesharkTapperDaemonSet( tapperSyncer.context, - tapperSyncer.config.MizuResourcesNamespace, + tapperSyncer.config.KubesharkResourcesNamespace, TapperDaemonSetName, tapperSyncer.config.AgentImage, TapperPodName); err != nil { diff --git a/shared/kubernetes/provider.go b/shared/kubernetes/provider.go index 51da59d86..49a4c351c 100644 --- a/shared/kubernetes/provider.go +++ b/shared/kubernetes/provider.go @@ -12,11 +12,11 @@ import ( "regexp" "strconv" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared" + "github.com/kubeshark/kubeshark/shared/semver" + "github.com/kubeshark/kubeshark/tap/api" "github.com/op/go-logging" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared" - "github.com/up9inc/mizu/shared/semver" - "github.com/up9inc/mizu/tap/api" auth "k8s.io/api/authorization/v1" core "k8s.io/api/core/v1" rbac "k8s.io/api/rbac/v1" @@ -47,7 +47,7 @@ type Provider struct { } const ( - fieldManagerName = "mizu-manager" + fieldManagerName = "kubeshark-manager" procfsVolumeName = "proc" procfsMountPath = "/hostproc" sysfsVolumeName = "sys" @@ -60,21 +60,21 @@ func NewProvider(kubeConfigPath string, contextName string) (*Provider, error) { if err != nil { if clientcmd.IsEmptyConfig(err) { return nil, fmt.Errorf("couldn't find the kube config file, or file is empty (%s)\n"+ - "you can set alternative kube config file path by adding the kube-config-path field to the mizu config file, err: %w", kubeConfigPath, err) + "you can set alternative kube config file path by adding the kube-config-path field to the kubeshark config file, err: %w", kubeConfigPath, err) } if clientcmd.IsConfigurationInvalid(err) { return nil, fmt.Errorf("invalid kube config file (%s)\n"+ - "you can set alternative kube config file path by adding the kube-config-path field to the mizu config file, err: %w", kubeConfigPath, err) + "you can set alternative kube config file path by adding the kube-config-path field to the kubeshark config file, err: %w", kubeConfigPath, err) } return nil, fmt.Errorf("error while using kube config (%s)\n"+ - "you can set alternative kube config file path by adding the kube-config-path field to the mizu config file, err: %w", kubeConfigPath, err) + "you can set alternative kube config file path by adding the kube-config-path field to the kubeshark config file, err: %w", kubeConfigPath, err) } clientSet, err := getClientSet(restClientConfig) if err != nil { return nil, fmt.Errorf("error while using kube config (%s)\n"+ - "you can set alternative kube config file path by adding the kube-config-path field to the mizu config file, err: %w", kubeConfigPath, err) + "you can set alternative kube config file path by adding the kube-config-path field to the kubeshark config file, err: %w", kubeConfigPath, err) } logger.Log.Debugf("K8s client config, host: %s, api path: %s, user agent: %s", restClientConfig.Host, restClientConfig.APIPath, restClientConfig.UserAgent) @@ -83,8 +83,8 @@ func NewProvider(kubeConfigPath string, contextName string) (*Provider, error) { clientSet: clientSet, kubernetesConfig: kubernetesConfig, clientConfig: *restClientConfig, - managedBy: LabelValueMizu, - createdBy: LabelValueMizuCLI, + managedBy: LabelValueKubeshark, + createdBy: LabelValueKubesharkCLI, }, nil } @@ -103,14 +103,14 @@ func NewProviderInCluster() (*Provider, error) { clientSet: clientSet, kubernetesConfig: nil, // not relevant in cluster clientConfig: *restClientConfig, - managedBy: LabelValueMizu, - createdBy: LabelValueMizuAgent, + managedBy: LabelValueKubeshark, + createdBy: LabelValueKubesharkAgent, }, nil } func (provider *Provider) CurrentNamespace() (string, error) { if provider.kubernetesConfig == nil { - return "", errors.New("kubernetesConfig is nil, mizu cli will not work with in-cluster kubernetes config, use a kubeconfig file when initializing the Provider") + return "", errors.New("kubernetesConfig is nil, kubeshark cli will not work with in-cluster kubernetes config, use a kubeconfig file when initializing the Provider") } ns, _, err := provider.kubernetesConfig.Namespace() return ns, err @@ -184,7 +184,7 @@ type ApiServerOptions struct { Profiler bool } -func (provider *Provider) GetMizuApiServerPodObject(opts *ApiServerOptions, mountVolumeClaim bool, volumeClaimName string, createAuthContainer bool) (*core.Pod, error) { +func (provider *Provider) GetKubesharkApiServerPodObject(opts *ApiServerOptions, mountVolumeClaim bool, volumeClaimName string, createAuthContainer bool) (*core.Pod, error) { configMapVolume := &core.ConfigMapVolumeSource{} configMapVolume.Name = ConfigMapName @@ -206,7 +206,7 @@ func (provider *Provider) GetMizuApiServerPodObject(opts *ApiServerOptions, moun } command := []string{ - "./mizuagent", + "./kubesharkagent", "--api-server", } @@ -495,14 +495,14 @@ func (provider *Provider) doesResourceExist(resource interface{}, err error) (bo return resource != nil, nil } -func (provider *Provider) CreateMizuRBAC(ctx context.Context, namespace string, serviceAccountName string, clusterRoleName string, clusterRoleBindingName string, version string, resources []string) error { +func (provider *Provider) CreateKubesharkRBAC(ctx context.Context, namespace string, serviceAccountName string, clusterRoleName string, clusterRoleBindingName string, version string, resources []string) error { serviceAccount := &core.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ Name: serviceAccountName, Labels: map[string]string{ - "mizu-cli-version": version, - LabelManagedBy: provider.managedBy, - LabelCreatedBy: provider.createdBy, + "kubeshark-cli-version": version, + LabelManagedBy: provider.managedBy, + LabelCreatedBy: provider.createdBy, }, }, } @@ -510,9 +510,9 @@ func (provider *Provider) CreateMizuRBAC(ctx context.Context, namespace string, ObjectMeta: metav1.ObjectMeta{ Name: clusterRoleName, Labels: map[string]string{ - "mizu-cli-version": version, - LabelManagedBy: provider.managedBy, - LabelCreatedBy: provider.createdBy, + "kubeshark-cli-version": version, + LabelManagedBy: provider.managedBy, + LabelCreatedBy: provider.createdBy, }, }, Rules: []rbac.PolicyRule{ @@ -527,9 +527,9 @@ func (provider *Provider) CreateMizuRBAC(ctx context.Context, namespace string, ObjectMeta: metav1.ObjectMeta{ Name: clusterRoleBindingName, Labels: map[string]string{ - "mizu-cli-version": version, - LabelManagedBy: provider.managedBy, - LabelCreatedBy: provider.createdBy, + "kubeshark-cli-version": version, + LabelManagedBy: provider.managedBy, + LabelCreatedBy: provider.createdBy, }, }, RoleRef: rbac.RoleRef{ @@ -560,14 +560,14 @@ func (provider *Provider) CreateMizuRBAC(ctx context.Context, namespace string, return nil } -func (provider *Provider) CreateMizuRBACNamespaceRestricted(ctx context.Context, namespace string, serviceAccountName string, roleName string, roleBindingName string, version string) error { +func (provider *Provider) CreateKubesharkRBACNamespaceRestricted(ctx context.Context, namespace string, serviceAccountName string, roleName string, roleBindingName string, version string) error { serviceAccount := &core.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ Name: serviceAccountName, Labels: map[string]string{ - "mizu-cli-version": version, - LabelManagedBy: provider.managedBy, - LabelCreatedBy: provider.createdBy, + "kubeshark-cli-version": version, + LabelManagedBy: provider.managedBy, + LabelCreatedBy: provider.createdBy, }, }, } @@ -575,9 +575,9 @@ func (provider *Provider) CreateMizuRBACNamespaceRestricted(ctx context.Context, ObjectMeta: metav1.ObjectMeta{ Name: roleName, Labels: map[string]string{ - "mizu-cli-version": version, - LabelManagedBy: provider.managedBy, - LabelCreatedBy: provider.createdBy, + "kubeshark-cli-version": version, + LabelManagedBy: provider.managedBy, + LabelCreatedBy: provider.createdBy, }, }, Rules: []rbac.PolicyRule{ @@ -592,9 +592,9 @@ func (provider *Provider) CreateMizuRBACNamespaceRestricted(ctx context.Context, ObjectMeta: metav1.ObjectMeta{ Name: roleBindingName, Labels: map[string]string{ - "mizu-cli-version": version, - LabelManagedBy: provider.managedBy, - LabelCreatedBy: provider.createdBy, + "kubeshark-cli-version": version, + LabelManagedBy: provider.managedBy, + LabelCreatedBy: provider.createdBy, }, }, RoleRef: rbac.RoleRef{ @@ -685,9 +685,9 @@ func (provider *Provider) handleRemovalError(err error) error { return err } -func (provider *Provider) CreateConfigMap(ctx context.Context, namespace string, configMapName string, serializedMizuConfig string) error { +func (provider *Provider) CreateConfigMap(ctx context.Context, namespace string, configMapName string, serializedKubesharkConfig string) error { configMapData := make(map[string]string) - configMapData[shared.ConfigFileName] = serializedMizuConfig + configMapData[shared.ConfigFileName] = serializedKubesharkConfig configMap := &core.ConfigMap{ TypeMeta: metav1.TypeMeta{ @@ -709,20 +709,20 @@ func (provider *Provider) CreateConfigMap(ctx context.Context, namespace string, return nil } -func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespace string, daemonSetName string, podImage string, tapperPodName string, apiServerPodIp string, nodeNames []string, serviceAccountName string, resources shared.Resources, imagePullPolicy core.PullPolicy, mizuApiFilteringOptions api.TrafficFilteringOptions, logLevel logging.Level, serviceMesh bool, tls bool, maxLiveStreams int) error { +func (provider *Provider) ApplyKubesharkTapperDaemonSet(ctx context.Context, namespace string, daemonSetName string, podImage string, tapperPodName string, apiServerPodIp string, nodeNames []string, serviceAccountName string, resources shared.Resources, imagePullPolicy core.PullPolicy, kubesharkApiFilteringOptions api.TrafficFilteringOptions, logLevel logging.Level, serviceMesh bool, tls bool, maxLiveStreams int) error { logger.Log.Debugf("Applying %d tapper daemon sets, ns: %s, daemonSetName: %s, podImage: %s, tapperPodName: %s", len(nodeNames), namespace, daemonSetName, podImage, tapperPodName) if len(nodeNames) == 0 { return fmt.Errorf("daemon set %s must tap at least 1 pod", daemonSetName) } - mizuApiFilteringOptionsJsonStr, err := json.Marshal(mizuApiFilteringOptions) + kubesharkApiFilteringOptionsJsonStr, err := json.Marshal(kubesharkApiFilteringOptions) if err != nil { return err } - mizuCmd := []string{ - "./mizuagent", + kubesharkCmd := []string{ + "./kubesharkagent", "-i", "any", "--tap", "--api-server-address", fmt.Sprintf("ws://%s/wsTapper", apiServerPodIp), @@ -731,15 +731,15 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac } if serviceMesh { - mizuCmd = append(mizuCmd, "--servicemesh") + kubesharkCmd = append(kubesharkCmd, "--servicemesh") } if tls { - mizuCmd = append(mizuCmd, "--tls") + kubesharkCmd = append(kubesharkCmd, "--tls") } if serviceMesh || tls { - mizuCmd = append(mizuCmd, "--procfs", procfsMountPath) + kubesharkCmd = append(kubesharkCmd, "--procfs", procfsMountPath) } agentContainer := applyconfcore.Container() @@ -766,11 +766,11 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac agentContainer.WithSecurityContext(applyconfcore.SecurityContext().WithCapabilities(caps)) - agentContainer.WithCommand(mizuCmd...) + agentContainer.WithCommand(kubesharkCmd...) agentContainer.WithEnv( applyconfcore.EnvVar().WithName(shared.LogLevelEnvVar).WithValue(logLevel.String()), applyconfcore.EnvVar().WithName(shared.HostModeEnvVar).WithValue("1"), - applyconfcore.EnvVar().WithName(shared.MizuFilteringOptionsEnvVar).WithValue(string(mizuApiFilteringOptionsJsonStr)), + applyconfcore.EnvVar().WithName(shared.KubesharkFilteringOptionsEnvVar).WithValue(string(kubesharkApiFilteringOptionsJsonStr)), ) agentContainer.WithEnv( applyconfcore.EnvVar().WithName(shared.NodeNameEnvVar).WithValueFrom( @@ -887,13 +887,13 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac return err } -func (provider *Provider) ResetMizuTapperDaemonSet(ctx context.Context, namespace string, daemonSetName string, podImage string, tapperPodName string) error { +func (provider *Provider) ResetKubesharkTapperDaemonSet(ctx context.Context, namespace string, daemonSetName string, podImage string, tapperPodName string) error { agentContainer := applyconfcore.Container() agentContainer.WithName(tapperPodName) agentContainer.WithImage(podImage) nodeSelectorRequirement := applyconfcore.NodeSelectorRequirement() - nodeSelectorRequirement.WithKey("mizu-non-existing-label") + nodeSelectorRequirement.WithKey("kubeshark-non-existing-label") nodeSelectorRequirement.WithOperator(core.NodeSelectorOpExists) nodeSelectorTerm := applyconfcore.NodeSelectorTerm() nodeSelectorTerm.WithMatchExpressions(nodeSelectorRequirement) @@ -1057,9 +1057,9 @@ func (provider *Provider) ListManagedRoleBindings(ctx context.Context, namespace return provider.clientSet.RbacV1().RoleBindings(namespace).List(ctx, listOptions) } -// ValidateNotProxy We added this after a customer tried to run mizu from lens, which used len's kube config, which have cluster server configuration, which points to len's local proxy. +// ValidateNotProxy We added this after a customer tried to run kubeshark from lens, which used len's kube config, which have cluster server configuration, which points to len's local proxy. // The workaround was to use the user's local default kube config. -// For now - we are blocking the option to run mizu through a proxy to k8s server +// For now - we are blocking the option to run kubeshark through a proxy to k8s server func (provider *Provider) ValidateNotProxy() error { kubernetesUrl, err := url.Parse(provider.clientConfig.Host) if err != nil { diff --git a/shared/kubernetes/proxy.go b/shared/kubernetes/proxy.go index b01dea59a..cf106d4df 100644 --- a/shared/kubernetes/proxy.go +++ b/shared/kubernetes/proxy.go @@ -11,20 +11,20 @@ import ( "strings" "time" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/shared" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" "k8s.io/kubectl/pkg/proxy" ) const k8sProxyApiPrefix = "/" -const mizuServicePort = 80 +const kubesharkServicePort = 80 -func StartProxy(kubernetesProvider *Provider, proxyHost string, mizuPort uint16, mizuNamespace string, mizuServiceName string, cancel context.CancelFunc) (*http.Server, error) { - logger.Log.Debugf("Starting proxy using proxy method. namespace: [%v], service name: [%s], port: [%v]", mizuNamespace, mizuServiceName, mizuPort) +func StartProxy(kubernetesProvider *Provider, proxyHost string, kubesharkPort uint16, kubesharkNamespace string, kubesharkServiceName string, cancel context.CancelFunc) (*http.Server, error) { + logger.Log.Debugf("Starting proxy using proxy method. namespace: [%v], service name: [%s], port: [%v]", kubesharkNamespace, kubesharkServiceName, kubesharkPort) filter := &proxy.FilterServer{ AcceptPaths: proxy.MakeRegexpArrayOrDie(proxy.DefaultPathAcceptRE), RejectPaths: proxy.MakeRegexpArrayOrDie(proxy.DefaultPathRejectRE), @@ -37,10 +37,10 @@ func StartProxy(kubernetesProvider *Provider, proxyHost string, mizuPort uint16, return nil, err } mux := http.NewServeMux() - mux.Handle(k8sProxyApiPrefix, getRerouteHttpHandlerMizuAPI(proxyHandler, mizuNamespace, mizuServiceName)) - mux.Handle("/static/", getRerouteHttpHandlerMizuStatic(proxyHandler, mizuNamespace, mizuServiceName)) + mux.Handle(k8sProxyApiPrefix, getRerouteHttpHandlerKubesharkAPI(proxyHandler, kubesharkNamespace, kubesharkServiceName)) + mux.Handle("/static/", getRerouteHttpHandlerKubesharkStatic(proxyHandler, kubesharkNamespace, kubesharkServiceName)) - l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", proxyHost, int(mizuPort))) + l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", proxyHost, int(kubesharkPort))) if err != nil { return nil, err } @@ -59,29 +59,29 @@ func StartProxy(kubernetesProvider *Provider, proxyHost string, mizuPort uint16, return server, nil } -func getMizuApiServerProxiedHostAndPath(mizuNamespace string, mizuServiceName string) string { - return fmt.Sprintf("/api/v1/namespaces/%s/services/%s:%d/proxy", mizuNamespace, mizuServiceName, mizuServicePort) +func getKubesharkApiServerProxiedHostAndPath(kubesharkNamespace string, kubesharkServiceName string) string { + return fmt.Sprintf("/api/v1/namespaces/%s/services/%s:%d/proxy", kubesharkNamespace, kubesharkServiceName, kubesharkServicePort) } -func GetMizuApiServerProxiedHostAndPath(mizuPort uint16) string { - return fmt.Sprintf("localhost:%d", mizuPort) +func GetKubesharkApiServerProxiedHostAndPath(kubesharkPort uint16) string { + return fmt.Sprintf("localhost:%d", kubesharkPort) } -func getRerouteHttpHandlerMizuAPI(proxyHandler http.Handler, mizuNamespace string, mizuServiceName string) http.Handler { +func getRerouteHttpHandlerKubesharkAPI(proxyHandler http.Handler, kubesharkNamespace string, kubesharkServiceName string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - proxiedPath := getMizuApiServerProxiedHostAndPath(mizuNamespace, mizuServiceName) + proxiedPath := getKubesharkApiServerProxiedHostAndPath(kubesharkNamespace, kubesharkServiceName) //avoid redirecting several times if !strings.Contains(r.URL.Path, proxiedPath) { - r.URL.Path = fmt.Sprintf("%s%s", getMizuApiServerProxiedHostAndPath(mizuNamespace, mizuServiceName), r.URL.Path) + r.URL.Path = fmt.Sprintf("%s%s", getKubesharkApiServerProxiedHostAndPath(kubesharkNamespace, kubesharkServiceName), r.URL.Path) } proxyHandler.ServeHTTP(w, r) }) } -func getRerouteHttpHandlerMizuStatic(proxyHandler http.Handler, mizuNamespace string, mizuServiceName string) http.Handler { +func getRerouteHttpHandlerKubesharkStatic(proxyHandler http.Handler, kubesharkNamespace string, kubesharkServiceName string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - r.URL.Path = strings.Replace(r.URL.Path, "/static/", fmt.Sprintf("%s/static/", getMizuApiServerProxiedHostAndPath(mizuNamespace, mizuServiceName)), 1) + r.URL.Path = strings.Replace(r.URL.Path, "/static/", fmt.Sprintf("%s/static/", getKubesharkApiServerProxiedHostAndPath(kubesharkNamespace, kubesharkServiceName)), 1) proxyHandler.ServeHTTP(w, r) }) } diff --git a/shared/kubernetes/utils.go b/shared/kubernetes/utils.go index 823af34ef..520ee04fd 100644 --- a/shared/kubernetes/utils.go +++ b/shared/kubernetes/utils.go @@ -3,7 +3,7 @@ package kubernetes import ( "regexp" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/shared" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -48,17 +48,17 @@ func getMinimizedContainerStatuses(fullPod core.Pod) []core.ContainerStatus { return result } -func excludeMizuPods(pods []core.Pod) []core.Pod { - mizuPrefixRegex := regexp.MustCompile("^" + MizuResourcesPrefix) +func excludeKubesharkPods(pods []core.Pod) []core.Pod { + kubesharkPrefixRegex := regexp.MustCompile("^" + KubesharkResourcesPrefix) - nonMizuPods := make([]core.Pod, 0) + nonKubesharkPods := make([]core.Pod, 0) for _, pod := range pods { - if !mizuPrefixRegex.MatchString(pod.Name) { - nonMizuPods = append(nonMizuPods, pod) + if !kubesharkPrefixRegex.MatchString(pod.Name) { + nonKubesharkPods = append(nonKubesharkPods, pod) } } - return nonMizuPods + return nonKubesharkPods } func getPodArrayDiff(oldPods []core.Pod, newPods []core.Pod) (added []core.Pod, removed []core.Pod) { diff --git a/shared/kubernetes/watch.go b/shared/kubernetes/watch.go index 09004e2b5..42db15180 100644 --- a/shared/kubernetes/watch.go +++ b/shared/kubernetes/watch.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/shared/debounce" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/shared/debounce" "k8s.io/apimachinery/pkg/watch" ) diff --git a/shared/models.go b/shared/models.go index af5265646..b9524d36b 100644 --- a/shared/models.go +++ b/shared/models.go @@ -32,17 +32,17 @@ type OASConfig struct { MaxExampleLen int `yaml:"max-example-len" default:"10240"` } -type MizuAgentConfig struct { - MaxDBSizeBytes int64 `json:"maxDBSizeBytes"` - InsertionFilter string `json:"insertionFilter"` - AgentImage string `json:"agentImage"` - PullPolicy string `json:"pullPolicy"` - LogLevel logging.Level `json:"logLevel"` - TapperResources Resources `json:"tapperResources"` - MizuResourcesNamespace string `json:"mizuResourceNamespace"` - AgentDatabasePath string `json:"agentDatabasePath"` - ServiceMap bool `json:"serviceMap"` - OAS OASConfig `json:"oas"` +type KubesharkAgentConfig struct { + MaxDBSizeBytes int64 `json:"maxDBSizeBytes"` + InsertionFilter string `json:"insertionFilter"` + AgentImage string `json:"agentImage"` + PullPolicy string `json:"pullPolicy"` + LogLevel logging.Level `json:"logLevel"` + TapperResources Resources `json:"tapperResources"` + KubesharkResourcesNamespace string `json:"kubesharkResourceNamespace"` + AgentDatabasePath string `json:"agentDatabasePath"` + ServiceMap bool `json:"serviceMap"` + OAS OASConfig `json:"oas"` } type WebSocketMessageMetadata struct { diff --git a/shared/sliceUtils_test.go b/shared/sliceUtils_test.go index e5b8bf43a..9625002a6 100644 --- a/shared/sliceUtils_test.go +++ b/shared/sliceUtils_test.go @@ -2,7 +2,7 @@ package shared_test import ( "fmt" - "github.com/up9inc/mizu/shared" + "github.com/kubeshark/kubeshark/shared" "reflect" "testing" ) diff --git a/tap/api/api.go b/tap/api/api.go index 778acb1b8..9cd9ea9de 100644 --- a/tap/api/api.go +++ b/tap/api/api.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/dbgctl" + "github.com/kubeshark/kubeshark/tap/dbgctl" ) const UnknownNamespace = "" @@ -161,7 +161,7 @@ type Emitter interface { func (e *Emitting) Emit(item *OutputChannelItem) { e.AppStats.IncMatchedPairs() - if dbgctl.MizuTapperDisableEmitting { + if dbgctl.KubesharkTapperDisableEmitting { return } diff --git a/tap/api/go.mod b/tap/api/go.mod index f802db779..7f7a7660c 100644 --- a/tap/api/go.mod +++ b/tap/api/go.mod @@ -1,7 +1,7 @@ -module github.com/up9inc/mizu/tap/api +module github.com/kubeshark/kubeshark/tap/api go 1.17 -require github.com/up9inc/mizu/tap/dbgctl v0.0.0 +require github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../dbgctl diff --git a/tap/cleaner.go b/tap/cleaner.go index f9cd463bc..48ad28f39 100644 --- a/tap/cleaner.go +++ b/tap/cleaner.go @@ -5,8 +5,8 @@ import ( "time" "github.com/google/gopacket/reassembly" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" ) type CleanerStats struct { diff --git a/tap/dbgctl/debug_control.go b/tap/dbgctl/debug_control.go index 63da05b6a..c929dd0e0 100644 --- a/tap/dbgctl/debug_control.go +++ b/tap/dbgctl/debug_control.go @@ -5,11 +5,11 @@ import ( ) var ( - MizuTapperDisablePcap = os.Getenv("MIZU_DEBUG_DISABLE_PCAP") == "true" - MizuTapperDisableTcpReassembly = os.Getenv("MIZU_DEBUG_DISABLE_TCP_REASSEMBLY") == "true" - MizuTapperDisableTcpStream = os.Getenv("MIZU_DEBUG_DISABLE_TCP_STREAM") == "true" - MizuTapperDisableDissectors = os.Getenv("MIZU_DEBUG_DISABLE_DISSECTORS") == "true" - MizuTapperDisableEmitting = os.Getenv("MIZU_DEBUG_DISABLE_EMITTING") == "true" - MizuTapperDisableSending = os.Getenv("MIZU_DEBUG_DISABLE_SENDING") == "true" - MizuTapperDisableNonHttpExtensions = os.Getenv("MIZU_DEBUG_DISABLE_NON_HTTP_EXTENSSION") == "true" + KubesharkTapperDisablePcap = os.Getenv("KUBESHARK_DEBUG_DISABLE_PCAP") == "true" + KubesharkTapperDisableTcpReassembly = os.Getenv("KUBESHARK_DEBUG_DISABLE_TCP_REASSEMBLY") == "true" + KubesharkTapperDisableTcpStream = os.Getenv("KUBESHARK_DEBUG_DISABLE_TCP_STREAM") == "true" + KubesharkTapperDisableDissectors = os.Getenv("KUBESHARK_DEBUG_DISABLE_DISSECTORS") == "true" + KubesharkTapperDisableEmitting = os.Getenv("KUBESHARK_DEBUG_DISABLE_EMITTING") == "true" + KubesharkTapperDisableSending = os.Getenv("KUBESHARK_DEBUG_DISABLE_SENDING") == "true" + KubesharkTapperDisableNonHttpExtensions = os.Getenv("KUBESHARK_DEBUG_DISABLE_NON_HTTP_EXTENSSION") == "true" ) diff --git a/tap/dbgctl/go.mod b/tap/dbgctl/go.mod index 7cad5eba6..15f246730 100644 --- a/tap/dbgctl/go.mod +++ b/tap/dbgctl/go.mod @@ -1,3 +1,3 @@ -module github.com/up9inc/mizu/tap/dbgctl +module github.com/kubeshark/kubeshark/tap/dbgctl go 1.18 diff --git a/tap/diagnose/diagnose.go b/tap/diagnose/diagnose.go index e2264af6f..b0fe18298 100644 --- a/tap/diagnose/diagnose.go +++ b/tap/diagnose/diagnose.go @@ -8,8 +8,8 @@ import ( "strconv" "time" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" ) var AppStats = api.AppStats{} diff --git a/tap/diagnose/errors_map.go b/tap/diagnose/errors_map.go index 47b291926..821fdf1a5 100644 --- a/tap/diagnose/errors_map.go +++ b/tap/diagnose/errors_map.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/google/gopacket/examples/util" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) var TapErrors *errorsMap diff --git a/tap/diagnose/internal_stats.go b/tap/diagnose/internal_stats.go index 155f18884..90001144d 100644 --- a/tap/diagnose/internal_stats.go +++ b/tap/diagnose/internal_stats.go @@ -1,6 +1,6 @@ package diagnose -import "github.com/up9inc/mizu/logger" +import "github.com/kubeshark/kubeshark/logger" type tapperInternalStats struct { Ipdefrag int diff --git a/tap/extensions/amqp/Makefile b/tap/extensions/amqp/Makefile index ec4a1521c..f1b5a8ee5 100644 --- a/tap/extensions/amqp/Makefile +++ b/tap/extensions/amqp/Makefile @@ -2,10 +2,10 @@ skipbin := $$(find bin -mindepth 1 -maxdepth 1) skipexpect := $$(find expect -mindepth 1 -maxdepth 1) test: test-pull-bin test-pull-expect - @MIZU_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic test-update: test-pull-bin - @MIZU_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic test-pull-bin: @[ "${skipbin}" ] && echo "Skipping downloading BINs" || ../get-folder-of-tests.sh bin/amqp bin diff --git a/tap/extensions/amqp/go.mod b/tap/extensions/amqp/go.mod index 3c153988e..c8581f8ac 100644 --- a/tap/extensions/amqp/go.mod +++ b/tap/extensions/amqp/go.mod @@ -1,23 +1,23 @@ -module github.com/up9inc/mizu/tap/extensions/amqp +module github.com/kubeshark/kubeshark/tap/extensions/amqp go 1.17 require ( + github.com/kubeshark/kubeshark/logger v0.0.0 + github.com/kubeshark/kubeshark/tap/api v0.0.0 github.com/stretchr/testify v1.7.0 - github.com/up9inc/mizu/logger v0.0.0 - github.com/up9inc/mizu/tap/api v0.0.0 ) require ( github.com/davecgh/go-spew v1.1.0 // indirect + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 // indirect github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/up9inc/mizu/tap/dbgctl v0.0.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) -replace github.com/up9inc/mizu/logger v0.0.0 => ../../../logger +replace github.com/kubeshark/kubeshark/logger v0.0.0 => ../../../logger -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../../api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../../api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../../dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../../dbgctl diff --git a/tap/extensions/amqp/helpers.go b/tap/extensions/amqp/helpers.go index a73cb1aba..bbabd3962 100644 --- a/tap/extensions/amqp/helpers.go +++ b/tap/extensions/amqp/helpers.go @@ -6,8 +6,8 @@ import ( "sort" "strconv" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" ) var connectionMethodMap = map[int]string{ diff --git a/tap/extensions/amqp/main.go b/tap/extensions/amqp/main.go index 4662c40d7..b15228044 100644 --- a/tap/extensions/amqp/main.go +++ b/tap/extensions/amqp/main.go @@ -9,7 +9,7 @@ import ( "strconv" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) var protocol = api.Protocol{ diff --git a/tap/extensions/amqp/main_test.go b/tap/extensions/amqp/main_test.go index 7cd0dd7fd..c68a1d05d 100644 --- a/tap/extensions/amqp/main_test.go +++ b/tap/extensions/amqp/main_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" + "github.com/kubeshark/kubeshark/tap/api" "github.com/stretchr/testify/assert" - "github.com/up9inc/mizu/tap/api" ) const ( diff --git a/tap/extensions/amqp/matcher.go b/tap/extensions/amqp/matcher.go index 1b33fe1cf..4814bbfbb 100644 --- a/tap/extensions/amqp/matcher.go +++ b/tap/extensions/amqp/matcher.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) // Key is {client_addr}_{client_port}_{dest_addr}_{dest_port}_{channel_id}_{class_id}_{method_id} diff --git a/tap/extensions/amqp/tcp_reader_mock_test.go b/tap/extensions/amqp/tcp_reader_mock_test.go index 3081e449e..636145c7d 100644 --- a/tap/extensions/amqp/tcp_reader_mock_test.go +++ b/tap/extensions/amqp/tcp_reader_mock_test.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpReader struct { diff --git a/tap/extensions/amqp/tcp_stream_mock_test.go b/tap/extensions/amqp/tcp_stream_mock_test.go index 006e0d6e5..264580ce2 100644 --- a/tap/extensions/amqp/tcp_stream_mock_test.go +++ b/tap/extensions/amqp/tcp_stream_mock_test.go @@ -3,7 +3,7 @@ package amqp import ( "sync" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpStream struct { diff --git a/tap/extensions/get-folder-of-tests.sh b/tap/extensions/get-folder-of-tests.sh index 59b1a5cd4..b05c5a5fd 100755 --- a/tap/extensions/get-folder-of-tests.sh +++ b/tap/extensions/get-folder-of-tests.sh @@ -1,13 +1,13 @@ -mizu_test_files_repo=https://github.com/up9inc/mizu-tests-data -mizu_test_files_tmp_folder="mizu-test-files-tmp" +kubeshark_test_files_repo=https://github.com/kubeshark/kubeshark-tests-data +kubeshark_test_files_tmp_folder="kubeshark-test-files-tmp" requested_folder=$1 destination_folder_name=$2 -echo "Going to download folder (${requested_folder}) from repo (${mizu_test_files_repo}) and save it to local folder (${destination_folder_name})" +echo "Going to download folder (${requested_folder}) from repo (${kubeshark_test_files_repo}) and save it to local folder (${destination_folder_name})" -echo "Cloning repo to tmp folder (${mizu_test_files_tmp_folder})" -git clone ${mizu_test_files_repo} ${mizu_test_files_tmp_folder} --no-checkout --depth 1 --filter=blob:none --sparse -cd ${mizu_test_files_tmp_folder} +echo "Cloning repo to tmp folder (${kubeshark_test_files_tmp_folder})" +git clone ${kubeshark_test_files_repo} ${kubeshark_test_files_tmp_folder} --no-checkout --depth 1 --filter=blob:none --sparse +cd ${kubeshark_test_files_tmp_folder} echo "Adding sparse checkout folder" git sparse-checkout add ${requested_folder} @@ -21,4 +21,4 @@ mv ${requested_folder} ../${destination_folder_name} cd .. echo "Removing the tmp folder" -rm -rf ${mizu_test_files_tmp_folder} +rm -rf ${kubeshark_test_files_tmp_folder} diff --git a/tap/extensions/http/Makefile b/tap/extensions/http/Makefile index 9e4722029..28cb247e2 100644 --- a/tap/extensions/http/Makefile +++ b/tap/extensions/http/Makefile @@ -2,10 +2,10 @@ skipbin := $$(find bin -mindepth 1 -maxdepth 1) skipexpect := $$(find expect -mindepth 1 -maxdepth 1) test: test-pull-bin test-pull-expect - @MIZU_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic test-update: test-pull-bin - @MIZU_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic test-pull-bin: @[ "${skipbin}" ] && echo "Skipping downloading BINs" || ../get-folder-of-tests.sh bin/http bin diff --git a/tap/extensions/http/go.mod b/tap/extensions/http/go.mod index 9795d1d84..c9d5c58b7 100644 --- a/tap/extensions/http/go.mod +++ b/tap/extensions/http/go.mod @@ -1,24 +1,23 @@ -module github.com/up9inc/mizu/tap/extensions/http +module github.com/kubeshark/kubeshark/tap/extensions/http go 1.17 require ( - github.com/beevik/etree v1.1.0 github.com/google/martian v2.1.0+incompatible + github.com/kubeshark/kubeshark/tap/api v0.0.0 github.com/mertyildiran/gqlparser/v2 v2.4.6 github.com/stretchr/testify v1.7.0 - github.com/up9inc/mizu/tap/api v0.0.0 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd ) require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/up9inc/mizu/tap/dbgctl v0.0.0 // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../../api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../../api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../../dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../../dbgctl diff --git a/tap/extensions/http/go.sum b/tap/extensions/http/go.sum index e9937f66b..6c66c909e 100644 --- a/tap/extensions/http/go.sum +++ b/tap/extensions/http/go.sum @@ -1,6 +1,4 @@ github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= -github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/tap/extensions/http/handlers.go b/tap/extensions/http/handlers.go index 4560e4a5b..fa3efdacc 100644 --- a/tap/extensions/http/handlers.go +++ b/tap/extensions/http/handlers.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) func filterAndEmit(item *api.OutputChannelItem, emitter api.Emitter, options *api.TrafficFilteringOptions) { diff --git a/tap/extensions/http/helpers.go b/tap/extensions/http/helpers.go index 40f9c913a..d58174f1d 100644 --- a/tap/extensions/http/helpers.go +++ b/tap/extensions/http/helpers.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) func mapSliceRebuildAsMap(mapSlice []interface{}) (newMap map[string]interface{}) { diff --git a/tap/extensions/http/main.go b/tap/extensions/http/main.go index f871cd8ae..99663d044 100644 --- a/tap/extensions/http/main.go +++ b/tap/extensions/http/main.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) var http10protocol = api.Protocol{ @@ -22,7 +22,7 @@ var http10protocol = api.Protocol{ }, LongName: "Hypertext Transfer Protocol -- HTTP/1.0", Macro: "http", - BackgroundColor: "#205cf5", + BackgroundColor: "#326de6", ForegroundColor: "#ffffff", FontSize: 12, ReferenceLink: "https://datatracker.ietf.org/doc/html/rfc1945", @@ -38,7 +38,7 @@ var http11protocol = api.Protocol{ }, LongName: "Hypertext Transfer Protocol -- HTTP/1.1", Macro: "http", - BackgroundColor: "#205cf5", + BackgroundColor: "#326de6", ForegroundColor: "#ffffff", FontSize: 12, ReferenceLink: "https://datatracker.ietf.org/doc/html/rfc2616", diff --git a/tap/extensions/http/main_test.go b/tap/extensions/http/main_test.go index 7b2a0c8fd..30af39e5d 100644 --- a/tap/extensions/http/main_test.go +++ b/tap/extensions/http/main_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" + "github.com/kubeshark/kubeshark/tap/api" "github.com/stretchr/testify/assert" - "github.com/up9inc/mizu/tap/api" ) const ( diff --git a/tap/extensions/http/matcher.go b/tap/extensions/http/matcher.go index 6e48e35be..02f1f98f9 100644 --- a/tap/extensions/http/matcher.go +++ b/tap/extensions/http/matcher.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) // Key is {client_addr}_{client_port}_{dest_addr}_{dest_port}_{incremental_counter}_{proto_ident} diff --git a/tap/extensions/http/sensitive_data_cleaner.go b/tap/extensions/http/sensitive_data_cleaner.go index 0e8885f8e..f5ac9d399 100644 --- a/tap/extensions/http/sensitive_data_cleaner.go +++ b/tap/extensions/http/sensitive_data_cleaner.go @@ -4,7 +4,7 @@ import ( "net/http" "strings" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) const userAgent = "user-agent" diff --git a/tap/extensions/http/tcp_reader_mock_test.go b/tap/extensions/http/tcp_reader_mock_test.go index 87baf4293..8543a996e 100644 --- a/tap/extensions/http/tcp_reader_mock_test.go +++ b/tap/extensions/http/tcp_reader_mock_test.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpReader struct { diff --git a/tap/extensions/http/tcp_stream_mock_test.go b/tap/extensions/http/tcp_stream_mock_test.go index e644fad06..2bc5f5e02 100644 --- a/tap/extensions/http/tcp_stream_mock_test.go +++ b/tap/extensions/http/tcp_stream_mock_test.go @@ -3,7 +3,7 @@ package http import ( "sync" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpStream struct { diff --git a/tap/extensions/kafka/Makefile b/tap/extensions/kafka/Makefile index 2612d0826..1e0b126f2 100644 --- a/tap/extensions/kafka/Makefile +++ b/tap/extensions/kafka/Makefile @@ -2,10 +2,10 @@ skipbin := $$(find bin -mindepth 1 -maxdepth 1) skipexpect := $$(find expect -mindepth 1 -maxdepth 1) test: test-pull-bin test-pull-expect - @MIZU_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic test-update: test-pull-bin - @MIZU_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic test-pull-bin: @[ "${skipbin}" ] && echo "Skipping downloading BINs" || ../get-folder-of-tests.sh bin/kafka bin diff --git a/tap/extensions/kafka/go.mod b/tap/extensions/kafka/go.mod index fd17b0b76..cc5960af7 100644 --- a/tap/extensions/kafka/go.mod +++ b/tap/extensions/kafka/go.mod @@ -1,13 +1,13 @@ -module github.com/up9inc/mizu/tap/extensions/kafka +module github.com/kubeshark/kubeshark/tap/extensions/kafka go 1.17 require ( github.com/fatih/camelcase v1.0.0 + github.com/kubeshark/kubeshark/tap/api v0.0.0 github.com/ohler55/ojg v1.12.12 github.com/segmentio/kafka-go v0.4.27 github.com/stretchr/testify v1.6.1 - github.com/up9inc/mizu/tap/api v0.0.0 golang.org/x/text v0.3.0 ) @@ -15,12 +15,12 @@ require ( github.com/davecgh/go-spew v1.1.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/klauspost/compress v1.14.2 // indirect + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/up9inc/mizu/tap/dbgctl v0.0.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../../api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../../api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../../dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../../dbgctl diff --git a/tap/extensions/kafka/helpers.go b/tap/extensions/kafka/helpers.go index 353833320..b4dc04250 100644 --- a/tap/extensions/kafka/helpers.go +++ b/tap/extensions/kafka/helpers.go @@ -12,9 +12,9 @@ import ( "golang.org/x/text/language" "github.com/fatih/camelcase" + "github.com/kubeshark/kubeshark/tap/api" "github.com/ohler55/ojg/jp" "github.com/ohler55/ojg/oj" - "github.com/up9inc/mizu/tap/api" ) type KafkaPayload struct { diff --git a/tap/extensions/kafka/main.go b/tap/extensions/kafka/main.go index 4fe2160f7..f50928326 100644 --- a/tap/extensions/kafka/main.go +++ b/tap/extensions/kafka/main.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) var _protocol = api.Protocol{ diff --git a/tap/extensions/kafka/main_test.go b/tap/extensions/kafka/main_test.go index eda159cbb..00d216f1c 100644 --- a/tap/extensions/kafka/main_test.go +++ b/tap/extensions/kafka/main_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" + "github.com/kubeshark/kubeshark/tap/api" "github.com/stretchr/testify/assert" - "github.com/up9inc/mizu/tap/api" ) const ( diff --git a/tap/extensions/kafka/matcher.go b/tap/extensions/kafka/matcher.go index bc3f22e60..4460f7d00 100644 --- a/tap/extensions/kafka/matcher.go +++ b/tap/extensions/kafka/matcher.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type RequestResponsePair struct { diff --git a/tap/extensions/kafka/request.go b/tap/extensions/kafka/request.go index deb332296..a676041f9 100644 --- a/tap/extensions/kafka/request.go +++ b/tap/extensions/kafka/request.go @@ -6,7 +6,7 @@ import ( "reflect" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type Request struct { diff --git a/tap/extensions/kafka/response.go b/tap/extensions/kafka/response.go index 3fd13b948..6cda81a98 100644 --- a/tap/extensions/kafka/response.go +++ b/tap/extensions/kafka/response.go @@ -6,7 +6,7 @@ import ( "reflect" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type Response struct { diff --git a/tap/extensions/kafka/tcp_reader_mock_test.go b/tap/extensions/kafka/tcp_reader_mock_test.go index 9bcc5619b..3215c377d 100644 --- a/tap/extensions/kafka/tcp_reader_mock_test.go +++ b/tap/extensions/kafka/tcp_reader_mock_test.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpReader struct { diff --git a/tap/extensions/kafka/tcp_stream_mock_test.go b/tap/extensions/kafka/tcp_stream_mock_test.go index 8d6337327..143bfc30f 100644 --- a/tap/extensions/kafka/tcp_stream_mock_test.go +++ b/tap/extensions/kafka/tcp_stream_mock_test.go @@ -3,7 +3,7 @@ package kafka import ( "sync" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpStream struct { diff --git a/tap/extensions/redis/Makefile b/tap/extensions/redis/Makefile index d9bc54af1..2e102efb4 100644 --- a/tap/extensions/redis/Makefile +++ b/tap/extensions/redis/Makefile @@ -2,10 +2,10 @@ skipbin := $$(find bin -mindepth 1 -maxdepth 1) skipexpect := $$(find expect -mindepth 1 -maxdepth 1) test: test-pull-bin test-pull-expect - @MIZU_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 go test -v ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic test-update: test-pull-bin - @MIZU_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic + @KUBESHARK_TEST=1 TEST_UPDATE=1 go test -v ./... -coverpkg=./... -coverprofile=coverage.out -covermode=atomic test-pull-bin: @[ "${skipbin}" ] && echo "Skipping downloading BINs" || ../get-folder-of-tests.sh bin/redis bin diff --git a/tap/extensions/redis/go.mod b/tap/extensions/redis/go.mod index 9626057af..3de070d61 100644 --- a/tap/extensions/redis/go.mod +++ b/tap/extensions/redis/go.mod @@ -1,19 +1,19 @@ -module github.com/up9inc/mizu/tap/extensions/redis +module github.com/kubeshark/kubeshark/tap/extensions/redis go 1.17 require ( + github.com/kubeshark/kubeshark/tap/api v0.0.0 github.com/stretchr/testify v1.7.0 - github.com/up9inc/mizu/tap/api v0.0.0 ) require ( github.com/davecgh/go-spew v1.1.0 // indirect + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/up9inc/mizu/tap/dbgctl v0.0.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) -replace github.com/up9inc/mizu/tap/api v0.0.0 => ../../api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ../../api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ../../dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ../../dbgctl diff --git a/tap/extensions/redis/handlers.go b/tap/extensions/redis/handlers.go index 8cdd65759..4e651e02a 100644 --- a/tap/extensions/redis/handlers.go +++ b/tap/extensions/redis/handlers.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) func handleClientStream(progress *api.ReadProgress, capture api.Capture, tcpID *api.TcpID, counterPair *api.CounterPair, captureTime time.Time, emitter api.Emitter, request *RedisPacket, reqResMatcher *requestResponseMatcher) error { diff --git a/tap/extensions/redis/helpers.go b/tap/extensions/redis/helpers.go index 71a14b90b..0ab280598 100644 --- a/tap/extensions/redis/helpers.go +++ b/tap/extensions/redis/helpers.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type RedisPayload struct { diff --git a/tap/extensions/redis/main.go b/tap/extensions/redis/main.go index bda4fe04a..1bc169c3f 100644 --- a/tap/extensions/redis/main.go +++ b/tap/extensions/redis/main.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) var protocol = api.Protocol{ diff --git a/tap/extensions/redis/main_test.go b/tap/extensions/redis/main_test.go index 08f1cab6d..392be51cd 100644 --- a/tap/extensions/redis/main_test.go +++ b/tap/extensions/redis/main_test.go @@ -15,8 +15,8 @@ import ( "testing" "time" + "github.com/kubeshark/kubeshark/tap/api" "github.com/stretchr/testify/assert" - "github.com/up9inc/mizu/tap/api" ) const ( diff --git a/tap/extensions/redis/matcher.go b/tap/extensions/redis/matcher.go index 7a06458c9..b8b7e4c47 100644 --- a/tap/extensions/redis/matcher.go +++ b/tap/extensions/redis/matcher.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) // Key is `{src_ip}_{dst_ip}_{src_ip}_{src_port}_{incremental_counter}` diff --git a/tap/extensions/redis/tcp_reader_mock_test.go b/tap/extensions/redis/tcp_reader_mock_test.go index 6b7f3618e..5c815bec9 100644 --- a/tap/extensions/redis/tcp_reader_mock_test.go +++ b/tap/extensions/redis/tcp_reader_mock_test.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpReader struct { diff --git a/tap/extensions/redis/tcp_stream_mock_test.go b/tap/extensions/redis/tcp_stream_mock_test.go index e15656b7f..f2debe690 100644 --- a/tap/extensions/redis/tcp_stream_mock_test.go +++ b/tap/extensions/redis/tcp_stream_mock_test.go @@ -3,7 +3,7 @@ package redis import ( "sync" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpStream struct { diff --git a/tap/go.mod b/tap/go.mod index fe9aecd57..9924ad281 100644 --- a/tap/go.mod +++ b/tap/go.mod @@ -1,4 +1,4 @@ -module github.com/up9inc/mizu/tap +module github.com/kubeshark/kubeshark/tap go 1.17 @@ -9,12 +9,12 @@ require ( github.com/google/gopacket v1.1.19 github.com/hashicorp/golang-lru v0.5.4 github.com/knightsc/gapstone v0.0.0-20191231144527-6fa5afaf11a9 + github.com/kubeshark/kubeshark/logger v0.0.0 + github.com/kubeshark/kubeshark/tap/api v0.0.0 + github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 github.com/moby/moby v20.10.17+incompatible github.com/shirou/gopsutil v3.21.11+incompatible github.com/struCoder/pidusage v0.2.1 - github.com/up9inc/mizu/logger v0.0.0 - github.com/up9inc/mizu/tap/api v0.0.0 - github.com/up9inc/mizu/tap/dbgctl v0.0.0 github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd k8s.io/api v0.23.3 @@ -47,8 +47,8 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/up9inc/mizu/logger v0.0.0 => ../logger +replace github.com/kubeshark/kubeshark/logger v0.0.0 => ../logger -replace github.com/up9inc/mizu/tap/api v0.0.0 => ./api +replace github.com/kubeshark/kubeshark/tap/api v0.0.0 => ./api -replace github.com/up9inc/mizu/tap/dbgctl v0.0.0 => ./dbgctl +replace github.com/kubeshark/kubeshark/tap/dbgctl v0.0.0 => ./dbgctl diff --git a/tap/net_utils.go b/tap/net_utils.go index 04fe7bce6..d9a999818 100644 --- a/tap/net_utils.go +++ b/tap/net_utils.go @@ -4,7 +4,7 @@ import ( "net" "strings" - "github.com/up9inc/mizu/tap/diagnose" + "github.com/kubeshark/kubeshark/tap/diagnose" ) var privateIPBlocks []*net.IPNet diff --git a/tap/passive_tapper.go b/tap/passive_tapper.go index 1add57fd5..5d58cd9d2 100644 --- a/tap/passive_tapper.go +++ b/tap/passive_tapper.go @@ -18,13 +18,13 @@ import ( "strings" "time" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/diagnose" + "github.com/kubeshark/kubeshark/tap/source" + "github.com/kubeshark/kubeshark/tap/tlstapper" "github.com/shirou/gopsutil/cpu" "github.com/struCoder/pidusage" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/diagnose" - "github.com/up9inc/mizu/tap/source" - "github.com/up9inc/mizu/tap/tlstapper" v1 "k8s.io/api/core/v1" ) @@ -111,7 +111,7 @@ func UpdateTapTargets(newTapTargets []v1.Pod) { packetSourceManager.UpdatePods(tapTargets, !*nodefrag, mainPacketInputChan) - if tlsTapperInstance != nil && os.Getenv("MIZU_GLOBAL_GOLANG_PID") == "" { + if tlsTapperInstance != nil && os.Getenv("KUBESHARK_GLOBAL_GOLANG_PID") == "" { if err := tlstapper.UpdateTapTargets(tlsTapperInstance, &tapTargets, *procfs); err != nil { tlstapper.LogError(err) success = false @@ -294,8 +294,8 @@ func startTlsTapper(extension *api.Extension, outputItems chan *api.OutputChanne // A quick way to instrument libssl.so without PID filtering - used for debuging and troubleshooting // - if os.Getenv("MIZU_GLOBAL_SSL_LIBRARY") != "" { - if err := tls.GlobalSSLLibTap(os.Getenv("MIZU_GLOBAL_SSL_LIBRARY")); err != nil { + if os.Getenv("KUBESHARK_GLOBAL_SSL_LIBRARY") != "" { + if err := tls.GlobalSSLLibTap(os.Getenv("KUBESHARK_GLOBAL_SSL_LIBRARY")); err != nil { tlstapper.LogError(err) return nil } @@ -303,8 +303,8 @@ func startTlsTapper(extension *api.Extension, outputItems chan *api.OutputChanne // A quick way to instrument Go `crypto/tls` without PID filtering - used for debuging and troubleshooting // - if os.Getenv("MIZU_GLOBAL_GOLANG_PID") != "" { - if err := tls.GlobalGoTap(*procfs, os.Getenv("MIZU_GLOBAL_GOLANG_PID")); err != nil { + if os.Getenv("KUBESHARK_GLOBAL_GOLANG_PID") != "" { + if err := tls.GlobalGoTap(*procfs, os.Getenv("KUBESHARK_GLOBAL_GOLANG_PID")); err != nil { tlstapper.LogError(err) return nil } diff --git a/tap/settings.go b/tap/settings.go index 32b0e988f..533167321 100644 --- a/tap/settings.go +++ b/tap/settings.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) const ( diff --git a/tap/source/discoverer_util.go b/tap/source/discoverer_util.go index 04f757ffe..5221e6779 100644 --- a/tap/source/discoverer_util.go +++ b/tap/source/discoverer_util.go @@ -5,7 +5,7 @@ import ( "regexp" "strings" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) var numberRegex = regexp.MustCompile("[0-9]+") diff --git a/tap/source/envoy_discoverer.go b/tap/source/envoy_discoverer.go index 17a452b0b..69ad6749b 100644 --- a/tap/source/envoy_discoverer.go +++ b/tap/source/envoy_discoverer.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" v1 "k8s.io/api/core/v1" ) diff --git a/tap/source/linkerd_discoverer.go b/tap/source/linkerd_discoverer.go index cd9e55a29..68ba93de0 100644 --- a/tap/source/linkerd_discoverer.go +++ b/tap/source/linkerd_discoverer.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" v1 "k8s.io/api/core/v1" ) diff --git a/tap/source/netns_packet_source.go b/tap/source/netns_packet_source.go index c290e20d8..37c2be08a 100644 --- a/tap/source/netns_packet_source.go +++ b/tap/source/netns_packet_source.go @@ -4,8 +4,8 @@ import ( "fmt" "runtime" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" "github.com/vishvananda/netns" ) diff --git a/tap/source/packet_source_manager.go b/tap/source/packet_source_manager.go index 2274aec04..7f74fbfe5 100644 --- a/tap/source/packet_source_manager.go +++ b/tap/source/packet_source_manager.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" v1 "k8s.io/api/core/v1" ) diff --git a/tap/source/tcp_packet_source.go b/tap/source/tcp_packet_source.go index d24b53354..65160abd2 100644 --- a/tap/source/tcp_packet_source.go +++ b/tap/source/tcp_packet_source.go @@ -7,10 +7,10 @@ import ( "github.com/google/gopacket" "github.com/google/gopacket/ip4defrag" "github.com/google/gopacket/layers" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/dbgctl" - "github.com/up9inc/mizu/tap/diagnose" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/dbgctl" + "github.com/kubeshark/kubeshark/tap/diagnose" ) type Handle interface { @@ -120,7 +120,7 @@ func (source *tcpPacketSource) Stats() (packetsReceived uint, packetsDropped uin } func (source *tcpPacketSource) readPackets(ipdefrag bool, packets chan<- TcpPacketInfo) { - if dbgctl.MizuTapperDisablePcap { + if dbgctl.KubesharkTapperDisablePcap { return } logger.Log.Infof("Start reading packets from %v", source.name) diff --git a/tap/tcp_assembler.go b/tap/tcp_assembler.go index c7b2b4901..6d20f6ea3 100644 --- a/tap/tcp_assembler.go +++ b/tap/tcp_assembler.go @@ -11,11 +11,11 @@ import ( "github.com/google/gopacket/layers" "github.com/google/gopacket/reassembly" "github.com/hashicorp/golang-lru/simplelru" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/dbgctl" - "github.com/up9inc/mizu/tap/diagnose" - "github.com/up9inc/mizu/tap/source" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/dbgctl" + "github.com/kubeshark/kubeshark/tap/diagnose" + "github.com/kubeshark/kubeshark/tap/source" ) const ( @@ -179,7 +179,7 @@ func (a *tcpAssembler) processTcpPacket(origin api.Capture, packet gopacket.Pack Origin: origin, } diagnose.InternalStats.Totalsz += len(tcp.Payload) - if !dbgctl.MizuTapperDisableTcpReassembly { + if !dbgctl.KubesharkTapperDisableTcpReassembly { a.AssembleWithContext(packet.NetworkLayer().NetworkFlow(), tcp, &c) } } diff --git a/tap/tcp_reader.go b/tap/tcp_reader.go index 86d381bce..950221154 100644 --- a/tap/tcp_reader.go +++ b/tap/tcp_reader.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/dbgctl" + "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/dbgctl" ) /* TcpReader gets reads from a channel of bytes of tcp payload, and parses it into requests and responses. @@ -50,7 +50,7 @@ func NewTcpReader(ident string, tcpId *api.TcpID, parent *tcpStream, isClient bo func (reader *tcpReader) run(options *api.TrafficFilteringOptions, wg *sync.WaitGroup) { defer wg.Done() - if dbgctl.MizuTapperDisableDissectors { + if dbgctl.KubesharkTapperDisableDissectors { b := bufio.NewReader(reader) _, _ = io.ReadAll(b) return diff --git a/tap/tcp_reader_data_msg.go b/tap/tcp_reader_data_msg.go index 24c611754..995c998f4 100644 --- a/tap/tcp_reader_data_msg.go +++ b/tap/tcp_reader_data_msg.go @@ -3,7 +3,7 @@ package tap import ( "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tcpReaderDataMsg struct { diff --git a/tap/tcp_reassembly_stream.go b/tap/tcp_reassembly_stream.go index cf32f841b..052253d00 100644 --- a/tap/tcp_reassembly_stream.go +++ b/tap/tcp_reassembly_stream.go @@ -6,7 +6,7 @@ import ( "github.com/google/gopacket" "github.com/google/gopacket/layers" // pulls in all layers decoders "github.com/google/gopacket/reassembly" - "github.com/up9inc/mizu/tap/diagnose" + "github.com/kubeshark/kubeshark/tap/diagnose" ) type tcpReassemblyStream struct { diff --git a/tap/tcp_stream.go b/tap/tcp_stream.go index b9ebca2b7..559416417 100644 --- a/tap/tcp_stream.go +++ b/tap/tcp_stream.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/dbgctl" + "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/dbgctl" ) type tcpStreamCallbacks interface { @@ -102,7 +102,7 @@ func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher { } func (t *tcpStream) GetIsTapTarget() bool { - if dbgctl.MizuTapperDisableTcpStream { + if dbgctl.KubesharkTapperDisableTcpStream { return false } return t.isTapTarget diff --git a/tap/tcp_stream_factory.go b/tap/tcp_stream_factory.go index c3effcfc4..2d9ff2c4c 100644 --- a/tap/tcp_stream_factory.go +++ b/tap/tcp_stream_factory.go @@ -4,8 +4,8 @@ import ( "fmt" "sync" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" v1 "k8s.io/api/core/v1" "github.com/google/gopacket" diff --git a/tap/tcp_streams_map.go b/tap/tcp_streams_map.go index a4285b402..a2f312f3c 100644 --- a/tap/tcp_streams_map.go +++ b/tap/tcp_streams_map.go @@ -6,9 +6,9 @@ import ( "sync" "time" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" - "github.com/up9inc/mizu/tap/diagnose" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" + "github.com/kubeshark/kubeshark/tap/diagnose" ) type tcpStreamMap struct { diff --git a/tap/tlstapper/bpf-builder/Dockerfile b/tap/tlstapper/bpf-builder/Dockerfile index d16b41a2d..4f7945788 100644 --- a/tap/tlstapper/bpf-builder/Dockerfile +++ b/tap/tlstapper/bpf-builder/Dockerfile @@ -2,4 +2,4 @@ FROM golang:1.17-alpine RUN apk --no-cache update && apk --no-cache add clang llvm libbpf-dev linux-headers -WORKDIR /mizu +WORKDIR /kubeshark diff --git a/tap/tlstapper/bpf-builder/build.sh b/tap/tlstapper/bpf-builder/build.sh index 9a2886905..1f5ba0856 100755 --- a/tap/tlstapper/bpf-builder/build.sh +++ b/tap/tlstapper/bpf-builder/build.sh @@ -2,9 +2,9 @@ pushd "$(dirname "$0")" || exit 1 -MIZU_HOME=$(realpath ../../../) +KUBESHARK_HOME=$(realpath ../../../) -docker build -t mizu-ebpf-builder . || exit 1 +docker build -t kubeshark-ebpf-builder . || exit 1 BPF_TARGET=amd64 BPF_CFLAGS="-O2 -g -D__TARGET_ARCH_x86" @@ -15,10 +15,10 @@ if [[ $ARCH == "aarch64" || $ARCH == "arm64" ]]; then fi docker run --rm \ - --name mizu-ebpf-builder \ - -v $MIZU_HOME:/mizu \ + --name kubeshark-ebpf-builder \ + -v $KUBESHARK_HOME:/kubeshark \ -v $(go env GOPATH):/root/go \ - mizu-ebpf-builder \ + kubeshark-ebpf-builder \ sh -c " BPF_TARGET=\"$BPF_TARGET\" BPF_CFLAGS=\"$BPF_CFLAGS\" go generate tap/tlstapper/tls_tapper.go chown $(id -u):$(id -g) tap/tlstapper/tlstapper*_bpf* diff --git a/tap/tlstapper/bpf/common.c b/tap/tlstapper/bpf/common.c index 540fdc9ec..247a1cab0 100644 --- a/tap/tlstapper/bpf/common.c +++ b/tap/tlstapper/bpf/common.c @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #include "include/headers.h" diff --git a/tap/tlstapper/bpf/fd_to_address_tracepoints.c b/tap/tlstapper/bpf/fd_to_address_tracepoints.c index e3b9a546b..acf6587f9 100644 --- a/tap/tlstapper/bpf/fd_to_address_tracepoints.c +++ b/tap/tlstapper/bpf/fd_to_address_tracepoints.c @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #include "include/headers.h" diff --git a/tap/tlstapper/bpf/fd_tracepoints.c b/tap/tlstapper/bpf/fd_tracepoints.c index 28b7dbdaa..55f648de0 100644 --- a/tap/tlstapper/bpf/fd_tracepoints.c +++ b/tap/tlstapper/bpf/fd_tracepoints.c @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #include "include/headers.h" diff --git a/tap/tlstapper/bpf/go_uprobes.c b/tap/tlstapper/bpf/go_uprobes.c index 07396a930..a227f7778 100644 --- a/tap/tlstapper/bpf/go_uprobes.c +++ b/tap/tlstapper/bpf/go_uprobes.c @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark --- diff --git a/tap/tlstapper/bpf/include/common.h b/tap/tlstapper/bpf/include/common.h index a185a55bd..03a55bf50 100644 --- a/tap/tlstapper/bpf/include/common.h +++ b/tap/tlstapper/bpf/include/common.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __COMMON__ diff --git a/tap/tlstapper/bpf/include/go_abi_0.h b/tap/tlstapper/bpf/include/go_abi_0.h index 916dd316d..475965c76 100644 --- a/tap/tlstapper/bpf/include/go_abi_0.h +++ b/tap/tlstapper/bpf/include/go_abi_0.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __GO_ABI_0__ diff --git a/tap/tlstapper/bpf/include/go_abi_internal.h b/tap/tlstapper/bpf/include/go_abi_internal.h index b38572b76..d7f72f9ef 100644 --- a/tap/tlstapper/bpf/include/go_abi_internal.h +++ b/tap/tlstapper/bpf/include/go_abi_internal.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __GO_ABI_INTERNAL__ diff --git a/tap/tlstapper/bpf/include/go_types.h b/tap/tlstapper/bpf/include/go_types.h index c865448c6..866312865 100644 --- a/tap/tlstapper/bpf/include/go_types.h +++ b/tap/tlstapper/bpf/include/go_types.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __GO_TYPES__ diff --git a/tap/tlstapper/bpf/include/headers.h b/tap/tlstapper/bpf/include/headers.h index a011b9236..caaa7fe10 100644 --- a/tap/tlstapper/bpf/include/headers.h +++ b/tap/tlstapper/bpf/include/headers.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __HEADERS__ diff --git a/tap/tlstapper/bpf/include/log.h b/tap/tlstapper/bpf/include/log.h index 9d501024e..5b7a92273 100644 --- a/tap/tlstapper/bpf/include/log.h +++ b/tap/tlstapper/bpf/include/log.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __LOG__ diff --git a/tap/tlstapper/bpf/include/logger_messages.h b/tap/tlstapper/bpf/include/logger_messages.h index 51c083c15..0cba21ce2 100644 --- a/tap/tlstapper/bpf/include/logger_messages.h +++ b/tap/tlstapper/bpf/include/logger_messages.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __LOG_MESSAGES__ diff --git a/tap/tlstapper/bpf/include/maps.h b/tap/tlstapper/bpf/include/maps.h index b06d5d7bc..a1f2d60bb 100644 --- a/tap/tlstapper/bpf/include/maps.h +++ b/tap/tlstapper/bpf/include/maps.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __MAPS__ diff --git a/tap/tlstapper/bpf/include/pids.h b/tap/tlstapper/bpf/include/pids.h index ecc0c2427..bb7d2ff10 100644 --- a/tap/tlstapper/bpf/include/pids.h +++ b/tap/tlstapper/bpf/include/pids.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __PIDS__ diff --git a/tap/tlstapper/bpf/include/target_arch.h b/tap/tlstapper/bpf/include/target_arch.h index 9c4a5cad4..76b8e7452 100644 --- a/tap/tlstapper/bpf/include/target_arch.h +++ b/tap/tlstapper/bpf/include/target_arch.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __TARGET_ARCH__ diff --git a/tap/tlstapper/bpf/include/util.h b/tap/tlstapper/bpf/include/util.h index 92e5d7b41..9ee25e115 100644 --- a/tap/tlstapper/bpf/include/util.h +++ b/tap/tlstapper/bpf/include/util.h @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #ifndef __UTIL__ diff --git a/tap/tlstapper/bpf/openssl_uprobes.c b/tap/tlstapper/bpf/openssl_uprobes.c index ecd595292..215e47bde 100644 --- a/tap/tlstapper/bpf/openssl_uprobes.c +++ b/tap/tlstapper/bpf/openssl_uprobes.c @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #include "include/headers.h" diff --git a/tap/tlstapper/bpf/tls_tapper.c b/tap/tlstapper/bpf/tls_tapper.c index 6bfd62fbc..b557ae93c 100644 --- a/tap/tlstapper/bpf/tls_tapper.c +++ b/tap/tlstapper/bpf/tls_tapper.c @@ -1,7 +1,7 @@ /* Note: This file is licenced differently from the rest of the project SPDX-License-Identifier: GPL-2.0 -Copyright (C) UP9 Inc. +Copyright (C) Kubeshark */ #include "include/headers.h" diff --git a/tap/tlstapper/bpf_logger.go b/tap/tlstapper/bpf_logger.go index 1cb1da48a..f8836f997 100644 --- a/tap/tlstapper/bpf_logger.go +++ b/tap/tlstapper/bpf_logger.go @@ -7,7 +7,7 @@ import ( "github.com/cilium/ebpf/perf" "github.com/go-errors/errors" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) const logPrefix = "[bpf] " diff --git a/tap/tlstapper/go_offsets.go b/tap/tlstapper/go_offsets.go index c69d2a42c..4962ee9ec 100644 --- a/tap/tlstapper/go_offsets.go +++ b/tap/tlstapper/go_offsets.go @@ -12,7 +12,7 @@ import ( "github.com/Masterminds/semver" "github.com/cilium/ebpf/link" "github.com/knightsc/gapstone" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) type goAbi int diff --git a/tap/tlstapper/ssllib_finder.go b/tap/tlstapper/ssllib_finder.go index 3be5e18e6..5359f2e8f 100644 --- a/tap/tlstapper/ssllib_finder.go +++ b/tap/tlstapper/ssllib_finder.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) func findSsllib(procfs string, pid uint32) (string, error) { diff --git a/tap/tlstapper/ssllib_offsets.go b/tap/tlstapper/ssllib_offsets.go index cae8b4734..bc40397c1 100644 --- a/tap/tlstapper/ssllib_offsets.go +++ b/tap/tlstapper/ssllib_offsets.go @@ -4,7 +4,7 @@ import ( "debug/elf" "github.com/go-errors/errors" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" ) type sslOffsets struct { diff --git a/tap/tlstapper/tls_emitter.go b/tap/tlstapper/tls_emitter.go index 51139870e..c174d5329 100644 --- a/tap/tlstapper/tls_emitter.go +++ b/tap/tlstapper/tls_emitter.go @@ -1,6 +1,6 @@ package tlstapper -import "github.com/up9inc/mizu/tap/api" +import "github.com/kubeshark/kubeshark/tap/api" type tlsEmitter struct { delegate api.Emitter diff --git a/tap/tlstapper/tls_poller.go b/tap/tlstapper/tls_poller.go index 42463e82a..0b72f93b8 100644 --- a/tap/tlstapper/tls_poller.go +++ b/tap/tlstapper/tls_poller.go @@ -16,8 +16,8 @@ import ( "github.com/cilium/ebpf/perf" "github.com/go-errors/errors" "github.com/hashicorp/golang-lru/simplelru" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" ) const ( @@ -146,7 +146,7 @@ func (p *tlsPoller) handleTlsChunk(chunk *tlsTapperTlsChunk, extension *api.Exte reader.newChunk(chunk) - if os.Getenv("MIZU_VERBOSE_TLS_TAPPER") == "true" { + if os.Getenv("KUBESHARK_VERBOSE_TLS_TAPPER") == "true" { p.logTls(chunk, key, reader) } diff --git a/tap/tlstapper/tls_process_discoverer.go b/tap/tlstapper/tls_process_discoverer.go index b225c4f1d..465f02739 100644 --- a/tap/tlstapper/tls_process_discoverer.go +++ b/tap/tlstapper/tls_process_discoverer.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/go-errors/errors" - "github.com/up9inc/mizu/logger" + "github.com/kubeshark/kubeshark/logger" v1 "k8s.io/api/core/v1" ) diff --git a/tap/tlstapper/tls_reader.go b/tap/tlstapper/tls_reader.go index 88c65ee56..29cb6a2f2 100644 --- a/tap/tlstapper/tls_reader.go +++ b/tap/tlstapper/tls_reader.go @@ -4,7 +4,7 @@ import ( "io" "time" - "github.com/up9inc/mizu/tap/api" + "github.com/kubeshark/kubeshark/tap/api" ) type tlsReader struct { diff --git a/tap/tlstapper/tls_stream.go b/tap/tlstapper/tls_stream.go index d0077ba59..cff768037 100644 --- a/tap/tlstapper/tls_stream.go +++ b/tap/tlstapper/tls_stream.go @@ -1,6 +1,6 @@ package tlstapper -import "github.com/up9inc/mizu/tap/api" +import "github.com/kubeshark/kubeshark/tap/api" type tlsStream struct { reader *tlsReader diff --git a/tap/tlstapper/tls_tapper.go b/tap/tlstapper/tls_tapper.go index 5265de253..ea4d15043 100644 --- a/tap/tlstapper/tls_tapper.go +++ b/tap/tlstapper/tls_tapper.go @@ -6,9 +6,9 @@ import ( "github.com/cilium/ebpf/rlimit" "github.com/go-errors/errors" + "github.com/kubeshark/kubeshark/logger" + "github.com/kubeshark/kubeshark/tap/api" "github.com/moby/moby/pkg/parsers/kernel" - "github.com/up9inc/mizu/logger" - "github.com/up9inc/mizu/tap/api" ) const GlobalTapPid = 0 diff --git a/ui-common/README.md b/ui-common/README.md index 888341a8c..401998bb2 100644 --- a/ui-common/README.md +++ b/ui-common/README.md @@ -1,4 +1,4 @@ -# mizu-common +# kubeshark-common > Made with create-react-library @@ -7,7 +7,7 @@ ## Install ```bash -npm install --save @up9/mizu-common +npm install --save @up9/kubeshark-common ``` ## Usage @@ -15,8 +15,8 @@ npm install --save @up9/mizu-common ```tsx import React, { Component } from 'react' -import MyComponent from 'l@up9/mizu-common' -import '@up9/mizu-common/dist/index.css' +import MyComponent from 'l@up9/kubeshark-common' +import '@up9/kubeshark-common/dist/index.css' class Example extends Component { render() { diff --git a/ui-common/package-lock.json b/ui-common/package-lock.json index 96747947c..aa36b8264 100644 --- a/ui-common/package-lock.json +++ b/ui-common/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@up9/mizu-common", + "name": "@up9/kubeshark-common", "version": "0.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@up9/mizu-common", + "name": "@up9/kubeshark-common", "version": "0.0.0", "license": "MIT", "dependencies": { diff --git a/ui-common/package.json b/ui-common/package.json index 5ef6d4b55..aa0ceb3b2 100644 --- a/ui-common/package.json +++ b/ui-common/package.json @@ -1,10 +1,10 @@ { - "name": "@up9/mizu-common", + "name": "@up9/kubeshark-common", "version": "0.0.0", "description": "Made with create-react-library", "author": "", "license": "MIT", - "repository": "/mizu-common", + "repository": "/kubeshark-common", "main": "dist/index.js", "module": "dist/index.modern.js", "source": "src/index.tsx", diff --git a/ui-common/src/components/Filters/Filters.tsx b/ui-common/src/components/Filters/Filters.tsx index 689f7c653..bcb6ca616 100644 --- a/ui-common/src/components/Filters/Filters.tsx +++ b/ui-common/src/components/Filters/Filters.tsx @@ -85,7 +85,7 @@ export const CodeEditorWrap: FC = ({ query, onQueryChange, valid return onQueryChange(event.target.value)} padding={8} style={{ @@ -187,7 +187,7 @@ export const QueryForm: React.FC = ({ validateQuery, reopenConne Filtering Guide (Cheatsheet) -

Mizu has a rich filtering syntax that let's you query the results both flexibly and efficiently.

+

Kubeshark has a rich filtering syntax that let's you query the results both flexibly and efficiently.

Here are some examples that you can try;

@@ -244,7 +244,7 @@ export const QueryForm: React.FC = ({ validateQuery, reopenConne - Since Mizu supports various protocols like gRPC, AMQP, Kafka and Redis. It's possible to write complex queries that match multiple protocols like this: + Since Kubeshark supports various protocols like gRPC, AMQP, Kafka and Redis. It's possible to write complex queries that match multiple protocols like this: = ({ validateQuery, reopenConne

- *The filtering functionality is provided through Basenine database server. Please refer to BFL Syntax Reference for more information. + *Please refer to KFL Syntax Reference for more information. diff --git a/ui-common/src/components/UI/InformationIcon/InformationIcon.tsx b/ui-common/src/components/UI/InformationIcon/InformationIcon.tsx index bcb5d6dca..8cb831503 100644 --- a/ui-common/src/components/UI/InformationIcon/InformationIcon.tsx +++ b/ui-common/src/components/UI/InformationIcon/InformationIcon.tsx @@ -1,7 +1,7 @@ import React from "react"; import styles from "./InformationIcon.module.sass" -const DEFUALT_LINK = "https://getmizu.io/docs" +const DEFUALT_LINK = "https://docs.kubeshark.co" interface LinkProps { link?: string, diff --git a/ui-common/src/components/modals/ReplayRequestModal/ReplayRequestModal.tsx b/ui-common/src/components/modals/ReplayRequestModal/ReplayRequestModal.tsx index f4916893c..c1864f28a 100644 --- a/ui-common/src/components/modals/ReplayRequestModal/ReplayRequestModal.tsx +++ b/ui-common/src/components/modals/ReplayRequestModal/ReplayRequestModal.tsx @@ -191,7 +191,7 @@ const ReplayRequestModal: React.FC = ({ isOpen, onClose innerComponent =
setRequestData({ ...requestDataModel, headers: headers })} key={"Header"} valuePlaceholder="New Headers Value" keyPlaceholder="New Headers Key" />
- * X-Mizu Header added to requests + * X-Kubeshark Header added to requests
break; case RequestTabs.Body: diff --git a/ui-common/src/components/modals/ServiceMapModal/ServiceMapModal.tsx b/ui-common/src/components/modals/ServiceMapModal/ServiceMapModal.tsx index a96fd28dd..f7adc25c5 100644 --- a/ui-common/src/components/modals/ServiceMapModal/ServiceMapModal.tsx +++ b/ui-common/src/components/modals/ServiceMapModal/ServiceMapModal.tsx @@ -86,7 +86,7 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos newGraphData.edges = serviceMapData.edges.map(mapEdgesDatatoGraph) setGraphData(newGraphData) } catch (ex) { - toast.error("An error occurred while loading Mizu Service Map, see console for mode details", { containerId: TOAST_CONTAINER_ID }); + toast.error("An error occurred while loading Kubeshark Service Map, see console for mode details", { containerId: TOAST_CONTAINER_ID }); console.error(ex); } finally { setIsLoading(false) diff --git a/ui-common/src/helpers/commonStyle.ts b/ui-common/src/helpers/commonStyle.ts index 538f9085b..1291b35a6 100644 --- a/ui-common/src/helpers/commonStyle.ts +++ b/ui-common/src/helpers/commonStyle.ts @@ -3,14 +3,14 @@ import makeStyles from '@mui/styles/makeStyles'; // @ts-ignore export const useCommonStyles = makeStyles(() => ({ button: { - backgroundColor: "#205cf5", + backgroundColor: "#326de6", color: "white", fontWeight: "600 !important", fontSize: 12, padding: "9px 12px", borderRadius: "6px ! important", "&:hover": { - backgroundColor: "#205cf5", + backgroundColor: "#326de6", }, "&:disabled": { backgroundColor: "rgba(0, 0, 0, 0.26)" @@ -18,11 +18,11 @@ export const useCommonStyles = makeStyles(() => ({ }, outlinedButton: { backgroundColor: "transparent", - color: "#205cf5", + color: "#326de6", fontWeight: "600 !important", fontSize: 12, padding: "8px 12px", - border: "1px #205cf5 solid", + border: "1px #326de6 solid", borderRadius: "6px ! important", "&:hover": { backgroundColor: "transparent", @@ -30,9 +30,9 @@ export const useCommonStyles = makeStyles(() => ({ }, clickedButton: { color: "white", - backgroundColor: "#205cf5", + backgroundColor: "#326de6", "&:hover": { - backgroundColor: "#205cf5", + backgroundColor: "#326de6", }, }, imagedButton: { diff --git a/ui-common/src/variables.module.scss b/ui-common/src/variables.module.scss index d777bf9e3..5fb40996a 100644 --- a/ui-common/src/variables.module.scss +++ b/ui-common/src/variables.module.scss @@ -3,7 +3,7 @@ $header-background-color: #F7F9FC; $data-background-color: #E9EBF8; $font-color: #0C0B1A; $secondary-font-color: rgba(0,0,0,0.5); -$blue-color: #205CF5; +$blue-color: #326de6; $light-blue-color: #BCCEFD; $success-color: #27AE60; $failure-color: #EB5757; diff --git a/ui/README.md b/ui/README.md index 49adf485f..c9856add0 100644 --- a/ui/README.md +++ b/ui/README.md @@ -1,2 +1,2 @@ -# mizu UI +# kubeshark UI web app traffic viewer diff --git a/ui/package-lock.json b/ui/package-lock.json index ddc05fd1c..f0ad978d7 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,11 +1,11 @@ { - "name": "mizu-ui", + "name": "kubeshark-ui", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "mizu-ui", + "name": "kubeshark-ui", "version": "0.1.0", "dependencies": { "@craco/craco": "^6.4.3", @@ -18,7 +18,7 @@ "@types/jest": "^26.0.24", "@types/node": "^12.20.54", "@uiw/react-textarea-code-editor": "^1.6.0", - "@up9/mizu-common": "file:../ui-common", + "@up9/kubeshark-common": "file:../ui-common", "axios": "^0.27.2", "core-js": "^3.22.7", "craco-babel-loader": "^1.0.3", @@ -57,7 +57,7 @@ } }, "../ui-common": { - "name": "@up9/mizu-common", + "name": "@up9/kubeshark-common", "version": "0.0.0", "license": "MIT", "dependencies": { @@ -36679,7 +36679,7 @@ "node": ">=6.9.0" } }, - "node_modules/@up9/mizu-common": { + "node_modules/@up9/kubeshark-common": { "resolved": "../ui-common", "link": true }, @@ -62393,7 +62393,7 @@ } } }, - "@up9/mizu-common": { + "@up9/kubeshark-common": { "version": "file:../ui-common", "requires": { "@craco/craco": "^6.4.3", diff --git a/ui/package.json b/ui/package.json index b8c35d5ff..ed4d34b24 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,5 +1,5 @@ { - "name": "mizu-ui", + "name": "kubeshark-ui", "version": "0.1.0", "private": true, "dependencies": { @@ -13,7 +13,7 @@ "@types/jest": "^26.0.24", "@types/node": "^12.20.54", "@uiw/react-textarea-code-editor": "^1.6.0", - "@up9/mizu-common": "file:up9-mizu-common-0.0.0.tgz", + "@up9/kubeshark-common": "file:up9-kubeshark-common-0.0.0.tgz", "axios": "^0.27.2", "core-js": "^3.22.7", "craco-babel-loader": "^1.0.3", diff --git a/ui/public/fav.svg b/ui/public/fav.svg deleted file mode 100644 index f30e7c5ee..000000000 --- a/ui/public/fav.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/ui/public/favicon.svg b/ui/public/favicon.svg new file mode 100644 index 000000000..cbd7fadcf --- /dev/null +++ b/ui/public/favicon.svg @@ -0,0 +1,62 @@ + + + + + + + + + diff --git a/ui/public/index.html b/ui/public/index.html index 49bc2b501..a2b686970 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -2,7 +2,7 @@ - + - MIZU + + Kubeshark