Skip to content

Commit db977bf

Browse files
Copilotphrocker
andauthored
Build out GKE deployment infrastructure with full service support (#57)
* Initial plan * Update GCP deployment scripts to match local deployment capabilities Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com> * Update DNS management scripts and documentation for all subdomains Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com> * Add quick reference guide for GKE deployment Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com> * Change GCP deployment defaults to 'latest' when .gcp.env is missing Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
1 parent 0f55020 commit db977bf

9 files changed

Lines changed: 1077 additions & 67 deletions

File tree

.gcp.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ SENTRIUS_AGENT_VERSION=1.0.19
55
SENTRIUS_AI_AGENT_VERSION=1.0.0
66
LLMPROXY_VERSION=1.0.0
77
LAUNCHER_VERSION=1.0.0
8+
AGENTPROXY_VERSION=1.0.0
9+
SSHPROXY_VERSION=1.0.0
10+
RDPPROXY_VERSION=1.0.0
811
GITHUB_MCP_VERSION=1.0.0

ops-scripts/gcp/QUICKREF.md

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
# GKE Deployment Quick Reference
2+
3+
## Prerequisites Setup
4+
```bash
5+
# Authenticate with GCP
6+
gcloud auth login
7+
gcloud config set project sentrius-project
8+
9+
# Configure kubectl for GKE cluster
10+
gcloud container clusters get-credentials sentrius-autopilot-cluster-1 --region us-east1
11+
12+
# Verify cluster access
13+
kubectl cluster-info
14+
```
15+
16+
## Building and Pushing Images
17+
18+
### Build All Images for GCP
19+
```bash
20+
# Build all images and push to GCP registry
21+
./ops-scripts/base/build-images.sh gcp --all
22+
23+
# Build with no cache (clean build)
24+
./ops-scripts/base/build-images.sh gcp --all --no-cache
25+
```
26+
27+
### Build Specific Images
28+
```bash
29+
./ops-scripts/base/build-images.sh gcp --sentrius
30+
./ops-scripts/base/build-images.sh gcp --sentrius-keycloak
31+
./ops-scripts/base/build-images.sh gcp --sentrius-launcher-service
32+
./ops-scripts/base/build-images.sh gcp --sentrius-agent-proxy
33+
./ops-scripts/base/build-images.sh gcp --sentrius-ssh-proxy
34+
./ops-scripts/base/build-images.sh gcp --sentrius-rdp-proxy
35+
```
36+
37+
## Deployment
38+
39+
### Deploy New Tenant
40+
```bash
41+
# Deploy with TLS (recommended)
42+
./ops-scripts/gcp/deploy-helm.sh --tenant production
43+
44+
# Deploy without TLS (testing only)
45+
./ops-scripts/gcp/deploy-helm.sh --tenant test --no-tls
46+
```
47+
48+
### Access Points After Deployment
49+
```
50+
https://<tenant>.sentrius.cloud - Main application
51+
https://keycloak.<tenant>.sentrius.cloud - Keycloak authentication
52+
https://agentproxy.<tenant>.sentrius.cloud - Agent proxy
53+
https://rdpproxy.<tenant>.sentrius.cloud - RDP proxy
54+
```
55+
56+
## Monitoring and Troubleshooting
57+
58+
### Check Deployment Status
59+
```bash
60+
# Check main namespace
61+
kubectl get deployments -n <tenant>
62+
kubectl get pods -n <tenant>
63+
kubectl get services -n <tenant>
64+
kubectl get ingress -n <tenant>
65+
66+
# Check launcher namespace
67+
kubectl get deployments -n <tenant>-agents
68+
kubectl get pods -n <tenant>-agents
69+
```
70+
71+
### View Logs
72+
```bash
73+
# Main API logs
74+
kubectl logs -n <tenant> deployment/sentrius-sentrius -f
75+
76+
# Keycloak logs
77+
kubectl logs -n <tenant> deployment/sentrius-keycloak -f
78+
79+
# Launcher logs
80+
kubectl logs -n <tenant>-agents deployment/<tenant>-agents-launcherservice -f
81+
82+
# Get logs from specific pod
83+
kubectl logs -n <tenant> <pod-name> -f
84+
```
85+
86+
### Check Ingress and DNS
87+
```bash
88+
# Get LoadBalancer IP
89+
kubectl get ingress managed-cert-ingress-<tenant> -n <tenant>
90+
91+
# List DNS records for tenant
92+
gcloud dns record-sets list --zone=sentrius-cloud | grep <tenant>
93+
```
94+
95+
### Check Secrets
96+
```bash
97+
# List secrets
98+
kubectl get secrets -n <tenant>
99+
100+
# View secret content (base64 encoded)
101+
kubectl get secret <tenant>-keycloak-secrets -n <tenant> -o yaml
102+
103+
# Decode specific secret value
104+
kubectl get secret <tenant>-keycloak-secrets -n <tenant> -o jsonpath='{.data.db-password}' | base64 --decode
105+
```
106+
107+
## Updating Deployments
108+
109+
### Update Image Versions
110+
```bash
111+
# 1. Edit .gcp.env to update version numbers
112+
vim .gcp.env
113+
114+
# 2. Build and push new images
115+
./ops-scripts/base/build-images.sh gcp --all
116+
117+
# 3. Redeploy (automatically uses new versions)
118+
./ops-scripts/gcp/deploy-helm.sh --tenant <tenant>
119+
```
120+
121+
### Restart Existing Deployment
122+
```bash
123+
# For default namespace
124+
./ops-scripts/gcp/restart.sh
125+
126+
# For specific deployment
127+
kubectl rollout restart deployment/<deployment-name> -n <tenant>
128+
```
129+
130+
## DNS Management
131+
132+
### Manual DNS Record Creation
133+
```bash
134+
# Get ingress IP
135+
INGRESS_IP=$(kubectl get ingress managed-cert-ingress-<tenant> -n <tenant> -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
136+
137+
# Create DNS records
138+
./ops-scripts/gcp/create-subdomain.sh <tenant> $INGRESS_IP
139+
```
140+
141+
### Remove DNS Records
142+
```bash
143+
./ops-scripts/gcp/remove-subdomain.sh <tenant>
144+
```
145+
146+
## Cleanup
147+
148+
### Delete Specific Tenant
149+
```bash
150+
# Warning: This is destructive!
151+
./ops-scripts/gcp/destroy-tenant.sh <tenant>
152+
```
153+
154+
### Scale Down Cluster
155+
```bash
156+
# Reduce to zero nodes (stops billing for compute)
157+
./ops-scripts/gcp/spindown.sh
158+
```
159+
160+
## Validation
161+
162+
### Test Helm Chart Rendering
163+
```bash
164+
# Test without actually deploying
165+
./ops-scripts/gcp/test-helm.sh <tenant>
166+
```
167+
168+
### Lint Helm Charts
169+
```bash
170+
helm lint sentrius-chart
171+
helm lint sentrius-chart-launcher
172+
```
173+
174+
## Common Issues
175+
176+
### Image Pull Errors
177+
```bash
178+
# Verify images exist in registry
179+
gcloud container images list --repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo
180+
181+
# Check specific image tags
182+
gcloud container images list-tags us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius
183+
```
184+
185+
### LoadBalancer IP Not Assigned
186+
```bash
187+
# Check ingress status
188+
kubectl describe ingress managed-cert-ingress-<tenant> -n <tenant>
189+
190+
# Check for any events or errors
191+
kubectl get events -n <tenant> --sort-by='.lastTimestamp'
192+
```
193+
194+
### Secret Issues
195+
```bash
196+
# Delete corrupted secrets
197+
kubectl delete secret <tenant>-keycloak-secrets -n <tenant>
198+
kubectl delete secret <tenant>-db-secret -n <tenant>
199+
200+
# Redeploy (new secrets will be generated)
201+
./ops-scripts/gcp/deploy-helm.sh --tenant <tenant>
202+
```
203+
204+
### DNS Propagation
205+
```bash
206+
# Check if DNS records exist
207+
gcloud dns record-sets list --zone=sentrius-cloud | grep <tenant>
208+
209+
# Test DNS resolution
210+
nslookup <tenant>.sentrius.cloud
211+
dig <tenant>.sentrius.cloud
212+
```
213+
214+
## Production Checklist
215+
216+
- [ ] All images built and pushed to GCP registry
217+
- [ ] .gcp.env has correct version numbers
218+
- [ ] GKE cluster is running and accessible
219+
- [ ] DNS zone configured correctly in base.sh
220+
- [ ] Deploy with --tenant flag (do not use --no-tls)
221+
- [ ] Verify LoadBalancer IP is assigned
222+
- [ ] Verify DNS records are created
223+
- [ ] Check all pods are running
224+
- [ ] Test access to all subdomains
225+
- [ ] Verify Keycloak authentication works
226+
- [ ] Check application logs for errors
227+
228+
## Environment Files
229+
230+
### .gcp.env (Version Numbers)
231+
```bash
232+
SENTRIUS_VERSION=1.0.48
233+
SENTRIUS_SSH_VERSION=1.0.7
234+
SENTRIUS_KEYCLOAK_VERSION=1.0.10
235+
SENTRIUS_AGENT_VERSION=1.0.19
236+
SENTRIUS_AI_AGENT_VERSION=1.0.0
237+
LLMPROXY_VERSION=1.0.0
238+
LAUNCHER_VERSION=1.0.0
239+
AGENTPROXY_VERSION=1.0.0
240+
SSHPROXY_VERSION=1.0.0
241+
RDPPROXY_VERSION=1.0.0
242+
GITHUB_MCP_VERSION=1.0.0
243+
```
244+
245+
### .generated.env (Auto-Generated Secrets)
246+
Created automatically by generate-secrets.sh, contains:
247+
- KEYCLOAK_DB_PASSWORD
248+
- KEYCLOAK_CLIENT_SECRET
249+
- KEYCLOAK_ADMIN_PASSWORD
250+
- DB_PASSWORD
251+
- KEYSTORE_PASSWORD
252+
- Various OAuth2 client secrets
253+
254+
## Support
255+
256+
For detailed documentation, see: `ops-scripts/gcp/README.md`

0 commit comments

Comments
 (0)