-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#11 all custom services deployed in the k8s
- api gateway in k8s
- Loading branch information
Showing
17 changed files
with
149 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set COMPOSE_PROJECT_NAME=microservice-search | ||
docker-compose -f db.yml -p %COMPOSE_PROJECT_NAME% up -d | ||
docker-compose -f mongodb.yml -p %COMPOSE_PROJECT_NAME% up -d | ||
docker-compose -f kafka.yml -p %COMPOSE_PROJECT_NAME% up -d | ||
docker-compose -f redis.yml -p %COMPOSE_PROJECT_NAME% up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker-compose -f db.yml -p microservice-search up -d | ||
docker-compose -f mongodb.yml -p microservice-search up -d | ||
docker-compose -f kafka.yml -p microservice-search up -d | ||
docker-compose -f redis.yml -p microservice-search up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: ms-api-gateway | ||
data: | ||
DATA_REDIS_HOST: "192.168.0.129" | ||
application-k8s.properties: |- | ||
spring.profiles.active=k8s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: ms-api-gateway | ||
labels: | ||
app: ms-api-gateway | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: ms-api-gateway | ||
template: | ||
metadata: | ||
labels: | ||
app: ms-api-gateway | ||
spec: | ||
serviceAccountName: spring-cloud-kubernetes | ||
containers: | ||
- name: ms-api-gateway | ||
image: ms-api-gateway:latest | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Never | ||
env: | ||
- name: SPRING_CLOUD_BOOTSTRAP_ENABLED | ||
value: "true" | ||
- name: SPRING_CLOUD_KUBERNETES_SECRETS_ENABLEAPI | ||
value: "true" | ||
- name: SPRING_PROFILES_ACTIVE | ||
value: k8s | ||
- name: DATA_REDIS_HOST | ||
valueFrom: | ||
configMapKeyRef: | ||
name: ms-api-gateway | ||
key: DATA_REDIS_HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ms-api-gateway | ||
labels: | ||
app: ms-api-gateway | ||
spring-boot: "true" | ||
spec: | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
selector: | ||
app: ms-api-gateway | ||
type: LoadBalancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
server: | ||
port: 8080 | ||
|
||
management: | ||
endpoint: | ||
gateway: | ||
enabled: true | ||
endpoints: | ||
web: | ||
exposure: | ||
include: "*" | ||
|
||
## API Gateway routes | ||
spring: | ||
cloud: | ||
gateway: | ||
routes: | ||
- id: stock-service-api-1-route | ||
uri: http://ms-stock-service:8091 | ||
predicates: | ||
- Path=/api/stockProduct/** | ||
- Weight=stock-api-group-1, 5 | ||
filters: | ||
- RewritePath=/api/stockProduct/(?<segment>.*), /api/v1/stockProduct/${segment} | ||
- name: CircuitBreaker | ||
args: | ||
name: stock-api-group-1-cb | ||
fallbackUri: forward:/fallback/stock | ||
- id: stock-service-api-2-route | ||
uri: http://ms-stock-service:8091 | ||
predicates: | ||
- Path=/api/stockProduct/** | ||
- Weight=stock-api-group-1, 5 | ||
filters: | ||
- RewritePath=/api/stockProduct/(?<segment>.*), /api/v2/stockProduct/${segment} | ||
- name: CircuitBreaker | ||
args: | ||
name: stock-api-group-1-cb | ||
fallbackUri: forward:/fallback/stock | ||
- id: cms-service-api-1-route | ||
uri: http://ms-cms-service:8100 | ||
predicates: | ||
- Path=/api/cmsProduct/** | ||
- Weight=cms-api-group-1, 5 | ||
filters: | ||
- RewritePath=/api/cmsProduct/(?<segment>.*), /api/v1/cmsProduct/${segment} | ||
- name: CircuitBreaker | ||
args: | ||
name: cms-api-group-1-cb | ||
fallbackUri: forward:/fallback/cms | ||
- id: cms-service-api-2-route | ||
uri: http://ms-cms-service:8100 | ||
predicates: | ||
- Path=/api/cmsProduct/** | ||
- Weight=cms-api-group-1, 5 | ||
filters: | ||
- RewritePath=/api/cmsProduct/(?<segment>.*), /api/v2/cmsProduct/${segment} | ||
- name: CircuitBreaker | ||
args: | ||
name: cms-api-group-1-cb | ||
fallbackUri: forward:/fallback/cms | ||
data: | ||
redis: | ||
host: ${DATA_REDIS_HOST} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ spec: | |
protocol: TCP | ||
selector: | ||
app: ms-cms-service | ||
type: ClusterIP | ||
type: LoadBalancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ spec: | |
protocol: TCP | ||
selector: | ||
app: ms-stock-service | ||
type: ClusterIP | ||
type: LoadBalancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters