Skip to content

Commit 4d24cb6

Browse files
authored
Enhanced Documentation and Cluster Creation Feedback (#62)
* Update development workflow documentation to include Replicated API Token setup and correct chart paths for Helm commands * Enhance cluster creation task in Taskfile.yaml to check for existing clusters and output detailed information if found. This improves user feedback during the cluster setup process.
1 parent 8481e4b commit 4d24cb6

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

applications/wg-easy/Taskfile.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,18 @@ tasks:
5858
TIMEOUT: '{{if eq .EMBEDDED "true"}}420{{else}}300{{end}}'
5959
TTL: '{{.TTL | default "4h"}}'
6060
status:
61-
- replicated cluster ls --output json | jq -e '.[] | select(.name == "{{.CLUSTER_NAME}}")' > /dev/null
61+
- |
62+
# Check if cluster exists and output info if it does
63+
CLUSTER_INFO=$(replicated cluster ls --output json | jq -r '.[] | select(.name == "{{.CLUSTER_NAME}}")')
64+
if [ -n "$CLUSTER_INFO" ]; then
65+
echo "Found existing cluster {{.CLUSTER_NAME}}:"
66+
echo "$CLUSTER_INFO" | jq -r '" ID: " + .id + "\n Status: " + .status + "\n Distribution: " + .distribution + "\n Created: " + .created_at + "\n Expires: " + .expires_at'
67+
exit 0
68+
fi
69+
exit 1
6270
cmds:
6371
- |
72+
echo "Creating new cluster {{.CLUSTER_NAME}}..."
6473
if [ "{{.EMBEDDED}}" = "true" ]; then
6574
echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.LICENSE_ID}}..."
6675
replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.LICENSE_ID}} --ttl {{.TTL}}

applications/wg-easy/docs/development-workflow.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Before starting the development workflow, ensure you have the following tools in
1717

1818
- **Task:** The task runner used in this project. ([Installation Guide](https://taskfile.dev/installation/))
1919
- **Container runtime tool** Either [Podman](https://podman.io/docs/installation) (default) or [Docker](https://docs.docker.com/get-docker/) for local development. Export `CONTAINER_RUNTIME=docker` in your shell if you use docker.
20+
- **Replicated API Token:** Export `REPLICATED_API_TOKEN` in your shell. This can be obtained from the [Replicated Vendor Portal](https://vendor.replicated.com) under Account Settings → API Tokens.
21+
22+
```bash
23+
# Add to your shell's rc file (.bashrc, .zshrc, etc.)
24+
export REPLICATED_API_TOKEN="<your-token-here>"
25+
```
2026

2127
All other tools will be automatically provided through task commands and containers.
2228

@@ -29,7 +35,7 @@ Begin by defining and verifying chart dependencies.
2935
1. Define or update dependencies in `Chart.yaml`:
3036

3137
```yaml
32-
# Example: cert-manager/Chart.yaml
38+
# Example: charts/cert-manager/Chart.yaml
3339
dependencies:
3440
- name: cert-manager
3541
version: '1.14.5'
@@ -44,13 +50,13 @@ Begin by defining and verifying chart dependencies.
4450
```bash
4551
task dependencies-update
4652
# Or for a single chart:
47-
helm dependency update ./cert-manager
53+
helm dependency update ./charts/cert-manager
4854
```
4955

5056
3. Verify charts were downloaded:
5157

5258
```bash
53-
ls -la ./cert-manager/charts/
59+
ls -la ./charts/cert-manager/charts/
5460
```
5561

5662
**Validation point**: Dependencies should be successfully downloaded to the `/charts` directory.
@@ -105,7 +111,7 @@ Validate chart templates locally without deploying to a cluster.
105111

106112
1. Run helm template to render the chart and inspect manifests:
107113
```bash
108-
helm template ./cert-manager | less
114+
helm template ./charts/cert-manager | less
109115
```
110116

111117
**Validation point**: Generated Kubernetes manifests should be valid and contain the expected resources.
@@ -117,14 +123,22 @@ Deploy individual charts to a test cluster to verify functionality.
117123
1. Create a test cluster if needed:
118124

119125
```bash
126+
# Create with default name (test-cluster)
120127
task cluster-create
128+
129+
# Create with custom name
130+
task cluster-create CLUSTER_NAME=my-custom-cluster
131+
132+
# Create embedded cluster with custom name
133+
task cluster-create CLUSTER_NAME=my-embedded-cluster EMBEDDED=true
134+
121135
task setup-kubeconfig
122136
```
123137

124138
2. Install a single chart:
125139

126140
```bash
127-
helm install cert-manager ./cert-manager -n cert-manager --create-namespace
141+
helm install cert-manager ./charts/cert-manager -n cert-manager --create-namespace
128142
```
129143

130144
3. Verify the deployment:
@@ -172,7 +186,7 @@ Test multiple charts working together using Helmfile orchestration.
172186
2. Deploy all charts:
173187
174188
```bash
175-
task helm-deploy
189+
task helm-install
176190
```
177191

178192
3. Verify cross-component integration:

0 commit comments

Comments
 (0)