update readme
This commit is contained in:
+59
-33
@@ -1,51 +1,49 @@
|
||||
# Infrastructure CLI Tool
|
||||
|
||||
A simple interactive CLI tool for managing infrastructure provisioning and cleanup. This tool replaces the existing scripts with a more user-friendly interface while maintaining compatibility with the Ansible playbooks.
|
||||
A user-friendly CLI tool for provisioning and managing infrastructure components, with a focus on Kubernetes clusters.
|
||||
|
||||
## Installation
|
||||
|
||||
### Option 1: Quick Install (Linux/macOS)
|
||||
> **Important**: This tool has only been tested on Ubuntu 24.04 and WSL Ubuntu 24.04. There is no guarantee it will work on other operating systems.
|
||||
|
||||
Run the installation script:
|
||||
### Quick Install (Ubuntu)
|
||||
|
||||
```bash
|
||||
./install.sh
|
||||
```
|
||||
|
||||
This will install the CLI tool to `~/.local/bin` and provide instructions if you need to update your PATH.
|
||||
This installs the CLI tool to `~/.local/bin` and provides PATH configuration instructions if needed.
|
||||
|
||||
### Option 2: Manual Install
|
||||
### Manual Install
|
||||
|
||||
1. Find the appropriate binary for your platform in the `bin` directory:
|
||||
- Linux/AMD64: `bin/linux_amd64/provision`
|
||||
- Linux/ARM64: `bin/linux_arm64/provision`
|
||||
- macOS/AMD64: `bin/darwin_amd64/provision`
|
||||
- macOS/ARM64: `bin/darwin_arm64/provision`
|
||||
- Windows: `bin/windows_amd64/provision.exe`
|
||||
Find the appropriate binary for your platform in the `bin` directory:
|
||||
|
||||
2. Copy it to a location in your PATH:
|
||||
```bash
|
||||
# Example for Linux/macOS
|
||||
cp bin/linux_amd64/provision ~/.local/bin/
|
||||
chmod +x ~/.local/bin/provision
|
||||
```
|
||||
```bash
|
||||
# Example for Linux/AMD64
|
||||
cp bin/linux_amd64/provision ~/.local/bin/
|
||||
chmod +x ~/.local/bin/provision
|
||||
```
|
||||
|
||||
Available binaries:
|
||||
- Linux: `bin/linux_amd64/provision` or `bin/linux_arm64/provision`
|
||||
- macOS: `bin/darwin_amd64/provision` or `bin/darwin_arm64/provision`
|
||||
- Windows: `bin/windows_amd64/provision.exe`
|
||||
|
||||
## Usage
|
||||
|
||||
Simply run the command to start the interactive CLI:
|
||||
Run the command to start the interactive CLI:
|
||||
|
||||
```bash
|
||||
provision
|
||||
```
|
||||
|
||||
You'll be guided through a series of prompts to:
|
||||
The tool will guide you through:
|
||||
1. Choosing an operation (provision or cleanup)
|
||||
2. Selecting what to provision/cleanup (Kubernetes or PostgreSQL)
|
||||
3. Configuring settings or using defaults
|
||||
4. Confirming and executing the operation
|
||||
|
||||
1. Choose an operation (provision or cleanup)
|
||||
2. Select what to provision/cleanup (Kubernetes or PostgreSQL)
|
||||
3. Configure settings or use defaults
|
||||
4. Confirm and execute the operation
|
||||
|
||||
### Example: Provisioning Kubernetes
|
||||
### Example: Provision Kubernetes
|
||||
|
||||
```
|
||||
$ provision
|
||||
@@ -54,12 +52,12 @@ $ provision
|
||||
? What would you like to provision? Kubernetes Cluster
|
||||
|
||||
Current default settings:
|
||||
Kubernetes Version: 1.28
|
||||
Kubernetes Version: 1.32
|
||||
Pod CIDR: 192.168.0.0/16
|
||||
Service CIDR: 10.96.0.0/16
|
||||
CNI Plugin: calico
|
||||
Control Plane: 2 CPUs, 4G Memory, 20G Disk
|
||||
Worker Nodes: 2 CPUs, 4G Memory, 20G Disk
|
||||
Control Plane: 4 CPUs, 8G Memory, 40G Disk
|
||||
Worker Nodes: 4 CPUs, 8G Memory, 40G Disk
|
||||
|
||||
? Do you want to use these default settings? Yes
|
||||
? Do you want to proceed? Yes
|
||||
@@ -67,7 +65,7 @@ Worker Nodes: 2 CPUs, 4G Memory, 20G Disk
|
||||
Running provisioning script...
|
||||
```
|
||||
|
||||
### Example: Cleaning Up
|
||||
### Example: Clean Up
|
||||
|
||||
```
|
||||
$ provision
|
||||
@@ -82,15 +80,43 @@ Cleanup completed successfully
|
||||
|
||||
## Requirements
|
||||
|
||||
- **Host OS**: Ubuntu 24.04 or WSL Ubuntu 24.04 (tool has only been tested on these platforms)
|
||||
- Ansible (for provisioning operations)
|
||||
- Multipass (for VM creation)
|
||||
- SSH client tools
|
||||
|
||||
## Developing the CLI Tool
|
||||
## Development
|
||||
|
||||
If you want to modify or extend the CLI tool:
|
||||
### Project Structure
|
||||
|
||||
1. Make changes to the Go code in the `cmd/provision` directory
|
||||
2. Run the build script to rebuild binaries:
|
||||
- `cmd/provision/` - Main CLI code
|
||||
- `cmd/` - Command definitions using Cobra
|
||||
- `kubernetes/` - Kubernetes-specific functionality
|
||||
- `interactive/` - User interaction utilities
|
||||
- `ansible/` - Ansible wrapper functions
|
||||
- `config/` - Configuration management
|
||||
|
||||
### Building the CLI
|
||||
|
||||
To modify or extend the CLI tool:
|
||||
|
||||
1. Make changes to the Go code
|
||||
2. Build binaries for all platforms:
|
||||
```bash
|
||||
./scripts/build-release.sh
|
||||
```
|
||||
|
||||
### Adding New Commands
|
||||
|
||||
1. Create a new command file in `cmd/provision/cmd/`
|
||||
2. Register the command in `cmd/provision/cmd/root.go`
|
||||
3. Implement the command functionality
|
||||
|
||||
### Testing
|
||||
|
||||
Run the tests with:
|
||||
|
||||
```bash
|
||||
cd cli
|
||||
go test ./...
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user