You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add app-config.local.yaml template for simplified local development
Introduces a pre-configured app-config.local.yaml.example file to simplify local Backstage development with Kind cluster. Developers can now start developing with a single copy command instead of managing multiple environment variables.
Key changes:
- Add app-config.local.yaml.example with hardcoded Kind cluster values
- Frontend: http://localhost:3000
- Backend: http://localhost:7007
- OpenChoreo API: http://api.openchoreo.localhost
- Thunder IDP: http://sts.openchoreo.localhost
- OAuth credentials from Kind cluster helm values
- Update README.md with simplified Quick Start guide
- Add developer-friendly comments to app-config.yaml
Benefits:
- Zero configuration needed for local development
- No manual environment variable management
- Works out-of-box with Kind cluster (make -f make/kind.mk install)
- Gitignored, won't affect Docker builds or production
Usage: cp app-config.local.yaml.example app-config.local.yaml && yarn start
**IMPORTANT:** The `BACKSTAGE_BASE_URL` variable is used for both `app.baseUrl` and `backend.baseUrl` in the configuration. This works well in production with ingress routing but requires special handling for local development:
100
-
101
-
**Development Mode (`yarn start`):**
102
-
103
-
- Frontend runs on **http://localhost:3000** (webpack dev server with hot reloading)
104
-
- Backend runs on **http://localhost:7007** (API only)
105
-
- These run as **separate processes on different ports**
106
-
- The `@backstage/plugin-app-backend` is loaded but inactive (no built assets to serve)
107
-
- Access the application at **http://localhost:3000**
50
+
This is the **easiest way** to get started - all values are pre-configured to connect your local Backstage instance to the Kind cluster services (*.openchoreo.localhost).
108
51
109
-
**Production/Build Mode:**
52
+
#### What's in app-config.local.yaml?
110
53
111
-
- Frontend must be built first: `yarn build:all`
112
-
- Backend serves the built static assets via `@backstage/plugin-app-backend`
113
-
- Both accessible from the same URL (e.g., **http://localhost:7007** or ingress URL)
54
+
The `app-config.local.yaml.example` file contains hardcoded values for:
-**OAuth Credentials:** Pre-configured from Kind cluster helm values
61
+
- Client ID: `openchoreo-backstage-client`
62
+
- Client Secret: `backstage-portal-secret`
116
63
117
-
Since frontend and backend run on separate ports in development, you need to configure the URLs accordingly:
64
+
**Note:**`app-config.local.yaml` is gitignored and won't affect Docker builds or production deployments. The Docker build only uses `app-config.production.yaml`.
118
65
119
-
-**Option 1 (Recommended):** Manually override in `app-config.yaml`:
66
+
#### Optional: GitHub Integration
120
67
121
-
```yaml
122
-
app:
123
-
baseUrl: http://localhost:3000 # Frontend URL
68
+
If you need GitHub integration for catalog/templates, add your personal access token to `app-config.local.yaml`:
124
69
125
-
backend:
126
-
baseUrl: http://localhost:7007 # Backend API URL
127
-
cors:
128
-
origin: http://localhost:3000 # Allow frontend to call backend
129
-
```
130
-
131
-
- **Option 2:** Create `app-config.local.yaml` (not tracked in git) with the above overrides.
132
-
133
-
- **Option 3:** Use environment variables:
134
-
```bash
135
-
export BACKSTAGE_BASE_URL=http://localhost:3000 # For app.baseUrl
136
-
# Note: You'll still need to override backend.baseUrl and cors.origin in config
137
-
```
138
-
139
-
**Production/Kind with Ingress:**
70
+
```yaml
71
+
integrations:
72
+
github:
73
+
- host: github.com
74
+
token: YOUR_GITHUB_TOKEN_HERE
75
+
```
140
76
141
-
- Set `BACKSTAGE_BASE_URL` to your ingress URL (e.g., `http://openchoreo.localhost`)
142
-
- The ingress routes both frontend and backend through the same origin
143
-
- Both `app.baseUrl` and `backend.baseUrl` use the same value
77
+
### 3. Configuration Files
144
78
145
-
### 3. Configuration
79
+
The application uses three configuration files:
146
80
147
-
The application uses two primary configuration files:
81
+
| File | Purpose | Used When |
82
+
|------|---------|-----------|
83
+
| `app-config.yaml` | Base configuration with environment variable placeholders | Referenced by both local and Docker builds |
84
+
| `app-config.local.yaml` | Local development overrides (gitignored) | Local development with `yarn start` |
85
+
| `app-config.production.yaml` | Production configuration | Docker builds, Kind cluster, production Kubernetes |
148
86
149
-
- `app-config.yaml`- Base configuration for local development (uses environment variables)
150
-
- `app-config.production.yaml`- Production configuration
87
+
**Configuration Loading Order:**
151
88
152
-
You can optionally create `app-config.local.yaml` for local overrides (this file is not tracked in git).
89
+
Backstage CLI automatically loads configs in this order (later files override earlier ones):
90
+
1. `app-config.yaml`
91
+
2. `app-config.local.yaml` (if it exists)
153
92
154
-
#### Environment-Driven Configuration
93
+
#### Advanced: Using Environment Variables
155
94
156
-
All configuration now uses environment variables for flexibility across deployment environments. Key configuration sections in `app-config.yaml`:
95
+
If you prefer to use environment variables instead of `app-config.local.yaml`, you can set these in your shell:
157
96
158
-
```yaml
159
-
# Backstage base URLs (from commit 5d84dd7)
160
-
app:
161
-
title: OpenChoreo Portal
162
-
baseUrl: ${BACKSTAGE_BASE_URL} # Frontend URL
163
-
164
-
backend:
165
-
baseUrl: ${BACKSTAGE_BASE_URL} # Backend API URL
166
-
session:
167
-
secret: ${BACKEND_SECRET} # Required for authentication cookies
168
-
cors:
169
-
origin: ${BACKSTAGE_BASE_URL} # CORS origin (should match frontend URL)
**Note:** In production deployments (Kubernetes/Helm), these environment variables are automatically injected by the Helm chart. See the [openchoreo/openchoreo repository](https://github.com/openchoreo/openchoreo) deployment configuration at `install/helm/openchoreo/templates/backstage/deployment.yaml` for details.
109
+
Then run: `yarn start`
110
+
111
+
**Note:** In production deployments (Kubernetes/Helm), environment variables are automatically injected by the Helm chart. See the [openchoreo/openchoreo repository](https://github.com/openchoreo/openchoreo) at `install/helm/openchoreo/templates/backstage/deployment.yaml` for details.
Copy file name to clipboardExpand all lines: app-config.yaml
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,16 @@
1
+
# Base Backstage Configuration
2
+
#
3
+
# This file contains the base configuration with environment variable placeholders.
4
+
# Environment variables are used in Docker builds and production deployments.
5
+
#
6
+
# For local development with Kind cluster:
7
+
# 1. Copy the example file: cp app-config.local.yaml.example app-config.local.yaml
8
+
# 2. Run: yarn start
9
+
# 3. The app-config.local.yaml will automatically override values from this file
10
+
#
11
+
# Note: app-config.local.yaml is gitignored and won't affect Docker builds.
12
+
# Docker builds only use app-config.production.yaml.
13
+
1
14
app:
2
15
title: OpenChoreo Portal
3
16
# Environment variable is injected by Helm chart (see https://github.com/openchoreo/openchoreo install/helm/openchoreo/templates/backstage/deployment.yaml)
@@ -9,7 +22,6 @@ organization:
9
22
name: OpenChoreo
10
23
11
24
backend:
12
-
https: true
13
25
# Used for enabling authentication, secret is shared by all backend plugins
14
26
# See https://backstage.io/docs/auth/service-to-service-auth for
0 commit comments