diff --git a/.gitignore b/.gitignore
index 26a0fee..6d3e153 100644
--- a/.gitignore
+++ b/.gitignore
@@ -362,3 +362,4 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
+/.claude
diff --git a/Directory.Build.props b/Directory.Build.props
index cdeeb1f..1dac947 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,12 +4,14 @@
enable
enable
-
Copyright © 2015-$([System.DateTime]::Now.Year) Petabridge
Petabridge
- 0.2.10
- Add TLS support for Akka.Remote in K8s deployment
+ 0.2.11
+ - Added Deployment-based Kubernetes overlay as alternative to StatefulSet for reduced rebalancing overhead
+- Refactored K8s configuration to be DRY - split base resources into separate files
+- Added `-Strategy` parameter to deploy.ps1 to choose between StatefulSet and Deployment strategies
+- Fixed deployment script error handling for better reliability
@@ -18,10 +20,8 @@
$(NoWarn);CS1591
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 9faed1b..9f4385e 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,9 @@ The version number is pulled from `Directory.Build.props` and automatically appl
The K8s manifests use [Kustomize](https://kustomize.io/) for configuration management:
* **Base configuration** (`k8s/base/`): Contains all core Kubernetes manifests without version tags
-* **Environment overlays** (`k8s/overlays/local/`): Environment-specific configurations that apply version tags
+* **Environment overlays**:
+ - `k8s/overlays/local/`: StatefulSet deployment with stable pod names
+ - `k8s/overlays/deployment/`: Deployment-based configuration with reduced rebalancing overhead
### Deployment Scripts
@@ -64,15 +66,24 @@ The K8s manifests use [Kustomize](https://kustomize.io/) for configuration manag
To deploy or update all services to your local Kubernetes cluster:
```powershell
-./k8s/deployAll.ps1
+# Deploy with StatefulSet (default)
+./k8s/deploy.ps1
+
+# Deploy with Deployment strategy (reduced rebalancing during updates)
+./k8s/deploy.ps1 -Strategy deployment
```
This script will:
1. Extract the version from `Directory.Build.props`
-2. Update the Kustomize overlay with the current version
-3. Create the `drawtogether` namespace if needed
-4. Apply all Kubernetes manifests using Kustomize
-5. Wait for the StatefulSet rollout to complete (with zero-downtime rolling updates)
+2. Build Docker images if they don't exist for the current version
+3. Update the Kustomize overlay with the current version
+4. Create the `drawtogether` namespace if needed
+5. Apply all Kubernetes manifests using Kustomize
+6. Wait for the rollout to complete (with zero-downtime rolling updates)
+
+**Deployment Strategies:**
+- **statefulset** (default): Stable pod names, predictable scaling, more rebalancing during updates
+- **deployment**: Dynamic pod names, surge updates, less rebalancing overhead
**This script is idempotent** - run it for both initial deployment and updates. Kubernetes automatically performs zero-downtime rolling updates when you change the image version.
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 46767fe..81b55a4 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,3 +1,10 @@
+#### 0.2.11 October 23rd 2024 ####
+
+- Added Deployment-based Kubernetes overlay as alternative to StatefulSet for reduced rebalancing overhead
+- Refactored K8s configuration to be DRY - split base resources into separate files
+- Added `-Strategy` parameter to deploy.ps1 to choose between StatefulSet and Deployment strategies
+- Fixed deployment script error handling for better reliability
+
#### 0.2.2 May 2nd 2024 ####
Added support for loading configuration via Msft.Ext-compatible environment variables, `appSettings.json`, and `appSettings.{ASPNETCORE_ENVIRONMENT}.json`
\ No newline at end of file
diff --git a/k8s/base/ingress.yaml b/k8s/base/ingress.yaml
new file mode 100644
index 0000000..54113ae
--- /dev/null
+++ b/k8s/base/ingress.yaml
@@ -0,0 +1,22 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: drawtogether-localhost
+ namespace: drawtogether
+ annotations:
+ kubernetes.io/ingress.class: "nginx" # Updated annotation
+ nginx.ingress.kubernetes.io/affinity: "cookie"
+ nginx.ingress.kubernetes.io/session-cookie-name: "route"
+ nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
+spec:
+ rules:
+ - host: drawtogether.localdev.me
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: drawtogether
+ port:
+ number: 8080
\ No newline at end of file
diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml
index 3c6393b..9b55e86 100644
--- a/k8s/base/kustomization.yaml
+++ b/k8s/base/kustomization.yaml
@@ -7,4 +7,6 @@ resources:
- sql-secret.yaml
- sql-server.yaml
- k8s-migrations-job.yaml
- - k8s-web-service.yaml
+ - ingress.yaml
+ - service.yaml
+ - statefulset.yaml
diff --git a/k8s/overlays/deployment/service.yaml b/k8s/base/service.yaml
similarity index 60%
rename from k8s/overlays/deployment/service.yaml
rename to k8s/base/service.yaml
index fbca694..9c9b370 100644
--- a/k8s/overlays/deployment/service.yaml
+++ b/k8s/base/service.yaml
@@ -6,10 +6,7 @@ metadata:
labels:
app: drawtogether
spec:
- # For Deployment, we use a regular Service (not headless)
- # publishNotReadyAddresses is still important for Akka.Discovery
publishNotReadyAddresses: true
- # We still use ClusterIP: None for discovery purposes
clusterIP: None
ports:
- port: 8558
@@ -19,4 +16,4 @@ spec:
- port: 8080
name: http
selector:
- app: drawtogether
+ app: drawtogether
\ No newline at end of file
diff --git a/k8s/base/k8s-web-service.yaml b/k8s/base/statefulset.yaml
similarity index 73%
rename from k8s/base/k8s-web-service.yaml
rename to k8s/base/statefulset.yaml
index 78af934..2077eba 100644
--- a/k8s/base/k8s-web-service.yaml
+++ b/k8s/base/statefulset.yaml
@@ -1,46 +1,3 @@
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: drawtogether-localhost
- namespace: drawtogether
- annotations:
- kubernetes.io/ingress.class: "nginx" # Updated annotation
- nginx.ingress.kubernetes.io/affinity: "cookie"
- nginx.ingress.kubernetes.io/session-cookie-name: "route"
- nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
-spec:
- rules:
- - host: drawtogether.localdev.me
- http:
- paths:
- - path: /
- pathType: Prefix
- backend:
- service:
- name: drawtogether
- port:
- number: 8080
----
-apiVersion: v1
-kind: Service
-metadata:
- name: drawtogether
- namespace: drawtogether
- labels:
- app: drawtogether
-spec:
- publishNotReadyAddresses: true
- clusterIP: None
- ports:
- - port: 8558
- name: management
- - port: 5055
- name: akka-remote
- - port: 8080
- name: http
- selector:
- app: drawtogether
----
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -69,9 +26,20 @@ spec:
- /bin/bash
- -c
- |
- echo "Waiting for migrations job to complete..."
- kubectl wait --for=condition=complete --timeout=300s job/drawtogether-migrations -n drawtogether
- echo "Migrations completed successfully!"
+ echo "Checking migrations status..."
+ # Check if job exists
+ if kubectl get job drawtogether-migrations -n drawtogether &>/dev/null; then
+ # Job exists, check if it's already completed
+ if kubectl get job drawtogether-migrations -n drawtogether -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep -q "True"; then
+ echo "Migrations job already completed"
+ else
+ echo "Waiting for migrations job to complete..."
+ kubectl wait --for=condition=complete --timeout=300s job/drawtogether-migrations -n drawtogether
+ echo "Migrations completed successfully!"
+ fi
+ else
+ echo "Migrations job not found (likely already completed and cleaned up)"
+ fi
containers:
- name: pbm-sidecar
image: petabridge/pbm:latest #sidecar
@@ -154,4 +122,4 @@ spec:
volumes:
- name: tls-cert
secret:
- secretName: akka-tls-cert
+ secretName: akka-tls-cert
\ No newline at end of file
diff --git a/k8s/create-tls-secret.ps1 b/k8s/create-tls-secret.ps1
deleted file mode 100644
index 45e28f3..0000000
--- a/k8s/create-tls-secret.ps1
+++ /dev/null
@@ -1,29 +0,0 @@
-# Create Kubernetes Secret for Akka.Remote TLS Certificate
-# This script creates a secret from the test certificate file
-
-$certPath = Join-Path (Join-Path (Join-Path $PSScriptRoot "..") "certs") "akka-node.pfx"
-
-if (-not (Test-Path $certPath)) {
- Write-Error "Certificate file not found at: $certPath"
- exit 1
-}
-
-Write-Host "Creating Kubernetes secret 'akka-tls-cert' from certificate..." -ForegroundColor Green
-
-# Delete the secret if it already exists (to allow updates)
-kubectl delete secret akka-tls-cert -n drawtogether 2>$null
-
-# Create the secret from the certificate file
-kubectl create secret generic akka-tls-cert `
- --from-file=akka-node.pfx=$certPath `
- --namespace=drawtogether
-
-if ($LASTEXITCODE -eq 0) {
- Write-Host "Secret 'akka-tls-cert' created successfully!" -ForegroundColor Green
- Write-Host ""
- Write-Host "To apply this configuration to your deployment:" -ForegroundColor Cyan
- Write-Host " kubectl apply -k k8s/overlays/local" -ForegroundColor Yellow
-} else {
- Write-Error "Failed to create secret"
- exit 1
-}
diff --git a/k8s/deploy.ps1 b/k8s/deploy.ps1
new file mode 100644
index 0000000..c669e51
--- /dev/null
+++ b/k8s/deploy.ps1
@@ -0,0 +1,198 @@
+#!/usr/bin/env pwsh
+# Deploys all Kubernetes services using Kustomize
+
+param(
+ [Parameter(HelpMessage="Deployment strategy: statefulset (default) or deployment")]
+ [ValidateSet("statefulset", "deployment")]
+ [string]$Strategy = "statefulset"
+)
+
+$ErrorActionPreference = "Stop"
+
+$namespace = "drawtogether"
+# Ensure $PSScriptRoot is set even when dot-sourcing
+$scriptDir = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Definition }
+
+# Resolve to absolute path to handle being called from different directories
+$scriptDir = (Get-Item $scriptDir).FullName
+
+# Map strategy to overlay directory
+$overlayName = switch($Strategy) {
+ "statefulset" { "local" }
+ "deployment" { "deployment" }
+}
+
+$overlayPath = Join-Path (Join-Path $scriptDir "overlays") $overlayName
+
+Write-Host "Deploying K8s resources using Kustomize with strategy [$Strategy] into namespace [$namespace]" -ForegroundColor Cyan
+Write-Host "Using overlay: $overlayPath" -ForegroundColor Yellow
+
+# Extract version from Directory.Build.props
+$buildPropsPath = Join-Path (Split-Path $scriptDir -Parent) "Directory.Build.props"
+if (-not (Test-Path $buildPropsPath)) {
+ Write-Error "Directory.Build.props not found at $buildPropsPath"
+ exit 1
+}
+
+Write-Host "Reading version from Directory.Build.props..." -ForegroundColor Yellow
+[xml]$buildProps = Get-Content $buildPropsPath
+$version = ($buildProps.Project.PropertyGroup | Where-Object { $_.VersionPrefix } | Select-Object -First 1).VersionPrefix.Trim()
+Write-Host "Found version: $version" -ForegroundColor Green
+
+# Check if Docker images exist with current version, build if missing
+Write-Host "Checking for Docker images..." -ForegroundColor Yellow
+$imagesToCheck = @("drawtogether:$version", "drawtogether-migrationservice:$version")
+$needBuild = $false
+
+foreach ($image in $imagesToCheck) {
+ $ErrorActionPreference = "Continue"
+ docker image inspect $image 2>&1 | Out-Null
+ $imageExists = $LASTEXITCODE -eq 0
+ $ErrorActionPreference = "Stop"
+
+ if (-not $imageExists) {
+ Write-Host "Image $image not found" -ForegroundColor Yellow
+ $needBuild = $true
+ } else {
+ Write-Host "Image $image exists" -ForegroundColor Green
+ }
+}
+
+if ($needBuild) {
+ Write-Host "Building Docker images for version $version..." -ForegroundColor Cyan
+ $solutionPath = Split-Path $scriptDir -Parent
+ Push-Location $solutionPath
+ try {
+ dotnet publish --os linux --arch x64 -c Release -t:PublishContainer
+ if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to build Docker images"
+ exit 1
+ }
+ Write-Host "Docker images built successfully" -ForegroundColor Green
+ } finally {
+ Pop-Location
+ }
+}
+
+# Update the kustomization.yaml with the current version
+$kustomizationPath = Join-Path $overlayPath "kustomization.yaml"
+Write-Host "Updating $kustomizationPath with version $version..." -ForegroundColor Yellow
+
+# Read existing kustomization and update only the image tags
+$kustomizationContent = Get-Content $kustomizationPath -Raw
+
+# Update image tags using regex to preserve the rest of the file
+$kustomizationContent = $kustomizationContent -replace '(- name: drawtogether\s+newTag:\s+")[^"]+(")', "`${1}$version`${2}"
+$kustomizationContent = $kustomizationContent -replace '(- name: drawtogether-migrationservice\s+newTag:\s+")[^"]+(")', "`${1}$version`${2}"
+
+# If images section doesn't exist, add it
+if ($kustomizationContent -notmatch 'images:') {
+ $kustomizationContent += @"
+
+images:
+ - name: drawtogether
+ newTag: "$version"
+ - name: drawtogether-migrationservice
+ newTag: "$version"
+"@
+}
+
+Set-Content -Path $kustomizationPath -Value $kustomizationContent -NoNewline
+Write-Host "Kustomization updated successfully" -ForegroundColor Green
+
+# Create namespace if it doesn't exist
+Write-Host "Creating namespace [$namespace] if it doesn't exist..." -ForegroundColor Yellow
+try {
+ kubectl create namespace $namespace 2>&1 | Out-Null
+ Write-Host "Namespace [$namespace] created" -ForegroundColor Green
+} catch {
+ # Namespace already exists, that's fine
+}
+# Check if namespace exists
+kubectl get namespace $namespace 2>&1 | Out-Null
+if ($LASTEXITCODE -eq 0) {
+ Write-Host "Namespace [$namespace] is ready" -ForegroundColor Green
+} else {
+ Write-Error "Failed to create or access namespace [$namespace]"
+ exit 1
+}
+
+# Create or update TLS secret if certificate exists
+$certPath = Join-Path (Join-Path (Split-Path $scriptDir -Parent) "certs") "akka-node.pfx"
+if (Test-Path $certPath) {
+ Write-Host "Creating/updating TLS secret from certificate..." -ForegroundColor Yellow
+ # Check if secret exists
+ $ErrorActionPreference = "Continue"
+ kubectl get secret akka-tls-cert -n $namespace 2>$null | Out-Null
+ $secretExists = $LASTEXITCODE -eq 0
+ $ErrorActionPreference = "Stop"
+
+ if ($secretExists) {
+ # Delete existing secret to update it
+ kubectl delete secret akka-tls-cert -n $namespace 2>$null | Out-Null
+ }
+
+ # Create the secret
+ kubectl create secret generic akka-tls-cert `
+ --from-file=akka-node.pfx=$certPath `
+ --namespace=$namespace
+
+ if ($LASTEXITCODE -eq 0) {
+ Write-Host "TLS secret 'akka-tls-cert' created successfully" -ForegroundColor Green
+ } else {
+ Write-Warning "Failed to create TLS secret - pods may not start if TLS is enabled"
+ }
+} else {
+ Write-Warning "TLS certificate not found at $certPath - skipping TLS secret creation"
+ Write-Warning "Pods may not start if TLS is enabled in configuration"
+}
+
+# Delete migrations job if it exists (Jobs are immutable, must recreate for version updates)
+Write-Host "Checking for existing migrations job..." -ForegroundColor Yellow
+$ErrorActionPreference = "Continue" # Temporarily allow errors
+kubectl get job drawtogether-migrations -n $namespace 2>$null
+$jobExists = $LASTEXITCODE -eq 0
+$ErrorActionPreference = "Stop" # Restore strict error handling
+if ($jobExists) {
+ Write-Host "Deleting existing migrations job..." -ForegroundColor Yellow
+ kubectl delete job drawtogether-migrations -n $namespace
+ if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to delete migrations job"
+ exit 1
+ }
+ Write-Host "Migrations job deleted" -ForegroundColor Green
+} else {
+ Write-Host "No existing migrations job found" -ForegroundColor Gray
+}
+
+# Apply Kustomize configuration
+Write-Host "Applying Kustomize configuration from [$overlayPath]..." -ForegroundColor Yellow
+# Use the absolute path for kubectl apply
+kubectl apply -k $overlayPath
+
+if ($LASTEXITCODE -ne 0) {
+ Write-Error "Failed to apply Kustomize configuration"
+ exit 1
+}
+
+Write-Host "All services deployed successfully!" -ForegroundColor Green
+
+# Wait for rollout to complete based on strategy
+if ($Strategy -eq "statefulset") {
+ Write-Host "`nWaiting for StatefulSet rollout to complete..." -ForegroundColor Yellow
+ kubectl rollout status statefulset/drawtogether -n $namespace --timeout=5m
+} else {
+ Write-Host "`nWaiting for Deployment rollout to complete..." -ForegroundColor Yellow
+ kubectl rollout status deployment/drawtogether -n $namespace --timeout=5m
+}
+
+if ($LASTEXITCODE -eq 0) {
+ Write-Host "`nRollout completed successfully!" -ForegroundColor Green
+ Write-Host "`nCurrent resource status:" -ForegroundColor Cyan
+ kubectl get all -n $namespace
+} else {
+ Write-Error "Rollout did not complete successfully within timeout"
+ Write-Host "`nCurrent resource status:" -ForegroundColor Yellow
+ kubectl get all -n $namespace
+ exit 1
+}
diff --git a/k8s/deployAll.ps1 b/k8s/deployAll.ps1
deleted file mode 100644
index c67d746..0000000
--- a/k8s/deployAll.ps1
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env pwsh
-# Deploys all Kubernetes services using Kustomize
-
-$ErrorActionPreference = "Stop"
-
-$namespace = "drawtogether"
-$scriptDir = $PSScriptRoot
-$overlayPath = Join-Path (Join-Path $scriptDir "overlays") "local"
-
-Write-Host "Deploying K8s resources using Kustomize into namespace [$namespace]" -ForegroundColor Cyan
-
-# Extract version from Directory.Build.props
-$buildPropsPath = Join-Path (Split-Path $scriptDir -Parent) "Directory.Build.props"
-if (-not (Test-Path $buildPropsPath)) {
- Write-Error "Directory.Build.props not found at $buildPropsPath"
- exit 1
-}
-
-Write-Host "Reading version from Directory.Build.props..." -ForegroundColor Yellow
-[xml]$buildProps = Get-Content $buildPropsPath
-$version = ($buildProps.Project.PropertyGroup | Where-Object { $_.VersionPrefix } | Select-Object -First 1).VersionPrefix.Trim()
-Write-Host "Found version: $version" -ForegroundColor Green
-
-# Update the kustomization.yaml with the current version
-$kustomizationPath = Join-Path $overlayPath "kustomization.yaml"
-Write-Host "Updating $kustomizationPath with version $version..." -ForegroundColor Yellow
-
-$kustomization = @"
-apiVersion: kustomize.config.k8s.io/v1beta1
-kind: Kustomization
-
-resources:
- - ../../base
-
-images:
- - name: drawtogether
- newTag: "$version"
- - name: drawtogether-migrationservice
- newTag: "$version"
-"@
-
-Set-Content -Path $kustomizationPath -Value $kustomization -Force
-Write-Host "Kustomization updated successfully" -ForegroundColor Green
-
-# Create namespace if it doesn't exist
-Write-Host "Creating namespace [$namespace] if it doesn't exist..." -ForegroundColor Yellow
-kubectl create namespace $namespace 2>$null
-if ($LASTEXITCODE -eq 0) {
- Write-Host "Namespace [$namespace] created" -ForegroundColor Green
-} else {
- Write-Host "Namespace [$namespace] already exists" -ForegroundColor Gray
-}
-
-# Delete migrations job if it exists (Jobs are immutable, must recreate for version updates)
-Write-Host "Checking for existing migrations job..." -ForegroundColor Yellow
-kubectl get job drawtogether-migrations -n $namespace 2>$null
-if ($LASTEXITCODE -eq 0) {
- Write-Host "Deleting existing migrations job..." -ForegroundColor Yellow
- kubectl delete job drawtogether-migrations -n $namespace
- if ($LASTEXITCODE -ne 0) {
- Write-Error "Failed to delete migrations job"
- exit 1
- }
- Write-Host "Migrations job deleted" -ForegroundColor Green
-} else {
- Write-Host "No existing migrations job found" -ForegroundColor Gray
-}
-
-# Apply Kustomize configuration
-Write-Host "Applying Kustomize configuration from [$overlayPath]..." -ForegroundColor Yellow
-kubectl apply -k $overlayPath
-
-if ($LASTEXITCODE -ne 0) {
- Write-Error "Failed to apply Kustomize configuration"
- exit 1
-}
-
-Write-Host "All services deployed successfully!" -ForegroundColor Green
-
-# Wait for StatefulSet rollout to complete
-Write-Host "`nWaiting for StatefulSet rollout to complete..." -ForegroundColor Yellow
-kubectl rollout status statefulset/drawtogether -n $namespace --timeout=5m
-
-if ($LASTEXITCODE -eq 0) {
- Write-Host "`nRollout completed successfully!" -ForegroundColor Green
- Write-Host "`nCurrent resource status:" -ForegroundColor Cyan
- kubectl get all -n $namespace
-} else {
- Write-Error "Rollout did not complete successfully within timeout"
- Write-Host "`nCurrent resource status:" -ForegroundColor Yellow
- kubectl get all -n $namespace
- exit 1
-}
diff --git a/k8s/overlays/deployment/delete-statefulset.yaml b/k8s/overlays/deployment/delete-statefulset.yaml
new file mode 100644
index 0000000..e3845d6
--- /dev/null
+++ b/k8s/overlays/deployment/delete-statefulset.yaml
@@ -0,0 +1,6 @@
+$patch: delete
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: drawtogether
+ namespace: drawtogether
\ No newline at end of file
diff --git a/k8s/overlays/deployment/deployment.yaml b/k8s/overlays/deployment/deployment.yaml
index 4cb903e..acd40fa 100644
--- a/k8s/overlays/deployment/deployment.yaml
+++ b/k8s/overlays/deployment/deployment.yaml
@@ -30,9 +30,20 @@ spec:
- /bin/bash
- -c
- |
- echo "Waiting for migrations job to complete..."
- kubectl wait --for=condition=complete --timeout=300s job/drawtogether-migrations -n drawtogether
- echo "Migrations completed successfully!"
+ echo "Checking migrations status..."
+ # Check if job exists
+ if kubectl get job drawtogether-migrations -n drawtogether &>/dev/null; then
+ # Job exists, check if it's already completed
+ if kubectl get job drawtogether-migrations -n drawtogether -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep -q "True"; then
+ echo "Migrations job already completed"
+ else
+ echo "Waiting for migrations job to complete..."
+ kubectl wait --for=condition=complete --timeout=300s job/drawtogether-migrations -n drawtogether
+ echo "Migrations completed successfully!"
+ fi
+ else
+ echo "Migrations job not found (likely already completed and cleaned up)"
+ fi
containers:
- name: pbm-sidecar
image: petabridge/pbm:latest #sidecar
diff --git a/k8s/overlays/deployment/kustomization.yaml b/k8s/overlays/deployment/kustomization.yaml
index dde7786..2edfc64 100644
--- a/k8s/overlays/deployment/kustomization.yaml
+++ b/k8s/overlays/deployment/kustomization.yaml
@@ -7,39 +7,21 @@ kind: Kustomization
namespace: drawtogether
resources:
- - ../../base/configs/k8s-crd.yaml
- - ../../base/configs/k8s-rbac.yaml
- - ../../base/sql-server.yaml
- - ../../base/k8s-migrations-job.yaml
- - service.yaml
+ # Include the base configuration
+ - ../../base
+ # Add deployment instead of statefulset
- deployment.yaml
+# Remove the StatefulSet from base
+patchesStrategicMerge:
+ - delete-statefulset.yaml
+
# Apply common labels
commonLabels:
variant: deployment
-# Ingress configuration
-patchesStrategicMerge:
- - |-
- apiVersion: networking.k8s.io/v1
- kind: Ingress
- metadata:
- name: drawtogether-localhost
- namespace: drawtogether
- annotations:
- kubernetes.io/ingress.class: "nginx"
- nginx.ingress.kubernetes.io/affinity: "cookie"
- nginx.ingress.kubernetes.io/session-cookie-name: "route"
- nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
- spec:
- rules:
- - host: drawtogether.localdev.me
- http:
- paths:
- - path: /
- pathType: Prefix
- backend:
- service:
- name: drawtogether
- port:
- number: 8080
+images:
+ - name: drawtogether
+ newTag: "0.2.11"
+ - name: drawtogether-migrationservice
+ newTag: "0.2.11"
\ No newline at end of file
diff --git a/k8s/overlays/local/kustomization.yaml b/k8s/overlays/local/kustomization.yaml
index a6e0d7b..cb755e0 100644
--- a/k8s/overlays/local/kustomization.yaml
+++ b/k8s/overlays/local/kustomization.yaml
@@ -6,6 +6,6 @@ resources:
images:
- name: drawtogether
- newTag: "0.2.10"
+ newTag: "0.2.11"
- name: drawtogether-migrationservice
- newTag: "0.2.10"
+ newTag: "0.2.11"
\ No newline at end of file