Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 51 additions & 54 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,85 +4,82 @@

VDK is a Command Line Interface (CLI) tool designed to help developers quickly and securely set up local Kubernetes clusters using [KinD](https://kind.sigs.k8s.io/). It simplifies the process of creating clusters with varying configurations (versions, node counts) to assist in building and testing applications for platforms like Vega.

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) <!-- Add license badge if applicable -->
<!-- Add build status, release badges etc. later -->
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)

## Overview

Building and testing applications designed for Kubernetes often requires a realistic cluster environment. VDK streamlines the setup of local clusters via KinD, providing commands to:
Building and testing applications designed for Kubernetes often requires a realistic cluster environment. VDK streamlines the setup of local clusters via KinD, providing:

* Create single or multi-node Kubernetes clusters.
* Specify desired Kubernetes versions.
* Manage the lifecycle of these local clusters (list, delete).
* Easily integrate with `kubectl`.
- Single or multi-node Kubernetes clusters
- Configurable Kubernetes versions
- Local container registry (Zot) for image storage
- TLS-enabled reverse proxy (nginx) for secure access
- GitOps with Flux CD
- Easy cluster lifecycle management

This tool is particularly useful for developers working on the Vega platform, enabling consistent and reproducible development environments.

## Installation

For detailed installation instructions for your operating system, please refer to the **[Getting Started Guide](./docs/installation/getting-started.md)**.
## Quick Start

**Prerequisites:**
1. **Install Devbox:**

* [Docker](https://docs.docker.com/get-docker/)
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) (Recommended for interacting with clusters)
```bash
curl -fsSL https://get.jetify.com/devbox | bash
```

*For development prerequisites (Devbox/Nix), see the [Getting Started Guide](./docs/installation/getting-started.md).*
2. **Clone and enter the repository:**

## Quick Start
```bash
git clone https://github.com/ArchetypicalSoftware/VDK.git
cd VDK
devbox shell
```

1. **Create a default cluster:**
```bash
vdk create cluster
```
*(This may take a few minutes)*
3. **Initialize the environment:**

2. **Verify cluster access:**
```bash
kubectl cluster-info --context kind-kind
```
```bash
vega init
```

3. **Delete the cluster:**
```bash
vdk delete cluster
```
This creates the registry, reverse proxy, and a default cluster.

## Usage
4. **Verify cluster access:**

For comprehensive usage details, examples, and command references, please see the **Usage Documentation**:
```bash
kubectl cluster-info --context kind-vdk
```

* **[Creating Clusters](./docs/usage/creating-clusters.md)**
* **[Managing Clusters](./docs/usage/managing-clusters.md)**
* **[Command Reference](./docs/usage/command-reference.md)**
5. **When done, remove the cluster:**

## Contributing
```bash
vega remove cluster
```

We welcome contributions! Please read our **[Contribution Guidelines](./docs/contribution/guidelines.md)** and **[Development Setup](./docs/contribution/development-setup.md)** guides to get started.
## Configuration

## Debugging & Troubleshooting
If port 443 is already in use, set a different port for the reverse proxy:

If you encounter issues while using VDK, consult the **[Troubleshooting Guide](./docs/debugging/troubleshooting.md)**.
```bash
export REVERSE_PROXY_HOST_PORT=8443
```

## License
## Documentation

This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details. *(Ensure a LICENSE file exists)*
| Topic | Description |
|-------|-------------|
| [Getting Started](./docs/installation/getting-started.md) | Installation and setup |
| [Creating Clusters](./docs/usage/creating-clusters.md) | How to create clusters |
| [Managing Clusters](./docs/usage/managing-clusters.md) | Cluster lifecycle management |
| [Command Reference](./docs/usage/command-reference.md) | Complete command documentation |
| [Troubleshooting](./docs/debugging/troubleshooting.md) | Common issues and solutions |

## Getting Started
## Contributing

- Install DevBox
We welcome contributions! Please read our guides:

```
curl -fsSL https://get.jetify.com/devbox | bash
```
- Clone the repository `git clone https://github.com/ArchetypicalSoftware/VDK.git`
- Start DevBox session in the cloned repository
```
devbox shell
```
- Run `vega --help` to see the available commands
- [Contribution Guidelines](./docs/contribution/guidelines.md)
- [Development Setup](./docs/contribution/development-setup.md)

### Configuration options
## License

If you already have a process listening on your host on port 443, you will have issues with the vega reverse proxy.
You can either stop the existing process or change the port by defining the environment variable `REVERSE_PROXY_HOST_PORT`.
The default port is 443.
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
108 changes: 90 additions & 18 deletions docs/contribution/development-setup.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,106 @@
# Development Setup

Setting up your environment to contribute to VDK.
Setting up your environment to contribute to Vega.

## Prerequisites

- [Go](https://go.dev/doc/install) (Specify required version, e.g., 1.19+)
- [Docker](https://docs.docker.com/get-docker/)
- [Make](https://www.gnu.org/software/make/) (Optional, if using Makefiles)
- [Git](https://git-scm.com/)
- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)
- [Docker](https://docs.docker.com/get-docker/)
- [Git](https://git-scm.com/)
- [KinD](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) (Kubernetes in Docker)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)

### Recommended: Using Devbox

For a reproducible development environment, use [Devbox](https://www.jetpack.io/devbox/docs/):

1. Install Devbox:

```bash
curl -fsSL https://get.jetify.com/devbox | bash
```

2. Start a Devbox shell in the repository:

```bash
devbox shell
```

This automatically sets up all required dependencies.

## Building from Source

1. Clone the repository (or your fork).
2. Navigate to the project directory.
3. Run the build command:
1. Clone the repository (or your fork):

```bash
go build -o vdk ./cmd/vdk
# Or, if using Make:
# make build
```
```bash
git clone https://github.com/ArchetypicalSoftware/VDK.git
cd VDK
```

2. Navigate to the CLI project:

```bash
cd cli/src/Vdk
```

3. Build the project:

```bash
dotnet build
```

4. Run the CLI:

```bash
dotnet run -- --help
```

## Running Tests

From the repository root:

```bash
go test ./...
# Or, if using Make:
# make test
cd cli
dotnet test
```

Or run specific tests:

```bash
dotnet test --filter "FullyQualifiedName~YourTestName"
```

## Publishing

To create a self-contained executable:

```bash
cd cli/src/Vdk
dotnet publish -c Release
```

The output will be in `bin/Release/net10.0/publish/`.

## Project Structure

```
VDK/
├── cli/
│ └── src/
│ └── Vdk/
│ ├── Commands/ # CLI command implementations
│ ├── Services/ # Business logic and integrations
│ ├── Models/ # Data models
│ ├── Constants/ # Configuration constants
│ ├── Certs/ # TLS certificates
│ └── ConfigMounts/ # Container configuration files
└── docs/ # Documentation
```

## Linting
## Key Technologies

*(Instructions for running linters, e.g., `golangci-lint`)*
- **System.CommandLine**: CLI framework
- **KubeOps.KubernetesClient**: Kubernetes API client
- **Docker.DotNet**: Docker API client
- **YamlDotNet**: YAML serialization
- **Flux CD**: GitOps toolkit
35 changes: 25 additions & 10 deletions docs/contribution/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,34 @@ We welcome contributions to the Vega Development Kit (VDK)!

## How to Contribute

1. **Fork the Repository:** Start by forking the main VDK repository.
2. **Clone your Fork:** Clone your forked repository to your local machine.
3. **Create a Branch:** Create a new branch for your feature or bug fix (`git checkout -b feature/your-feature-name` or `bugfix/issue-number`).
4. **Make Changes:** Implement your changes and add relevant tests.
5. **Run Tests:** Ensure all tests pass.
6. **Commit Changes:** Commit your changes with clear and descriptive messages.
7. **Push to Your Fork:** Push your changes to your forked repository.
8. **Open a Pull Request:** Open a pull request against the main VDK repository's `main` branch.
1. **Fork the Repository:** Start by forking the main VDK repository.
2. **Clone your Fork:** Clone your forked repository to your local machine.
3. **Create a Branch:** Create a new branch for your feature or bug fix (`git checkout -b feature/your-feature-name` or `bugfix/issue-number`).
4. **Make Changes:** Implement your changes and add relevant tests.
5. **Run Tests:** Ensure all tests pass with `dotnet test`.
6. **Commit Changes:** Commit your changes with clear and descriptive messages.
7. **Push to Your Fork:** Push your changes to your forked repository.
8. **Open a Pull Request:** Open a pull request against the main VDK repository's `main` branch.

## Code Style

*(Specify Go formatting standards, linting tools used, etc.)*
- Follow standard C# conventions and .NET naming guidelines
- Use nullable reference types (`#nullable enable`)
- Prefer async/await for I/O operations
- Keep methods focused and single-purpose
- Add XML documentation for public APIs

## Testing

- Add unit tests for new functionality
- Ensure existing tests pass before submitting
- Run tests with: `dotnet test`

## Reporting Bugs

Please open an issue on the GitHub repository, providing detailed steps to reproduce the bug.
Please [open an issue](https://github.com/ArchetypicalSoftware/VDK/issues) on the GitHub repository, providing:

- Steps to reproduce the bug
- Expected behavior
- Actual behavior
- Environment details (OS, .NET version, Docker version)
Loading
Loading