feat: Thay thế Auth Service bằng IAM Service trong tài liệu OpenAPI và cập nhật hướng dẫn triển khai Kubernetes.

This commit is contained in:
Ho Ngoc Hai
2026-01-07 22:23:20 +07:00
parent 156fdd00e8
commit 03c76fecb5
8 changed files with 35 additions and 39 deletions

View File

@@ -1,8 +1,8 @@
openapi: 3.0.0
info:
title: Auth Service API
title: IAM Service API
version: 1.0.0
description: Authentication and Authorization Service API
description: Identity and Access Management Service API
servers:
- url: http://localhost/api/v1

View File

@@ -38,7 +38,7 @@ graph TB
end
subgraph DeploymentLayer["Deployment Layer"]
Deployment[Deployment<br/>auth-service]
Deployment[Deployment<br/>iam-service]
HPA[HorizontalPodAutoscaler<br/>HPA]
end
@@ -134,10 +134,10 @@ sequenceDiagram
Client->>Ingress: HTTPS Request<br/>api.goodgo.com/auth/login
Ingress->>Ingress: TLS Termination
Ingress->>Ingress: Path Routing<br/>/auth → auth-service
Ingress->>Ingress: Path Routing<br/>/auth → iam-service
Ingress->>Service: HTTP Request<br/>auth-service:80
Service->>Service: DNS Resolution<br/>auth-service.goodgo.svc.cluster.local
Ingress->>Service: HTTP Request<br/>iam-service:80
Service->>Service: DNS Resolution<br/>iam-service.goodgo.svc.cluster.local
Service->>Service: Endpoint Selection<br/>Load Balancing
@@ -162,29 +162,29 @@ sequenceDiagram
## Service Deployment Manifest
```yaml
# kubernetes/auth-service.yaml
# kubernetes/iam-service.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-service
name: iam-service
namespace: goodgo
labels:
app: auth-service
app: iam-service
version: v1
spec:
replicas: 3
selector:
matchLabels:
app: auth-service
app: iam-service
template:
metadata:
labels:
app: auth-service
app: iam-service
version: v1
spec:
containers:
- name: auth-service
image: goodgo/auth-service:latest
- name: iam-service
image: goodgo/iam-service:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
@@ -232,12 +232,12 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: auth-service
name: iam-service
namespace: goodgo
spec:
type: ClusterIP
selector:
app: auth-service
app: iam-service
ports:
- port: 80
targetPort: 3000
@@ -251,13 +251,13 @@ spec:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: auth-service-hpa
name: iam-service-hpa
namespace: goodgo
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: auth-service
name: iam-service
minReplicas: 2
maxReplicas: 10
metrics:
@@ -353,7 +353,7 @@ spec:
pathType: Prefix
backend:
service:
name: auth-service
name: iam-service
port:
number: 80
- path: /users
@@ -434,7 +434,7 @@ echo "Applying Secrets..."
kubectl apply -f kubernetes/secrets-$ENVIRONMENT.yaml
echo "Deploying services..."
kubectl apply -f kubernetes/auth-service.yaml
kubectl apply -f kubernetes/iam-service.yaml
kubectl apply -f kubernetes/user-service.yaml
echo "Configuring autoscaling..."
@@ -444,7 +444,7 @@ echo "Setting up ingress..."
kubectl apply -f kubernetes/ingress.yaml
# Wait for rollout
kubectl rollout status deployment/auth-service -n $NAMESPACE
kubectl rollout status deployment/iam-service -n $NAMESPACE
kubectl rollout status deployment/user-service -n $NAMESPACE
echo "Deployment complete!"
@@ -498,12 +498,12 @@ export class HealthController {
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: auth-service-monitor
name: iam-service-monitor
namespace: goodgo
spec:
selector:
matchLabels:
app: auth-service
app: iam-service
endpoints:
- port: http
path: /metrics
@@ -522,27 +522,27 @@ kubectl get pods -n goodgo
kubectl get svc -n goodgo
# View logs
kubectl logs -f deployment/auth-service -n goodgo
kubectl logs -f deployment/iam-service -n goodgo
kubectl logs -f pod-name -n goodgo --tail=100
# Scale manually
kubectl scale deployment auth-service --replicas=5 -n goodgo
kubectl scale deployment iam-service --replicas=5 -n goodgo
# Update image
kubectl set image deployment/auth-service auth-service=goodgo/auth-service:v1.2.3 -n goodgo
kubectl set image deployment/iam-service iam-service=goodgo/iam-service:v1.2.3 -n goodgo
# Rollback
kubectl rollout undo deployment/auth-service -n goodgo
kubectl rollout undo deployment/iam-service -n goodgo
# Port forward for debugging
kubectl port-forward service/auth-service 3000:80 -n goodgo
kubectl port-forward service/iam-service 3000:80 -n goodgo
# Execute command in pod
kubectl exec -it pod-name -n goodgo -- /bin/sh
# View HPA status
kubectl get hpa -n goodgo
kubectl describe hpa auth-service-hpa -n goodgo
kubectl describe hpa iam-service-hpa -n goodgo
# View resource usage
kubectl top nodes

View File

@@ -1,8 +1,8 @@
openapi: 3.0.0
info:
title: Auth Service API
title: IAM Service API
version: 1.0.0
description: Authentication and Authorization Service API
description: Identity and Access Management Service API
servers:
- url: http://localhost/api/v1

View File

@@ -200,5 +200,4 @@ markdownlint docs/vi/**/*.md
---
**Cập nhật lần cuối**: 2024-01-15
**Tác giả**: GoodGo Documentation Team
**Tác giả**: VelikHo (hongochai10@icloud.com)

View File

@@ -223,6 +223,5 @@ graph LR
---
**Last Updated / Cập nhật lần cuối**: YYYY-MM-DD
**Authors / Tác giả**: Your Name
**Authors / Tác giả**: VelikHo (hongochai10@icloud.com)
**Reviewers / Người review**: Reviewer Names

View File

@@ -251,7 +251,6 @@ Câu trả lời 2 bằng tiếng Việt.
---
**Last Updated / Cập nhật lần cuối**: YYYY-MM-DD
**Difficulty / Độ khó**: Beginner/Intermediate/Advanced
**Estimated Time / Thời gian ước tính**: X minutes
**Authors / Tác giả**: Your Name
**Authors / Tác giả**: VelikHo (hongochai10@icloud.com)

View File

@@ -536,4 +536,4 @@ echo $? # Should be 0 if successful
---
**Last Updated**: 2026-01-05
**Tác giả**: VelikHo (hongochai10@icloud.com)

View File

@@ -469,7 +469,6 @@ export class RBACService implements ExamplePattern {
---
**Last Updated / Cập nhật lần cuối**: YYYY-MM-DD
**Complexity / Độ phức tạp**: Beginner/Intermediate/Advanced
**Category / Danh mục**: [Category Name]
**Authors / Tác giả**: Your Name
**Authors / Tác giả**: VelikHo (hongochai10@icloud.com)