diff --git a/README.md b/README.md index 9455f37..8afb011 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ kubectl get pods -n microforge-dev-ns ### **Authentication Service (Go - Port 8082)** ```http -GET /api/health # Health check +GET /api/auth/health # Health check POST /api/validate # JWT token validation GET /api/verify/:token # Token verification GET /api/protected/profile # Protected user profile @@ -164,7 +164,7 @@ GET /api/users # User management ### **Metadata Service (Python - Port 8084)** ```http -GET /api/health # Health check +GET /api/metadata/health # Health check GET /api/metadata/instance # System instance metadata GET /api/metadata/deployment # Deployment information POST /api/stress/start # Performance stress testing diff --git a/manifests/kubernetes/auth-service.yaml b/manifests/kubernetes/auth-service.yaml index 248cec2..d6fc781 100644 --- a/manifests/kubernetes/auth-service.yaml +++ b/manifests/kubernetes/auth-service.yaml @@ -29,6 +29,12 @@ metadata: labels: app: auth-service spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: auth-service @@ -42,6 +48,20 @@ spec: image: manojmdocker14/microforge-auth-service:v1.1.0 ports: - containerPort: 8082 + livenessProbe: + httpGet: + path: /api/auth/health + port: 8082 + initialDelaySeconds: 45 + periodSeconds: 20 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: /api/auth/health + port: 8082 + initialDelaySeconds: 15 + periodSeconds: 10 + timeoutSeconds: 5 envFrom: - configMapRef: name: auth-service-config diff --git a/manifests/kubernetes/login-mysql.yaml b/manifests/kubernetes/login-mysql.yaml index dd25f42..6ef9449 100644 --- a/manifests/kubernetes/login-mysql.yaml +++ b/manifests/kubernetes/login-mysql.yaml @@ -30,6 +30,11 @@ metadata: app: login-mysql spec: replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: login-mysql @@ -43,6 +48,32 @@ spec: image: manojmdocker14/microforge-users-mysql:v1.0.0 ports: - containerPort: 3306 + startupProbe: + exec: + command: + - bash + - "-c" + - "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}" + failureThreshold: 30 + periodSeconds: 10 + timeoutSeconds: 5 + livenessProbe: + exec: + command: + - bash + - "-c" + - "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}" + periodSeconds: 20 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - bash + - "-c" + - "mysql -u root -p${MYSQL_ROOT_PASSWORD} -e 'SELECT 1;'" + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 envFrom: - configMapRef: name: login-mysql-config diff --git a/manifests/kubernetes/login-service.yaml b/manifests/kubernetes/login-service.yaml index 7a6e76a..a270e76 100644 --- a/manifests/kubernetes/login-service.yaml +++ b/manifests/kubernetes/login-service.yaml @@ -15,6 +15,8 @@ kind: Service metadata: name: login-service namespace: microforge-dev-ns + labels: + app: login-service spec: selector: app: login-service @@ -33,6 +35,11 @@ metadata: app: login-service spec: replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: login-service @@ -46,6 +53,20 @@ spec: image: manojmdocker14/microforge-login-service:v1.2.0 ports: - containerPort: 8081 + livenessProbe: + httpGet: + path: /actuator/health + port: 8081 + initialDelaySeconds: 70 + periodSeconds: 20 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: /actuator/health + port: 8081 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 env: - name: DB_HOST value: login-mysql diff --git a/manifests/kubernetes/metadata-service.yaml b/manifests/kubernetes/metadata-service.yaml index 972e241..aeb9b74 100644 --- a/manifests/kubernetes/metadata-service.yaml +++ b/manifests/kubernetes/metadata-service.yaml @@ -30,6 +30,12 @@ metadata: labels: app: metadata-service spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: metadata-service @@ -43,6 +49,20 @@ spec: image: manojmdocker14/microforge-metadata-service:v1.1.0 ports: - containerPort: 8084 + readinessProbe: + httpGet: + path: /api/metadata/health + port: 8084 + initialDelaySeconds: 45 + periodSeconds: 20 + timeoutSeconds: 5 + livenessProbe: + httpGet: + path: /api/metadata/health + port: 8084 + initialDelaySeconds: 45 + periodSeconds: 10 + timeoutSeconds: 5 envFrom: - configMapRef: name: metadata-service-config diff --git a/manifests/kubernetes/notification-mysql.yaml b/manifests/kubernetes/notification-mysql.yaml index 8602fc4..bc6b677 100644 --- a/manifests/kubernetes/notification-mysql.yaml +++ b/manifests/kubernetes/notification-mysql.yaml @@ -30,6 +30,11 @@ metadata: app: notification-mysql spec: replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: notification-mysql @@ -43,6 +48,32 @@ spec: image: manojmdocker14/microforge-notifications-mysql:v1.0.0 ports: - containerPort: 3306 + startupProbe: + exec: + command: + - bash + - "-c" + - "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD" + initialDelaySeconds: 15 # Wait 15s before starting the first check + periodSeconds: 10 # Check every 10s + failureThreshold: 30 # Allow 30 failures (Total 5 minutes of boot time) + livenessProbe: + exec: + command: + - bash + - "-c" + - "mysqladmin ping -u root -p$MYSQL_ROOT_PASSWORD" + periodSeconds: 20 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - bash + - "-c" + - "mysql -u root -p$MYSQL_ROOT_PASSWORD -e 'SELECT 1;'" + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 10 envFrom: - configMapRef: name: notification-mysql-config diff --git a/manifests/kubernetes/notification-service.yaml b/manifests/kubernetes/notification-service.yaml index 7751bbe..6223b81 100644 --- a/manifests/kubernetes/notification-service.yaml +++ b/manifests/kubernetes/notification-service.yaml @@ -32,6 +32,11 @@ metadata: app: notification-service spec: replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: app: notification-service @@ -45,6 +50,20 @@ spec: image: manojmdocker14/microforge-notification-service:v1.1.0 ports: - containerPort: 8083 + livenessProbe: + httpGet: + path: /actuator/health + port: 8083 + initialDelaySeconds: 45 # Increased for DB connection setup + periodSeconds: 20 + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: /actuator/health + port: 8083 + initialDelaySeconds: 20 + periodSeconds: 10 + timeoutSeconds: 5 env: - name: MYSQL_HOST value: notification-mysql