diff --git a/examples/build-multi-stage/.devcontainer.json b/examples/build-multi-stage/.devcontainer.json deleted file mode 100644 index dd7a81a02..000000000 --- a/examples/build-multi-stage/.devcontainer.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "My dev env", - "build": { - "context": ".", - "dockerfile": "./Dockerfile" - }, - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/node:1": { - "installYarnUsingApt": true, - "version": "lts", - "nvmVersion": "latest" - } - } -} diff --git a/examples/build-multi-stage/Dockerfile b/examples/build-multi-stage/Dockerfile deleted file mode 100644 index 27192aa86..000000000 --- a/examples/build-multi-stage/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM ghcr.io/devsy-org/test-images/go:1 AS go - -ARG TARGETOS -ARG TARGETARCH - -# Install Node.js -RUN \ - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get update \ - && apt-get install -y --no-install-recommends nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Set environment variables for Rust -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.69.0 - -# Install Protobuf compiler -RUN \ - apt-get update \ - && apt-get install -y --no-install-recommends protobuf-compiler \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -FROM go AS final - -COPY app /app - -RUN echo hello diff --git a/examples/build-multi-stage/README.md b/examples/build-multi-stage/README.md deleted file mode 100644 index bea4b7239..000000000 --- a/examples/build-multi-stage/README.md +++ /dev/null @@ -1,8 +0,0 @@ -## Multi Stage Build Example - -This folder holds a simple devcontainer configuration that builds a local multi stages Dockerfile with a devcontainer feature. This is ideal for testing the build pipeline for more advance use cases, especially the extending of the Dockerfile. - -You can start this project via: -``` -devsy up ./examples/build-multi-stage -``` diff --git a/examples/build/.devcontainer.json b/examples/build/.devcontainer.json deleted file mode 100644 index d5c264620..000000000 --- a/examples/build/.devcontainer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "My dev env", - "build": { - "context": ".", - "dockerfile": "./Dockerfile" - }, - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {} - } -} diff --git a/examples/build/Dockerfile b/examples/build/Dockerfile deleted file mode 100644 index c3b2cff70..000000000 --- a/examples/build/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM ghcr.io/devsy-org/test-images/go:1 - -ARG TARGETOS -ARG TARGETARCH - -# Install Node.js -RUN \ - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get update \ - && apt-get install -y --no-install-recommends nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Set environment variables for Rust -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.69.0 - -# Install Protobuf compiler -RUN \ - apt-get update \ - && apt-get install -y --no-install-recommends protobuf-compiler \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -COPY app /app - -RUN echo hello diff --git a/examples/build/README.md b/examples/build/README.md deleted file mode 100644 index dacf2d82b..000000000 --- a/examples/build/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Build Example - -This folder holds a super simple devcontainer configuration that builds a local Dockerfile with a devcontainer feature. You can start this project via: -``` -devsy up ./examples/build -``` diff --git a/examples/build/app/code b/examples/build/app/code deleted file mode 100644 index e69de29bb..000000000 diff --git a/examples/compose/.devcontainer.json b/examples/compose/.devcontainer.json deleted file mode 100644 index ef83c94fb..000000000 --- a/examples/compose/.devcontainer.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "dockerComposeFile": "docker-compose.devcontainer.yml", - "service": "app", - "runServices": ["app2"], - "workspaceFolder": "/workspaces", - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/node:1": { - "installYarnUsingApt": true, - "version": "lts", - "nvmVersion": "latest" - } - }, - "forwardPorts": [1337, "db:5432"] -} diff --git a/examples/compose/.env b/examples/compose/.env deleted file mode 100644 index 82482f4c7..000000000 --- a/examples/compose/.env +++ /dev/null @@ -1,2 +0,0 @@ -TEST=test -COMPOSE_PROJECT_NAME=test diff --git a/examples/compose/Dockerfile b/examples/compose/Dockerfile deleted file mode 100644 index 34d741487..000000000 --- a/examples/compose/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM ghcr.io/devsy-org/test-images/go:1 AS go - -ARG TARGETOS -ARG TARGETARCH - -# Install Node.js -RUN \ - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get update \ - && apt-get install -y --no-install-recommends nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Set environment variables for Rust -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.69.0 - -# Install Protobuf compiler -RUN \ - apt-get update \ - && apt-get install -y --no-install-recommends protobuf-compiler \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -FROM go AS final - -COPY app /app - -RUN echo hello diff --git a/examples/compose/README.md b/examples/compose/README.md deleted file mode 100644 index cd31ed74e..000000000 --- a/examples/compose/README.md +++ /dev/null @@ -1,8 +0,0 @@ -## Docker Compose Example - -This folder holds a simple devcontainer configuration that uses docker-compose to start and build several services. - -You can start this project via: -``` -devsy up ./examples/compose -``` diff --git a/examples/compose/devcontainer.Dockerfile b/examples/compose/devcontainer.Dockerfile deleted file mode 100644 index 27192aa86..000000000 --- a/examples/compose/devcontainer.Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM ghcr.io/devsy-org/test-images/go:1 AS go - -ARG TARGETOS -ARG TARGETARCH - -# Install Node.js -RUN \ - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get update \ - && apt-get install -y --no-install-recommends nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Set environment variables for Rust -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.69.0 - -# Install Protobuf compiler -RUN \ - apt-get update \ - && apt-get install -y --no-install-recommends protobuf-compiler \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -FROM go AS final - -COPY app /app - -RUN echo hello diff --git a/examples/compose/devcontainer.Dockerfile2 b/examples/compose/devcontainer.Dockerfile2 deleted file mode 100644 index 7681c5dbf..000000000 --- a/examples/compose/devcontainer.Dockerfile2 +++ /dev/null @@ -1,2 +0,0 @@ -FROM ghcr.io/devsy-org/test-images/base:ubuntu -RUN echo test diff --git a/examples/compose/docker-compose.devcontainer.yml b/examples/compose/docker-compose.devcontainer.yml deleted file mode 100644 index 923b369c2..000000000 --- a/examples/compose/docker-compose.devcontainer.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: '3.8' - -services: - app: - build: - context: . - dockerfile: Dockerfile - env_file: - - .env - - volumes: - - .:/workspaces:cached - - # Overrides default command so things don't shut down after the process ends. - command: sleep infinity - - app2: - build: - context: . - dockerfile: devcontainer.Dockerfile2 - env_file: - - .env - - volumes: - - .:/workspaces:cached - - # Overrides default command so things don't shut down after the process ends. - command: sleep infinity - - db: - image: postgres:latest - restart: unless-stopped - volumes: - - postgres-data:/var/lib/postgresql/data - env_file: - - .env -volumes: - postgres-data: diff --git a/examples/feature/.devcontainer.json b/examples/feature/.devcontainer.json deleted file mode 100644 index b7b04a2ad..000000000 --- a/examples/feature/.devcontainer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "image": "ubuntu", - "remoteUser": "auser", - "features": { - "./afeature": {} - } -} diff --git a/examples/feature/afeature/devcontainer-feature.json b/examples/feature/afeature/devcontainer-feature.json deleted file mode 100644 index e8f79d7aa..000000000 --- a/examples/feature/afeature/devcontainer-feature.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "A feature", - "id": "afeature", - "version": "1.0.0", - "description": "A feature.", - "options": {} -} diff --git a/examples/feature/afeature/install.sh b/examples/feature/afeature/install.sh deleted file mode 100644 index 358c1c301..000000000 --- a/examples/feature/afeature/install.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "hello world" -useradd -l -m -s /bin/bash -N -u 1001 "auser" diff --git a/examples/multi-devcontainer/.devcontainer.json b/examples/multi-devcontainer/.devcontainer.json deleted file mode 100644 index 459cb33cb..000000000 --- a/examples/multi-devcontainer/.devcontainer.json +++ /dev/null @@ -1 +0,0 @@ -{ "image": "ghcr.io/devsy-org/test-images/base:ubuntu", "build": {} } diff --git a/examples/multi-devcontainer/proj1/.devcontainer.json b/examples/multi-devcontainer/proj1/.devcontainer.json deleted file mode 100644 index 87cdf8308..000000000 --- a/examples/multi-devcontainer/proj1/.devcontainer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Python 3", - "image": "ghcr.io/devsy-org/test-images/python:latest" -} diff --git a/examples/multi-devcontainer/proj2/.devcontainer.json b/examples/multi-devcontainer/proj2/.devcontainer.json deleted file mode 100644 index 25e8ab286..000000000 --- a/examples/multi-devcontainer/proj2/.devcontainer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Go", - "image": "ghcr.io/devsy-org/test-images/go:1" -} diff --git a/examples/object-lifecycle-hooks/.devcontainer.json b/examples/object-lifecycle-hooks/.devcontainer.json deleted file mode 100644 index 665679fd0..000000000 --- a/examples/object-lifecycle-hooks/.devcontainer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Object-Lifecycle", - "image": "ghcr.io/devsy-org/test-images/go:1", - "postStartCommand": { - "cobra-install": "go install github.com/spf13/cobra-cli@latest", - "golangci-lint": "go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest", - "errcheck": "go install github.com/kisielk/errcheck@latest" - } -} diff --git a/examples/simple-k8s-provider/README.md b/examples/simple-k8s-provider/README.md deleted file mode 100644 index de883bc6b..000000000 --- a/examples/simple-k8s-provider/README.md +++ /dev/null @@ -1,11 +0,0 @@ -## Simple Kubernetes Provider - -This provider starts a privileged Docker-in-Docker pod in a Kubernetes cluster and connects the workspace to it. To use this provider simply clone the repo and run: -``` -devsy provider add ./examples/provider.yaml -``` - -Then start a new workspace via: -``` -devsy up github.com/microsoft/vscode-course-sample -``` diff --git a/examples/simple-k8s-provider/provider.yaml b/examples/simple-k8s-provider/provider.yaml deleted file mode 100644 index a1696e769..000000000 --- a/examples/simple-k8s-provider/provider.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: kubernetes -version: 0.0.1 -description: |- - Devsy on Kubernetes -options: - NAMESPACE: - required: true - description: The namespace to use - command: |- - NAMESPACE=$(kubectl config view --minify -o jsonpath='{..namespace}' 2>/dev/null || true) - if [ -z "${NAMESPACE}" ]; then - NAMESPACE=default - fi - echo $NAMESPACE -agent: - path: /tmp/devsy -exec: - command: |- - kubectl exec -n "${NAMESPACE}" -c devsy-container -i devsy-${MACHINE_ID} -- sh -c "${COMMAND}" - create: |- - kubectl create -n "${NAMESPACE}" -f - << EOF - apiVersion: v1 - kind: Pod - metadata: - name: devsy-${MACHINE_ID} - labels: - app: devsy - spec: - volumes: - - name: devsy-storage - emptyDir: {} - containers: - - name: devsy-container - image: docker:dind - volumeMounts: - - mountPath: /var/lib/docker - name: devsy-storage - subPath: var/lib/docker - - mountPath: /root - name: devsy-storage - subPath: root - securityContext: - privileged: true - EOF - delete: |- - kubectl delete pod devsy-${MACHINE_ID} -n "${NAMESPACE}" || true diff --git a/examples/simple/.devcontainer.json b/examples/simple/.devcontainer.json deleted file mode 100644 index 1a0c2b7b4..000000000 --- a/examples/simple/.devcontainer.json +++ /dev/null @@ -1,50 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet -{ - "name": "Simple Example", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "ghcr.io/devsy-org/test-images/base:ubuntu", - - // Features to add to the dev container. More info: https://containers.dev/features. - "features": { - "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { - "version": "latest", - "helm": "latest", - "minikube": "none" - }, - "ghcr.io/devsy-org/devcontainer-features/vcluster:1": { - "version": "latest" - }, - "ghcr.io/larsnieuwenhuizen/features/jqyq:0": {} - }, - - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - "settings": {}, - "extensions": ["streetsidesoftware.code-spell-checker"] - } - }, - - // Use 'portsAttributes' to set default properties for specific forwarded ports. - // More info: https://containers.dev/implementors/json_reference/#port-attributes - "portsAttributes": { - "5000": { - "label": "Hello Remote World", - "onAutoForward": "notify" - }, - "5001": { - "protocol": "https" - } - } - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [5000, 5001], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "chmod +x .devcontainer/post_setup.sh && .devcontainer/post_setup.sh" - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/examples/simple/README.md b/examples/simple/README.md deleted file mode 100644 index c9f0df240..000000000 --- a/examples/simple/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Simple Example - -This folder holds a super simple devcontainer configuration. You can start this project via: -``` -devsy up ./examples/simple -``` diff --git a/examples/ztunnel/README.md b/examples/ztunnel/README.md deleted file mode 100644 index 8540680ec..000000000 --- a/examples/ztunnel/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Ztunnel example - -```bash -curl -L -o devsy "https://github.com/devsy-org/devsy/releases/latest/download/devsy-darwin-arm64" && sudo install -c -m 0755 devsy /usr/local/bin && rm -f devsy -``` - -Update the provider - -```bash -devsy provider set-source kubernetes kubernetes -``` - -Version deployed and version of source code matters. Make sure they match. Pull the latest version of the source code. And copy the devcontainer.json file to the source code. Or you can use the latest version of `gcr.io/istio-testing/build-tools` image. - -Make sure you hve a fresh installation of Istio: - -```bash -istioctl uninstall --purge -y - -istioctl install -y --set profile=ambient --set meshConfig.accessLogFile=/dev/stdout -``` - -Also, if you want to start from scratch, better you delete the devsy: - -```bash -devsy delete . --force -``` - -Let's deploy an app to test ambient: - -```bash -kubectl create ns my-ambient -kubectl label namespace my-ambient istio.io/dataplane-mode=ambient --overwrite -kubectl apply -f sleep.yaml -n my-ambient -kubectl apply -f helloworld.yaml -n my-ambient -``` - -Verify that app was included to Ambient mode: - -```bash -kubectl -n istio-system logs -l k8s-app=istio-cni-node -``` - -Send traffic to the app: - -```bash -kubectl -n my-ambient exec deploy/sleep -- sh -c 'for i in $(seq 1 100); do curl -s -I http://helloworld:5000/hello; done' -``` - -Output: - -```text -HTTP/1.1 200 OK -Server: gunicorn -Date: Tue, 23 Jul 2024 14:21:03 GMT -Connection: keep-alive -Content-Type: text/html; charset=utf-8 -Content-Length: 60 -``` - -Verify that the logs are being written to the stdout: - -```bash -kubectl -n istio-system logs -l app=ztunnel -``` - -Output: - -```text -2024-07-23T14:21:03.450051Z info access connection complete src.addr=10.12.0.8:37522 src.workload=sleep-bc9998558-bhv5z src.namespace=my-ambient src.identity="spiffe://cluster.local/ns/my-ambient/sa/sleep" dst.addr=10.12.0.9:15008 dst.hbone_addr=10.12.0.9:5000 dst.service=helloworld.my-ambient.svc.cluster.local dst.workload=helloworld-v1-77489ccb5f-pjbq5 dst.namespace=my-ambient dst.identity="spiffe://cluster.local/ns/my-ambient/sa/default" direction="outbound" bytes_sent=84 bytes_recv=158 duration="118ms" -``` - -At this point, traffic flows through the ztunnel. - -Let's label with `devsy-ztunnel=enabled` only one node to deploy devsy-ztunnel in there: - -```shell -FIRST_NODE=$(kubectl get nodes -o jsonpath='{.items[0].metadata.name}') -kubectl label node $FIRST_NODE devsy-ztunnel=enabled -``` - -Next command add nodeAffinity to make sure that the upstream ztunnel is not deployed in any node so our test if focused on one node and one devsy-ztunnel: - -```bash -kubectl patch daemonset -n istio-system ztunnel --type=merge -p='{"spec":{"template":{"spec":{"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"upstream-ztunnel","operator":"In","values":["no"]}]}]}}}}}}}' -``` - -You should see that the ztunnel is not deployed anymore. - -**NOTE**: To revert the previous command, run the following: - -```bash -# RUN THIS ONLY TO REVERT THE PREVIOUS COMMAND -# kubectl patch daemonset -n istio-system ztunnel --type=merge -p='{"spec":{"template":{"spec":{"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"upstream-ztunnel","operator":"NotIn","values":["no"]}]}]}}}}}}}' -``` - -Make sure you have docker installed: - -```bash -docker --version -``` - -Go to the root of the project and run the devsy: - -**Note** Normally, to start a Devsy is a straight forward simple command. However, given the complexty of ztunnel setup, we need to adjut it a bit. - -- `devcontainer.json` is overriden. In our version, we create a `postStartCommand` required to set the secret in the place that ztunnel app can find. Also, some `remoteEnv` are set to help on builing the app in the remote container. -- Using Kind cluster, the `STORAGE_CLASS` is `standard`. If you are using a different cluster, you may need to change it (i.e in EKS it would be `gp2`) -- The template of the pod is also overriden to match what ztunnel needs to run. - -```bash -devsy up . --provider-option STORAGE_CLASS=gp2 --provider-option KUBECTL_PATH=/usr/local/bin/kubectl --provider-option KUBERNETES_NAMESPACE=istio-system --provider-option POD_MANIFEST_TEMPLATE=$(pwd)/devsy/pod_manifest.yaml --devcontainer-path devsy/devcontainer.json --ide vscode --debug \ - --recreate --reset -``` - -You will see Devsy cli copying your project files to the remote container. In the case of ztunnel project, make sure that the `out` folder is deleted before starting devsy. That folder is usully too heavy and unnecesary to be copied to the container. - -At the moment, changes in the project when working in the container are not reflected in the local files. To do so, you can run the following command: - -```bash -rsync -rlptzv --progress --delete --exclude=.git --exclude=out "ztunnel.devsy:/workspaces/ztunnel" . -``` - -When the process finishes, you can build the project: - -```bash -cargo clean - - -RUST_LOG="debug" CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="sudo -E" cargo build --bin=ztunnel --package=ztunnel --message-format=json -``` diff --git a/examples/ztunnel/devcontainer.json b/examples/ztunnel/devcontainer.json deleted file mode 100644 index 3a7f05198..000000000 --- a/examples/ztunnel/devcontainer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "istio build-tools", - "image": "gcr.io/istio-testing/build-tools:release-1.23-d82829888b6f4a2b2b2644fe481d72ced2e402aa", - "postStartCommand": "mkdir -p /workspaces/ztunnel/var/run/secrets; cp -R /var/run/secrets/tokens /workspaces/ztunnel/var/run/secrets/; cp -R /var/run/secrets/istio /workspaces/ztunnel/var/run/secrets/", - "privileged": true, - "remoteEnv": { - "USE_GKE_GCLOUD_AUTH_PLUGIN": "True", - "BUILD_WITH_CONTAINER": "0", - "CARGO_HOME": "/home/.cargo", - "RUSTUP_HOME": "/home/.rustup", - "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER": "sudo -E" - }, - // "features": { - // "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} - // }, - "customizations": { - "vscode": { - "extensions": [ - "golang.go", - "rust-lang.rust-analyzer", - "eamodio.gitlens", - "zxh404.vscode-proto3", - "ms-azuretools.vscode-docker", - "redhat.vscode-yaml", - "IBM.output-colorizer", - "vadimcn.vscode-lldb" - ], - "settings": { - "files.eol": "\n", - "go.useLanguageServer": true, - "go.lintTool": "golangci-lint" - } - } - } -} diff --git a/examples/ztunnel/helloworld.yaml b/examples/ztunnel/helloworld.yaml deleted file mode 100644 index 83209fcb4..000000000 --- a/examples/ztunnel/helloworld.yaml +++ /dev/null @@ -1,80 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: helloworld - labels: - app: helloworld - service: helloworld -spec: - ports: - - port: 5000 - name: http - selector: - app: helloworld ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: helloworld-v1 - labels: - app: helloworld - version: v1 -spec: - replicas: 1 - selector: - matchLabels: - app: helloworld - version: v1 - template: - metadata: - labels: - app: helloworld - version: v1 - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: devsy-ztunnel - operator: In - values: - - enabled - containers: - - name: helloworld - image: docker.io/istio/examples-helloworld-v1 - resources: - requests: - cpu: "100m" - imagePullPolicy: IfNotPresent #Always - ports: - - containerPort: 5000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: helloworld-v2 - labels: - app: helloworld - version: v2 -spec: - replicas: 1 - selector: - matchLabels: - app: helloworld - version: v2 - template: - metadata: - labels: - app: helloworld - version: v2 - spec: - containers: - - name: helloworld - image: docker.io/istio/examples-helloworld-v2 - resources: - requests: - cpu: "100m" - imagePullPolicy: IfNotPresent #Always - ports: - - containerPort: 5000 diff --git a/examples/ztunnel/launch.json b/examples/ztunnel/launch.json deleted file mode 100644 index 8495d3b11..000000000 --- a/examples/ztunnel/launch.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "lldb", - "request": "launch", - "name": "Debug unit tests in library 'ztunnel'", - "cargo": { - "args": [ - "test", - "--no-run", - "--lib", - "--package=ztunnel" - ], - "filter": { - "name": "ztunnel", - "kind": "lib" - } - }, - "args": [], - "cwd": "${workspaceFolder}" - }, - { - "type": "lldb", - "request": "launch", - "name": "Debug executable 'ztunnel'", - "cargo": { - "args": [ - "build", - "--bin=ztunnel", - "--package=ztunnel" - ], - "filter": { - "name": "ztunnel", - "kind": "bin" - } - }, - "args": [], - "cwd": "${workspaceFolder}", - "env": { - "RUST_LOG": "debug", - "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER": "sudo -E", - } - }, - { - "type": "lldb", - "request": "launch", - "name": "Debug unit tests in executable 'ztunnel'", - "cargo": { - "args": [ - "test", - "--no-run", - "--bin=ztunnel", - "--package=ztunnel" - ], - "filter": { - "name": "ztunnel", - "kind": "bin" - } - }, - "args": [], - "cwd": "${workspaceFolder}" - }, - { - "type": "lldb", - "request": "launch", - "name": "Debug integration test 'namespaced'", - "cargo": { - "args": [ - "test", - "--no-run", - "--test=namespaced", - "--package=ztunnel" - ], - "filter": { - "name": "namespaced", - "kind": "test" - } - }, - "args": [], - "cwd": "${workspaceFolder}" - }, - { - "type": "lldb", - "request": "launch", - "name": "Debug integration test 'direct'", - "cargo": { - "args": [ - "test", - "--no-run", - "--test=direct", - "--package=ztunnel" - ], - "filter": { - "name": "direct", - "kind": "test" - } - }, - "args": [], - "cwd": "${workspaceFolder}" - }, - { - "type": "lldb", - "request": "launch", - "name": "Debug benchmark 'throughput'", - "cargo": { - "args": [ - "test", - "--no-run", - "--bench=throughput", - "--package=ztunnel" - ], - "filter": { - "name": "throughput", - "kind": "bench" - } - }, - "args": [], - "cwd": "${workspaceFolder}" - } - ] -} diff --git a/examples/ztunnel/pod_manifest.yaml b/examples/ztunnel/pod_manifest.yaml deleted file mode 100644 index 6787b505e..000000000 --- a/examples/ztunnel/pod_manifest.yaml +++ /dev/null @@ -1,159 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - namespace: istio-system - # name: devsy-ztunnel-1-21-0 # NOTE: This is ignored - annotations: - ambient.istio.io/redirection: disabled - prometheus.io/scrape: "true" - sidecar.istio.io/inject: "false" - # generateName: ztunnel- - labels: - featureid: "1234" - devsy: ztunnel - sidecar.istio.io/inject: "false" - app: devsy-ztunnel # NOTE: This make devsy fails -spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: devsy-ztunnel - operator: In - values: - - enabled - containers: - - name: "devsy" - env: - - name: CA_ADDRESS - value: istiod.istio-system.svc:15012 - - name: XDS_ADDRESS - value: istiod.istio-system.svc:15012 - - name: RUST_LOG - value: info - - name: ISTIO_META_CLUSTER_ID - value: cluster1 - - name: INPOD_ENABLED - value: "true" - - name: ISTIO_META_DNS_PROXY_ADDR - value: 127.0.0.1:15053 - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: INSTANCE_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: SERVICE_ACCOUNT - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.serviceAccountName - ports: - - containerPort: 15020 - name: ztunnel-stats - protocol: TCP -# # readinessProbe: -# # failureThreshold: 3 -# # httpGet: -# # path: /healthz/ready -# # port: 15021 -# # scheme: HTTP -# # periodSeconds: 10 -# # successThreshold: 1 -# # timeoutSeconds: 1 - resources: - limits: - cpu: 500m - memory: 2Gi - requests: - cpu: 500m - memory: 2Gi - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_ADMIN - - SYS_ADMIN - - NET_RAW - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 1337 - runAsNonRoot: false - runAsUser: 0 - # terminationMessagePath: /dev/termination-log - # terminationMessagePolicy: File - volumeMounts: - - mountPath: /var/run/secrets/istio - name: istiod-ca-cert - - mountPath: /var/run/secrets/tokens - name: istio-token - - mountPath: /var/run/ztunnel - name: cni-ztunnel-sock-dir - - mountPath: /var/run/secrets/kubernetes.io/serviceaccount - name: kube-api-access-c5j45 - - name: containerd-sock - mountPath: /run/containerd/containerd.sock - readOnly: true - # dnsPolicy: ClusterFirst - # enableServiceLinks: true - # nodeName: kind1-control-plane - # nodeSelector: - # kubernetes.io/os: linux - serviceAccount: ztunnel - serviceAccountName: ztunnel - # terminationGracePeriodSeconds: 30 - volumes: - - name: istio-token - projected: - defaultMode: 420 - sources: - - serviceAccountToken: - audience: istio-ca - expirationSeconds: 43200 - path: istio-token - - configMap: - defaultMode: 420 - name: istio-ca-root-cert - name: istiod-ca-cert - - hostPath: - path: /var/run/ztunnel - type: DirectoryOrCreate - name: cni-ztunnel-sock-dir - - name: kube-api-access-c5j45 - projected: - defaultMode: 420 - sources: - - serviceAccountToken: - expirationSeconds: 3607 - path: token - - configMap: - items: - - key: ca.crt - path: ca.crt - name: kube-root-ca.crt - - downwardAPI: - items: - - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - path: namespace - - name: containerd-sock - hostPath: - path: "/var/run/containerd/containerd.sock" diff --git a/examples/ztunnel/sleep.yaml b/examples/ztunnel/sleep.yaml deleted file mode 100644 index a0977d15e..000000000 --- a/examples/ztunnel/sleep.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright Istio Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -################################################################################################## -# Sleep service -################################################################################################## -apiVersion: v1 -kind: ServiceAccount -metadata: - name: sleep ---- -apiVersion: v1 -kind: Service -metadata: - name: sleep - labels: - app: sleep - service: sleep -spec: - ports: - - port: 80 - name: http - selector: - app: sleep ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: sleep -spec: - replicas: 1 - selector: - matchLabels: - app: sleep - template: - metadata: - labels: - app: sleep - spec: - terminationGracePeriodSeconds: 0 - serviceAccountName: sleep - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: devsy-ztunnel - operator: In - values: - - enabled - containers: - - name: sleep - image: curlimages/curl - command: ["/bin/sleep", "infinity"] - imagePullPolicy: IfNotPresent - volumeMounts: - - mountPath: /etc/sleep/tls - name: secret-volume - volumes: - - name: secret-volume - secret: - secretName: sleep-secret - optional: true ----