container-superposition 0.1.1 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +569 -8
  2. package/dist/scripts/init.js +436 -254
  3. package/dist/scripts/init.js.map +1 -1
  4. package/dist/tool/commands/doctor.d.ts +15 -0
  5. package/dist/tool/commands/doctor.d.ts.map +1 -0
  6. package/dist/tool/commands/doctor.js +862 -0
  7. package/dist/tool/commands/doctor.js.map +1 -0
  8. package/dist/tool/commands/explain.d.ts +13 -0
  9. package/dist/tool/commands/explain.d.ts.map +1 -0
  10. package/dist/tool/commands/explain.js +299 -0
  11. package/dist/tool/commands/explain.js.map +1 -0
  12. package/dist/tool/commands/list.d.ts +16 -0
  13. package/dist/tool/commands/list.d.ts.map +1 -0
  14. package/dist/tool/commands/list.js +121 -0
  15. package/dist/tool/commands/list.js.map +1 -0
  16. package/dist/tool/commands/plan.d.ts +67 -0
  17. package/dist/tool/commands/plan.d.ts.map +1 -0
  18. package/dist/tool/commands/plan.js +851 -0
  19. package/dist/tool/commands/plan.js.map +1 -0
  20. package/dist/tool/questionnaire/composer.d.ts +16 -2
  21. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  22. package/dist/tool/questionnaire/composer.js +411 -200
  23. package/dist/tool/questionnaire/composer.js.map +1 -1
  24. package/dist/tool/readme/markdown-parser.d.ts.map +1 -1
  25. package/dist/tool/readme/markdown-parser.js.map +1 -1
  26. package/dist/tool/readme/readme-generator.d.ts.map +1 -1
  27. package/dist/tool/readme/readme-generator.js +11 -6
  28. package/dist/tool/readme/readme-generator.js.map +1 -1
  29. package/dist/tool/schema/deployment-targets.d.ts +77 -0
  30. package/dist/tool/schema/deployment-targets.d.ts.map +1 -0
  31. package/dist/tool/schema/deployment-targets.js +91 -0
  32. package/dist/tool/schema/deployment-targets.js.map +1 -0
  33. package/dist/tool/schema/manifest-migrations.d.ts +51 -0
  34. package/dist/tool/schema/manifest-migrations.d.ts.map +1 -0
  35. package/dist/tool/schema/manifest-migrations.js +159 -0
  36. package/dist/tool/schema/manifest-migrations.js.map +1 -0
  37. package/dist/tool/schema/overlay-loader.d.ts +1 -1
  38. package/dist/tool/schema/overlay-loader.d.ts.map +1 -1
  39. package/dist/tool/schema/overlay-loader.js +42 -14
  40. package/dist/tool/schema/overlay-loader.js.map +1 -1
  41. package/dist/tool/schema/types.d.ts +62 -2
  42. package/dist/tool/schema/types.d.ts.map +1 -1
  43. package/dist/tool/utils/gitignore.d.ts +15 -0
  44. package/dist/tool/utils/gitignore.d.ts.map +1 -0
  45. package/dist/tool/utils/gitignore.js +41 -0
  46. package/dist/tool/utils/gitignore.js.map +1 -0
  47. package/dist/tool/utils/merge.d.ts +134 -0
  48. package/dist/tool/utils/merge.d.ts.map +1 -0
  49. package/dist/tool/utils/merge.js +277 -0
  50. package/dist/tool/utils/merge.js.map +1 -0
  51. package/dist/tool/utils/port-utils.d.ts +29 -0
  52. package/dist/tool/utils/port-utils.d.ts.map +1 -0
  53. package/dist/tool/utils/port-utils.js +128 -0
  54. package/dist/tool/utils/port-utils.js.map +1 -0
  55. package/dist/tool/utils/services-export.d.ts +14 -0
  56. package/dist/tool/utils/services-export.d.ts.map +1 -0
  57. package/dist/tool/utils/services-export.js +478 -0
  58. package/dist/tool/utils/services-export.js.map +1 -0
  59. package/dist/tool/utils/summary.d.ts +69 -0
  60. package/dist/tool/utils/summary.d.ts.map +1 -0
  61. package/dist/tool/utils/summary.js +260 -0
  62. package/dist/tool/utils/summary.js.map +1 -0
  63. package/dist/tool/utils/version.d.ts +9 -0
  64. package/dist/tool/utils/version.d.ts.map +1 -0
  65. package/dist/tool/utils/version.js +32 -0
  66. package/dist/tool/utils/version.js.map +1 -0
  67. package/docs/architecture.md +25 -21
  68. package/docs/deployment-targets.md +150 -0
  69. package/docs/discovery-commands.md +442 -0
  70. package/docs/merge-strategy.md +700 -0
  71. package/docs/minimal-and-editor.md +265 -0
  72. package/docs/overlay-imports.md +209 -0
  73. package/docs/overlay-manifest-refactoring.md +2 -2
  74. package/docs/overlay-metadata-archive.md +1 -1
  75. package/docs/overlays.md +139 -28
  76. package/docs/presets-architecture.md +3 -3
  77. package/docs/presets.md +1 -1
  78. package/docs/publishing.md +36 -35
  79. package/docs/team-workflow.md +540 -0
  80. package/overlays/.presets/data-engineering.yml +392 -0
  81. package/overlays/.presets/event-sourced-service.yml +262 -0
  82. package/overlays/.presets/frontend.yml +287 -0
  83. package/overlays/.presets/k8s-operator-dev.yml +462 -0
  84. package/overlays/{presets → .presets}/microservice.yml +32 -6
  85. package/overlays/.presets/web-api.yml +129 -0
  86. package/overlays/.registry/README.md +1 -1
  87. package/overlays/.registry/deployment-targets.yml +54 -0
  88. package/overlays/.shared/README.md +43 -0
  89. package/overlays/.shared/compose/common-healthchecks.yml +38 -0
  90. package/overlays/.shared/otel/instrumentation.env +20 -0
  91. package/overlays/.shared/otel/otel-base-config.yaml +30 -0
  92. package/overlays/.shared/vscode/recommended-extensions.json +14 -0
  93. package/overlays/README.md +1 -1
  94. package/overlays/cloudflared/README.md +190 -0
  95. package/overlays/cloudflared/devcontainer.patch.json +3 -0
  96. package/overlays/cloudflared/overlay.yml +15 -0
  97. package/overlays/cloudflared/setup.sh +49 -0
  98. package/overlays/cloudflared/verify.sh +21 -0
  99. package/overlays/codex/overlay.yml +1 -0
  100. package/overlays/direnv/README.md +6 -4
  101. package/overlays/direnv/setup.sh +0 -12
  102. package/overlays/duckdb/README.md +274 -0
  103. package/overlays/duckdb/devcontainer.patch.json +10 -0
  104. package/overlays/duckdb/overlay.yml +17 -0
  105. package/overlays/duckdb/setup.sh +45 -0
  106. package/overlays/duckdb/verify.sh +32 -0
  107. package/overlays/git-helpers/overlay.yml +1 -0
  108. package/overlays/grafana/README.md +5 -5
  109. package/overlays/grafana/dashboard-provider.yml +1 -1
  110. package/overlays/grafana/docker-compose.yml +2 -2
  111. package/overlays/grafana/overlay.yml +6 -1
  112. package/overlays/grpc-tools/README.md +242 -0
  113. package/overlays/grpc-tools/devcontainer.patch.json +14 -0
  114. package/overlays/grpc-tools/overlay.yml +14 -0
  115. package/overlays/grpc-tools/setup.sh +57 -0
  116. package/overlays/grpc-tools/verify.sh +47 -0
  117. package/overlays/jaeger/overlay.yml +16 -3
  118. package/overlays/jupyter/.env.example +6 -0
  119. package/overlays/jupyter/README.md +210 -0
  120. package/overlays/jupyter/devcontainer.patch.json +14 -0
  121. package/overlays/jupyter/docker-compose.yml +23 -0
  122. package/overlays/jupyter/overlay.yml +18 -0
  123. package/overlays/jupyter/verify.sh +35 -0
  124. package/overlays/keycloak/.env.example +5 -0
  125. package/overlays/keycloak/README.md +238 -0
  126. package/overlays/keycloak/devcontainer.patch.json +17 -0
  127. package/overlays/keycloak/docker-compose.yml +32 -0
  128. package/overlays/keycloak/overlay.yml +23 -0
  129. package/overlays/keycloak/verify.sh +54 -0
  130. package/overlays/kind/README.md +221 -0
  131. package/overlays/kind/devcontainer.patch.json +10 -0
  132. package/overlays/kind/overlay.yml +18 -0
  133. package/overlays/kind/setup.sh +43 -0
  134. package/overlays/kind/verify.sh +40 -0
  135. package/overlays/localstack/.env.example +6 -0
  136. package/overlays/localstack/README.md +188 -0
  137. package/overlays/localstack/devcontainer.patch.json +21 -0
  138. package/overlays/localstack/docker-compose.yml +25 -0
  139. package/overlays/localstack/overlay.yml +18 -0
  140. package/overlays/localstack/verify.sh +47 -0
  141. package/overlays/loki/overlay.yml +6 -1
  142. package/overlays/mailpit/.env.example +4 -0
  143. package/overlays/mailpit/README.md +191 -0
  144. package/overlays/mailpit/devcontainer.patch.json +20 -0
  145. package/overlays/mailpit/docker-compose.yml +17 -0
  146. package/overlays/mailpit/overlay.yml +26 -0
  147. package/overlays/mailpit/verify.sh +52 -0
  148. package/overlays/modern-cli-tools/overlay.yml +1 -0
  149. package/overlays/mongodb/overlay.yml +12 -2
  150. package/overlays/mysql/overlay.yml +12 -2
  151. package/overlays/nats/overlay.yml +12 -2
  152. package/overlays/ngrok/overlay.yml +2 -1
  153. package/overlays/openapi-tools/README.md +243 -0
  154. package/overlays/openapi-tools/devcontainer.patch.json +10 -0
  155. package/overlays/openapi-tools/overlay.yml +16 -0
  156. package/overlays/openapi-tools/setup.sh +45 -0
  157. package/overlays/openapi-tools/verify.sh +51 -0
  158. package/overlays/otel-collector/overlay.yml.example +26 -0
  159. package/overlays/postgres/overlay.yml +6 -1
  160. package/overlays/prometheus/overlay.yml +6 -1
  161. package/overlays/python/README.md +51 -35
  162. package/overlays/python/devcontainer.patch.json +7 -4
  163. package/overlays/python/setup.sh +50 -23
  164. package/overlays/python/verify.sh +29 -1
  165. package/overlays/rabbitmq/overlay.yml +12 -2
  166. package/overlays/redis/overlay.yml +6 -1
  167. package/overlays/tilt/README.md +259 -0
  168. package/overlays/tilt/devcontainer.patch.json +17 -0
  169. package/overlays/tilt/overlay.yml +19 -0
  170. package/overlays/tilt/setup.sh +25 -0
  171. package/overlays/tilt/verify.sh +24 -0
  172. package/package.json +8 -6
  173. package/tool/README.md +12 -16
  174. package/tool/schema/overlay-manifest.schema.json +64 -4
  175. package/tool/schema/superposition-manifest.schema.json +104 -0
  176. package/overlays/presets/web-api.yml +0 -109
  177. /package/overlays/{presets → .presets}/docs-site.yml +0 -0
  178. /package/overlays/{presets → .presets}/fullstack.yml +0 -0
@@ -0,0 +1,238 @@
1
+ # Keycloak Overlay
2
+
3
+ Open-source identity and access management for developing apps with OAuth2/OIDC authentication.
4
+
5
+ ## Features
6
+
7
+ - **Keycloak 26** - Latest stable version with OIDC/OAuth2 support
8
+ - **Admin console** - Web UI for managing realms, clients, and users (port 8180)
9
+ - **OIDC/OAuth2** - Full OpenID Connect and OAuth 2.0 support
10
+ - **PostgreSQL backend** - Uses the PostgreSQL overlay as database
11
+ - **Docker Compose service** - Runs as separate container
12
+ - **Development mode** - Pre-configured for local development (no TLS required)
13
+
14
+ ## How It Works
15
+
16
+ This overlay adds Keycloak as a Docker Compose service alongside your development container. It requires the `postgres` overlay to provide the database backend.
17
+
18
+ **Architecture:**
19
+
20
+ ```
21
+ Development Container
22
+ └─ Your application code
23
+ └─ Connects to keycloak:8180 for auth
24
+
25
+ Keycloak Container (port 8180)
26
+ └─ Admin console
27
+ └─ OIDC/OAuth2 endpoints
28
+ └─ Connects to postgres:5432
29
+
30
+ PostgreSQL Container (port 5432)
31
+ └─ Keycloak database storage
32
+ ```
33
+
34
+ The Keycloak service is accessible from the dev container using the hostname `keycloak`.
35
+
36
+ ## Configuration
37
+
38
+ ### Environment Variables
39
+
40
+ The overlay includes a `.env.example` file. Copy it to `.env` and customize:
41
+
42
+ ```bash
43
+ cd .devcontainer
44
+ cp .env.example .env
45
+ ```
46
+
47
+ **Default values (.env.example):**
48
+
49
+ ```bash
50
+ # Keycloak Configuration
51
+ KEYCLOAK_VERSION=26.0
52
+ KEYCLOAK_PORT=8180
53
+ KEYCLOAK_ADMIN=admin
54
+ KEYCLOAK_ADMIN_PASSWORD=admin
55
+ ```
56
+
57
+ âš ī¸ **Security Note:** Default credentials (`admin`/`admin`) are for development only. Never use these in production.
58
+
59
+ ### PostgreSQL Integration
60
+
61
+ Keycloak uses the PostgreSQL overlay's environment variables:
62
+
63
+ ```bash
64
+ POSTGRES_DB=devdb # Database name
65
+ POSTGRES_USER=postgres # Database user
66
+ POSTGRES_PASSWORD=postgres # Database password
67
+ ```
68
+
69
+ These are configured in the `postgres` overlay's `.env.example`.
70
+
71
+ ## Common Commands
72
+
73
+ ### Access Admin Console
74
+
75
+ ```bash
76
+ # Open in browser
77
+ open http://localhost:8180
78
+
79
+ # Admin credentials
80
+ # Username: admin (or KEYCLOAK_ADMIN value)
81
+ # Password: admin (or KEYCLOAK_ADMIN_PASSWORD value)
82
+ ```
83
+
84
+ ### Realm Management
85
+
86
+ ```bash
87
+ # List realms via Admin REST API
88
+ curl -s \
89
+ -u admin:admin \
90
+ http://localhost:8180/admin/realms | jq '.[].realm'
91
+
92
+ # Create a new realm
93
+ curl -s -X POST \
94
+ -H "Content-Type: application/json" \
95
+ -u admin:admin \
96
+ http://localhost:8180/admin/realms \
97
+ -d '{"realm": "myrealm", "enabled": true}'
98
+ ```
99
+
100
+ ### OIDC Discovery
101
+
102
+ ```bash
103
+ # Discover OIDC endpoints for the master realm
104
+ curl -s http://localhost:8180/realms/master/.well-known/openid-configuration | jq .
105
+
106
+ # Get discovery for a custom realm
107
+ curl -s http://localhost:8180/realms/myrealm/.well-known/openid-configuration | jq .
108
+ ```
109
+
110
+ ### Client Credentials Flow
111
+
112
+ ```bash
113
+ # Get access token using client credentials
114
+ curl -s -X POST \
115
+ http://localhost:8180/realms/master/protocol/openid-connect/token \
116
+ -d "client_id=admin-cli" \
117
+ -d "username=admin" \
118
+ -d "password=admin" \
119
+ -d "grant_type=password" | jq .access_token
120
+ ```
121
+
122
+ ### Token Introspection
123
+
124
+ ```bash
125
+ TOKEN=$(curl -s -X POST \
126
+ http://localhost:8180/realms/master/protocol/openid-connect/token \
127
+ -d "client_id=admin-cli" \
128
+ -d "username=admin" \
129
+ -d "password=admin" \
130
+ -d "grant_type=password" | jq -r .access_token)
131
+
132
+ # Decode token (base64)
133
+ echo "$TOKEN" | cut -d. -f2 | base64 -d 2>/dev/null | jq .
134
+ ```
135
+
136
+ ## Application Integration
137
+
138
+ ### Node.js (using openid-client)
139
+
140
+ ```javascript
141
+ import { Issuer } from 'openid-client';
142
+
143
+ const keycloakIssuer = await Issuer.discover('http://keycloak:8180/realms/myrealm');
144
+
145
+ const client = new keycloakIssuer.Client({
146
+ client_id: 'my-app',
147
+ client_secret: 'my-secret',
148
+ redirect_uris: ['http://localhost:3000/callback'],
149
+ response_types: ['code'],
150
+ });
151
+ ```
152
+
153
+ ### Python (using requests-oauthlib)
154
+
155
+ ```python
156
+ from requests_oauthlib import OAuth2Session
157
+
158
+ oauth = OAuth2Session(
159
+ client_id="my-app",
160
+ redirect_uri="http://localhost:5000/callback",
161
+ scope=["openid", "profile", "email"]
162
+ )
163
+
164
+ authorization_url, state = oauth.authorization_url(
165
+ "http://keycloak:8180/realms/myrealm/protocol/openid-connect/auth"
166
+ )
167
+ ```
168
+
169
+ ### .NET (using Microsoft.AspNetCore.Authentication.OpenIdConnect)
170
+
171
+ ```csharp
172
+ builder.Services.AddAuthentication(options => {
173
+ options.DefaultScheme = "Cookies";
174
+ options.DefaultChallengeScheme = "oidc";
175
+ })
176
+ .AddCookie("Cookies")
177
+ .AddOpenIdConnect("oidc", options => {
178
+ options.Authority = "http://keycloak:8180/realms/myrealm";
179
+ options.ClientId = "my-app";
180
+ options.ClientSecret = "my-secret";
181
+ options.ResponseType = "code";
182
+ options.RequireHttpsMetadata = false; // Development only
183
+ });
184
+ ```
185
+
186
+ ## Use Cases
187
+
188
+ - **OAuth2/OIDC integration testing** - Test authentication flows end-to-end
189
+ - **Multi-tenant applications** - Create separate realms per tenant
190
+ - **SSO development** - Single Sign-On across multiple local services
191
+ - **Identity federation** - Test social login, LDAP, SAML integration
192
+ - **Role-based access control** - Define and test permissions locally
193
+
194
+ ## Troubleshooting
195
+
196
+ ### Keycloak takes too long to start
197
+
198
+ Keycloak can take 60–90 seconds on first startup (database schema creation). Wait for the health check to pass:
199
+
200
+ ```bash
201
+ docker-compose logs -f keycloak
202
+ # Look for: "Keycloak X.X started"
203
+ ```
204
+
205
+ ### Database connection errors
206
+
207
+ Ensure PostgreSQL is running and healthy before Keycloak starts:
208
+
209
+ ```bash
210
+ docker-compose ps postgres
211
+ # Should show "healthy"
212
+ ```
213
+
214
+ ### Cannot connect from application
215
+
216
+ Use `keycloak` (not `localhost`) as the hostname when connecting from inside the container:
217
+
218
+ ```bash
219
+ # Correct (from inside dev container)
220
+ http://keycloak:8180/realms/master
221
+
222
+ # Correct (from host machine browser)
223
+ http://localhost:8180/realms/master
224
+ ```
225
+
226
+ ## References
227
+
228
+ - [Keycloak Documentation](https://www.keycloak.org/documentation)
229
+ - [Keycloak Admin REST API](https://www.keycloak.org/docs-api/latest/rest-api/)
230
+ - [OpenID Connect Specification](https://openid.net/connect/)
231
+ - [Keycloak Docker Image](https://quay.io/repository/keycloak/keycloak)
232
+
233
+ **Related Overlays:**
234
+
235
+ - `postgres` - Required database backend
236
+ - `nodejs` - Node.js application development
237
+ - `python` - Python application development
238
+ - `dotnet` - .NET application development
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "runServices": ["keycloak"],
4
+ "_serviceOrder": 10,
5
+ "forwardPorts": [8180],
6
+ "portsAttributes": {
7
+ "8180": {
8
+ "label": "Keycloak Admin Console",
9
+ "onAutoForward": "openBrowser"
10
+ }
11
+ },
12
+ "remoteEnv": {
13
+ "KEYCLOAK_HOST": "keycloak",
14
+ "KEYCLOAK_PORT": "8180",
15
+ "KEYCLOAK_ISSUER": "http://keycloak:8180/realms/master"
16
+ }
17
+ }
@@ -0,0 +1,32 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ keycloak:
5
+ image: quay.io/keycloak/keycloak:${KEYCLOAK_VERSION:-26.0}
6
+ command: start-dev
7
+ restart: unless-stopped
8
+ environment:
9
+ KC_DB: postgres
10
+ KC_DB_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-devdb}
11
+ KC_DB_USERNAME: ${POSTGRES_USER:-postgres}
12
+ KC_DB_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
13
+ KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
14
+ KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
15
+ KC_HTTP_PORT: 8180
16
+ KC_HOSTNAME_STRICT: 'false'
17
+ KC_HTTP_ENABLED: 'true'
18
+ ports:
19
+ - '${KEYCLOAK_PORT:-8180}:8180'
20
+ depends_on:
21
+ - postgres
22
+ networks:
23
+ - devnet
24
+ healthcheck:
25
+ test: ['CMD-SHELL', 'curl -sf http://localhost:8180/health/ready || exit 1']
26
+ interval: 15s
27
+ timeout: 10s
28
+ retries: 10
29
+ start_period: 60s
30
+
31
+ networks:
32
+ devnet:
@@ -0,0 +1,23 @@
1
+ id: keycloak
2
+ name: Keycloak
3
+ description: Open-source identity and access management (OIDC/OAuth2)
4
+ category: dev
5
+ supports:
6
+ - compose
7
+ requires:
8
+ - postgres
9
+ suggests: []
10
+ conflicts: []
11
+ tags:
12
+ - dev
13
+ - auth
14
+ - oidc
15
+ - oauth2
16
+ - identity
17
+ ports:
18
+ - port: 8180
19
+ service: keycloak
20
+ protocol: http
21
+ description: Keycloak admin console and auth endpoints
22
+ path: /
23
+ onAutoForward: openBrowser
@@ -0,0 +1,54 @@
1
+ #!/bin/bash
2
+ # Verification script for Keycloak overlay
3
+ # Confirms Keycloak is running and accessible
4
+
5
+ set -e
6
+
7
+ echo "🔍 Verifying Keycloak overlay..."
8
+ echo ""
9
+
10
+ # Check if curl is available
11
+ echo "1ī¸âƒŖ Checking curl availability..."
12
+ if ! command -v curl &> /dev/null; then
13
+ echo " ❌ curl not found"
14
+ exit 1
15
+ fi
16
+ echo " ✅ curl found"
17
+
18
+ # Check Keycloak health endpoint
19
+ echo ""
20
+ echo "2ī¸âƒŖ Checking Keycloak service..."
21
+ KEYCLOAK_HOST="${KEYCLOAK_HOST:-keycloak}"
22
+ KEYCLOAK_PORT="${KEYCLOAK_PORT:-8180}"
23
+ KEYCLOAK_READY=false
24
+
25
+ for i in {1..40}; do
26
+ if curl -sf "http://${KEYCLOAK_HOST}:${KEYCLOAK_PORT}/health/ready" &> /dev/null; then
27
+ echo " ✅ Keycloak service is ready"
28
+ KEYCLOAK_READY=true
29
+ break
30
+ fi
31
+ sleep 3
32
+ done
33
+
34
+ if [ "$KEYCLOAK_READY" = false ]; then
35
+ echo " ❌ Keycloak service not ready after 2 minutes"
36
+ echo " â„šī¸ Keycloak can take a while to start on first run"
37
+ exit 1
38
+ fi
39
+
40
+ # Check OIDC discovery endpoint
41
+ echo ""
42
+ echo "3ī¸âƒŖ Checking OIDC discovery endpoint..."
43
+ if curl -sf "http://${KEYCLOAK_HOST}:${KEYCLOAK_PORT}/realms/master/.well-known/openid-configuration" &> /dev/null; then
44
+ echo " ✅ OIDC discovery endpoint is accessible"
45
+ else
46
+ echo " ❌ OIDC discovery endpoint not accessible"
47
+ exit 1
48
+ fi
49
+
50
+ echo ""
51
+ echo "✅ Keycloak overlay verification complete"
52
+ echo " Admin console: http://localhost:${KEYCLOAK_PORT}"
53
+ echo " Admin credentials: admin / admin (default)"
54
+ echo " OIDC discovery: http://localhost:${KEYCLOAK_PORT}/realms/master/.well-known/openid-configuration"
@@ -0,0 +1,221 @@
1
+ # kind (Kubernetes in Docker) Overlay
2
+
3
+ Local Kubernetes cluster for development and testing using kind.
4
+
5
+ ## Features
6
+
7
+ - **kind** - Kubernetes in Docker for local cluster creation
8
+ - **Multi-node support** - Create single or multi-node clusters
9
+ - **Fast startup** - Lightweight compared to traditional VMs
10
+ - **Docker-based** - Uses Docker containers as Kubernetes nodes
11
+ - **Production-like** - Runs actual Kubernetes, not a simulator
12
+
13
+ ## How It Works
14
+
15
+ This overlay installs kind (Kubernetes in Docker), a tool for running local Kubernetes clusters using Docker containers as nodes. It requires Docker-in-Docker to function.
16
+
17
+ **Dependencies:**
18
+
19
+ - `docker-in-docker` (required) - Provides Docker daemon for kind clusters
20
+
21
+ **Suggested overlays:**
22
+
23
+ - `kubectl-helm` - Kubernetes CLI and Helm package manager
24
+
25
+ ## Installation
26
+
27
+ kind is installed automatically during devcontainer creation via `setup.sh`:
28
+
29
+ - Downloads kind binary for your architecture (amd64/arm64)
30
+ - Installs to `/usr/local/bin/kind`
31
+ - Verifies Docker access
32
+
33
+ ## Common Commands
34
+
35
+ ### Cluster Management
36
+
37
+ ```bash
38
+ # Create a cluster
39
+ kind create cluster --name dev
40
+
41
+ # Create cluster with custom config
42
+ cat <<EOF | kind create cluster --config=-
43
+ kind: Cluster
44
+ apiVersion: kind.x-k8s.io/v1alpha4
45
+ nodes:
46
+ - role: control-plane
47
+ - role: worker
48
+ - role: worker
49
+ EOF
50
+
51
+ # List clusters
52
+ kind get clusters
53
+
54
+ # Delete a cluster
55
+ kind delete cluster --name dev
56
+ ```
57
+
58
+ ### Working with Clusters
59
+
60
+ ```bash
61
+ # Get kubeconfig
62
+ kind get kubeconfig --name dev
63
+
64
+ # Load Docker image into cluster
65
+ docker pull nginx:latest
66
+ kind load docker-image nginx:latest --name dev
67
+
68
+ # Export logs
69
+ kind export logs /tmp/kind-logs --name dev
70
+ ```
71
+
72
+ ### kubectl Integration
73
+
74
+ ```bash
75
+ # kind automatically updates kubeconfig
76
+ kubectl cluster-info --context kind-dev
77
+
78
+ # Deploy workload
79
+ kubectl create deployment nginx --image=nginx
80
+ kubectl expose deployment nginx --port=80 --type=NodePort
81
+
82
+ # Access service
83
+ kubectl port-forward service/nginx 8080:80
84
+ ```
85
+
86
+ ## Configuration
87
+
88
+ ### Custom Cluster Configuration
89
+
90
+ Create a `kind-config.yaml`:
91
+
92
+ ```yaml
93
+ kind: Cluster
94
+ apiVersion: kind.x-k8s.io/v1alpha4
95
+ nodes:
96
+ - role: control-plane
97
+ kubeadmConfigPatches:
98
+ - |
99
+ kind: InitConfiguration
100
+ nodeRegistration:
101
+ kubeletExtraArgs:
102
+ node-labels: "ingress-ready=true"
103
+ extraPortMappings:
104
+ - containerPort: 80
105
+ hostPort: 80
106
+ protocol: TCP
107
+ - containerPort: 443
108
+ hostPort: 443
109
+ protocol: TCP
110
+ - role: worker
111
+ - role: worker
112
+ ```
113
+
114
+ Use it:
115
+
116
+ ```bash
117
+ kind create cluster --name dev --config kind-config.yaml
118
+ ```
119
+
120
+ ### Version Control
121
+
122
+ Specify kind version in setup.sh via environment variable:
123
+
124
+ ```bash
125
+ KIND_VERSION=v0.22.0
126
+ ```
127
+
128
+ ## Use Cases
129
+
130
+ - **Kubernetes development** - Develop and test K8s applications locally
131
+ - **Operator development** - Build and test Kubernetes operators
132
+ - **CI/CD testing** - Run K8s tests in CI pipelines
133
+ - **Learning Kubernetes** - Experiment with K8s without cloud costs
134
+ - **Multi-cluster scenarios** - Test federation, service mesh across clusters
135
+
136
+ **Integrates well with:**
137
+
138
+ - `kubectl-helm` - Kubernetes CLI and Helm
139
+ - `tilt` - Live reload for Kubernetes development
140
+ - `skaffold` - Build/deploy automation for K8s
141
+ - `terraform` - Infrastructure as Code
142
+ - `nodejs`, `python`, `dotnet` - Application development
143
+
144
+ ## Benefits vs k3d
145
+
146
+ | Feature | kind | k3d |
147
+ | --------------------- | -------------------------- | ---------------------------- |
148
+ | **Distribution** | ✅ Full Kubernetes | âš ī¸ k3s (lightweight variant) |
149
+ | **Conformance** | ✅ 100% conformant | ✅ High conformance |
150
+ | **Speed** | âš ī¸ Moderate startup | ✅ Faster startup |
151
+ | **Resource Usage** | âš ī¸ Higher | ✅ Lower |
152
+ | **Production Parity** | ✅ Identical to production | âš ī¸ Some differences |
153
+ | **Maturity** | ✅ CNCF project | ✅ CNCF sandbox |
154
+
155
+ **When to use kind:**
156
+
157
+ - Need 100% Kubernetes compatibility
158
+ - Testing for production environments
159
+ - Developing Kubernetes itself or operators
160
+ - Don't mind slightly higher resource usage
161
+
162
+ **When to use k3d:**
163
+
164
+ - Need faster iteration cycles
165
+ - Limited system resources
166
+ - Don't need full Kubernetes features
167
+
168
+ ## Troubleshooting
169
+
170
+ ### Cluster Creation Fails
171
+
172
+ Check Docker is running:
173
+
174
+ ```bash
175
+ docker ps
176
+ ```
177
+
178
+ Check Docker has sufficient resources (4GB+ RAM recommended).
179
+
180
+ ### Network Issues
181
+
182
+ kind uses Docker networks. If having network issues:
183
+
184
+ ```bash
185
+ # Delete and recreate cluster
186
+ kind delete cluster --name dev
187
+ kind create cluster --name dev
188
+ ```
189
+
190
+ ### Image Pull Failures
191
+
192
+ Load images manually:
193
+
194
+ ```bash
195
+ docker pull myimage:tag
196
+ kind load docker-image myimage:tag --name dev
197
+ ```
198
+
199
+ ### Persistent Volumes
200
+
201
+ kind uses local path provisioner. PVs are stored in Docker containers:
202
+
203
+ ```bash
204
+ # Inspect node container
205
+ docker exec -it dev-control-plane ls /var/local-path-provisioner
206
+ ```
207
+
208
+ ## References
209
+
210
+ - [kind Documentation](https://kind.sigs.k8s.io/)
211
+ - [kind Quick Start](https://kind.sigs.k8s.io/docs/user/quick-start/)
212
+ - [kind Configuration](https://kind.sigs.k8s.io/docs/user/configuration/)
213
+ - [Kubernetes Documentation](https://kubernetes.io/docs/)
214
+
215
+ **Related Overlays:**
216
+
217
+ - `docker-in-docker` - Required for kind to function
218
+ - `kubectl-helm` - Kubernetes CLI and Helm
219
+ - `tilt` - Live reload for Kubernetes
220
+ - `skaffold` - K8s build orchestration
221
+ - `k3d` - Alternative lightweight K8s (conflicts)
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "features": {
4
+ "./features/cross-distro-packages": {
5
+ "apt": "curl",
6
+ "apk": "curl"
7
+ }
8
+ },
9
+ "postCreateCommand": "bash .devcontainer/scripts/setup-kind.sh"
10
+ }
@@ -0,0 +1,18 @@
1
+ id: kind
2
+ name: kind (Kubernetes in Docker)
3
+ description: Local Kubernetes cluster for development and testing
4
+ category: cloud
5
+ supports: []
6
+ requires:
7
+ - docker-in-docker
8
+ suggests:
9
+ - kubectl-helm
10
+ conflicts:
11
+ - k3d
12
+ tags:
13
+ - cloud
14
+ - kubernetes
15
+ - k8s
16
+ - kind
17
+ - testing
18
+ ports: []
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ # Setup script for kind (Kubernetes in Docker)
3
+
4
+ set -e
5
+
6
+ echo "🔧 Setting up kind (Kubernetes in Docker)..."
7
+
8
+ # Detect architecture
9
+ ARCH=$(uname -m)
10
+ case $ARCH in
11
+ x86_64)
12
+ KIND_ARCH="amd64"
13
+ ;;
14
+ aarch64|arm64)
15
+ KIND_ARCH="arm64"
16
+ ;;
17
+ *)
18
+ echo "❌ Unsupported architecture: $ARCH"
19
+ exit 1
20
+ ;;
21
+ esac
22
+
23
+ # Install kind
24
+ KIND_VERSION="${KIND_VERSION:-v0.22.0}"
25
+ echo "đŸ“Ļ Installing kind ${KIND_VERSION}..."
26
+
27
+ curl -Lo /tmp/kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-${KIND_ARCH}"
28
+ chmod +x /tmp/kind
29
+ sudo mv /tmp/kind /usr/local/bin/kind
30
+
31
+ # Verify installation
32
+ if command -v kind &> /dev/null; then
33
+ echo "✅ kind installed successfully"
34
+ kind version
35
+ else
36
+ echo "❌ kind installation failed"
37
+ exit 1
38
+ fi
39
+
40
+ echo "✅ kind setup complete"
41
+ echo ""
42
+ echo "â„šī¸ To create a cluster, run:"
43
+ echo " kind create cluster --name dev"
@@ -0,0 +1,40 @@
1
+ #!/bin/bash
2
+ # Verification script for kind overlay
3
+ # Confirms kind is installed
4
+
5
+ set -e
6
+
7
+ echo "🔍 Verifying kind overlay..."
8
+ echo ""
9
+
10
+ # Check kind is installed
11
+ echo "1ī¸âƒŖ Checking kind installation..."
12
+ if command -v kind &> /dev/null; then
13
+ kind version
14
+ echo " ✅ kind is installed"
15
+ else
16
+ echo " ❌ kind is not installed"
17
+ exit 1
18
+ fi
19
+
20
+ # Check Docker is available (required for kind)
21
+ echo ""
22
+ echo "2ī¸âƒŖ Checking Docker availability..."
23
+ if command -v docker &> /dev/null; then
24
+ docker version --format '{{.Server.Version}}' &> /dev/null
25
+ if [ $? -eq 0 ]; then
26
+ echo " ✅ Docker is available"
27
+ else
28
+ echo " ❌ Docker daemon not accessible"
29
+ exit 1
30
+ fi
31
+ else
32
+ echo " ❌ Docker CLI not found"
33
+ exit 1
34
+ fi
35
+
36
+ echo ""
37
+ echo "✅ kind overlay verification complete"
38
+ echo ""
39
+ echo "â„šī¸ To create a cluster, run:"
40
+ echo " kind create cluster --name dev"