Skip to content

Commit 9db64fb

Browse files
Rodrigo Dos SantosRodrigo Dos Santos
authored andcommitted
Fixed few services - build authentication-service, build kotlin-service, build user-service, build person-service
1 parent 85e40d2 commit 9db64fb

File tree

56 files changed

+1805
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1805
-499
lines changed

.github/workflows/docker-build-push-image-react-webapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
build-args: |
5050
GITHUB_SHA=$GITHUB_SHA
5151
GITHUB_REF=$GITHUB_REF
52-
PORT=3003
52+
PORT=3003Ï
5353
5454
- name: Image digest
5555
run: echo ${{ steps.docker_build.outputs.digest }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
labels:
5+
k8s-app: kubernetes-dashboard
6+
name: kubernetes-dashboard
7+
namespace: kubernetes-dashboard
8+
---
9+
apiVersion: rbac.authorization.k8s.io/v1
10+
kind: ClusterRoleBinding
11+
metadata:
12+
name: kubernetes-dashboard
13+
labels:
14+
k8s-app: kubernetes-dashboard
15+
roleRef:
16+
apiGroup: rbac.authorization.k8s.io
17+
kind: ClusterRole
18+
name: cluster-admin
19+
subjects:
20+
- kind: ServiceAccount
21+
name: kubernetes-dashboard
22+
namespace: kubernetes-dashboard

.github/workflows/kubernetes/deployment-admin-server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ spec:
3232
spec:
3333
containers:
3434
- name: admin-server
35-
image: fielcapao/microservices-design-patterns-admin-service:latest
35+
image: admin-server:0.0.1-SNAPSHOT #fielcapao/microservices-design-patterns-admin-service:latest
3636
resources:
3737
requests:
3838
memory: "256Mi"
3939
limits:
4040
memory: "512Mi"
4141
env:
4242
- name: JAVA_OPTS
43-
value: -Xms256m -Xm512m
43+
value: -Xss256K -Xms1M -XX:+UseSerialGC -Djava.compiler=none -XX:ReservedCodeCacheSize=2496k -XX:MaxDirectMemorySize=1M
4444
- name: SERVER_PORT
4545
value: "9000"
4646
- name: SPRING_PROFILES_ACTIVE

.github/workflows/kubernetes/deployment-authentication-service.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: authentication-service
5-
annotations:
6-
cloud.google.com/app-protocols: '{"https-port":"HTTPS","http-port":"HTTP"}'
5+
# annotations:
6+
# cloud.google.com/app-protocols: '{"https-port":"HTTPS","http-port":"HTTP"}'
77
labels:
88
app: authentication-service
99
spec:
1010
ports:
11-
- name: https-port
12-
port: 8443
11+
# - name: https-port
12+
# port: 8443
1313
- name: http-port
1414
port: 9999
1515
selector:
@@ -32,16 +32,20 @@ spec:
3232
spec:
3333
containers:
3434
- name: authentication-service
35-
image: authentication-service #fielcapao/microservices-design-patterns-authentication-service:latest #eu.gcr.io/api-project-646370370811/authentication-service #eu.gcr.io/api-project-646370370811/authentication-service:7f79c29fbc58052bb7d86bceeb7722b0185c66c4
35+
image: authentication-service:0.0.1-SNAPSHOT #fielcapao/microservices-design-patterns-authentication-service:latest #eu.gcr.io/api-project-646370370811/authentication-service #eu.gcr.io/api-project-646370370811/authentication-service:7f79c29fbc58052bb7d86bceeb7722b0185c66c4
3636
imagePullPolicy: Never
3737
resources:
3838
requests:
3939
memory: "256Mi"
4040
limits:
4141
memory: "512Mi"
42+
volumeMounts:
43+
- name: spendingbetter-jks
44+
mountPath: "/etc/ssl_certs"
45+
readOnly: true
4246
env:
4347
- name: JAVA_OPTS
44-
value: -Xms256m -Xmx512m
48+
value: -Xss256K -Xms1M -XX:+UseSerialGC -Djava.compiler=none -XX:ReservedCodeCacheSize=2496k -XX:MaxDirectMemorySize=1M #-Xms256m -Xmx512m
4549
- name: SERVER_PORT
4650
value: "9999"
4751
- name: SPRING_PROFILES_ACTIVE
@@ -58,7 +62,7 @@ spec:
5862
value: "false"
5963
- name: SPRING_CLOUD_KUBERNETES_CONFIG_NAMESPACE
6064
value: "default"
61-
- name: LOGGING_LEVEL_ROOT
65+
- name: LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY
6266
value: trace
6367
# - name: CLIENT_ID
6468
# value: ${CLIENT_ID}
@@ -74,12 +78,25 @@ spec:
7478
value: file:/etc/ssl_certs/www.spendingbetter.com.jks
7579
- name: KEYSTORE_ALIAS
7680
value: spendingbetter
81+
- name: LOGGING_LEVEL_ORG_SPRINGFRAMEWORK
82+
value: "trace"
7783
ports:
7884
- containerPort: 9999
7985
livenessProbe:
8086
httpGet:
8187
scheme: HTTP
82-
path: /actuator/health
88+
path: /actuator/health/liveness
8389
port: 9999
8490
initialDelaySeconds: 1000
8591
periodSeconds: 5
92+
readinessProbe:
93+
httpGet:
94+
scheme: HTTP
95+
path: /actuator/health/readiness
96+
port: 9999
97+
initialDelaySeconds: 1000
98+
periodSeconds: 5
99+
volumes:
100+
- name: spendingbetter-jks
101+
secret:
102+
secretName: spendingbetter-jks
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: edge-server
5+
annotations:
6+
cloud.google.com/app-protocols: '{"https-port":"HTTPS","http-port":"HTTP"}'
7+
labels:
8+
app: edge-server
9+
spec:
10+
ports:
11+
- name: https-port
12+
port: 8443
13+
- name: http-port
14+
port: 8080
15+
selector:
16+
app: edge-server
17+
---
18+
apiVersion: apps/v1
19+
kind: Deployment
20+
metadata:
21+
name: edge-server
22+
spec:
23+
selector:
24+
matchLabels:
25+
app: edge-server
26+
replicas: 1
27+
template:
28+
metadata:
29+
labels:
30+
app: edge-server
31+
version: v1
32+
spec:
33+
containers:
34+
- name: edge-server
35+
image: edge-server:0.0.1-SNAPSHOT
36+
resources:
37+
requests:
38+
memory: "256Mi"
39+
limits:
40+
memory: "512Mi"
41+
volumeMounts:
42+
- name: spendingbetter-pub-key
43+
mountPath: "/etc/ssl_certs_pub"
44+
readOnly: true
45+
env:
46+
- name: JAVA_OPTS
47+
value: -Xss256K -Xms1M -XX:+UseSerialGC -Djava.compiler=none -XX:ReservedCodeCacheSize=2496k -XX:MaxDirectMemorySize=1M
48+
- name: SERVER_PORT
49+
value: "8080"
50+
- name: SPRING_PROFILES_ACTIVE
51+
value: prod
52+
- name: SPRING_DATA_MONGODB_URI
53+
value: mongodb://mongodb:27017
54+
- name: SPRING_DATA_MONGODB_DATABASE
55+
value: docker
56+
- name: SPRING_REDIS_HOST
57+
value: redis
58+
- name: SPRING_CLOUD_CONSUL_ENABLED
59+
value: "false"
60+
- name: OPENTRACING_JAEGER_ENABLED
61+
value: "false"
62+
- name: SPRING_CLOUD_KUBERNETES_CONFIG_NAMESPACE
63+
value: "default"
64+
- name: SPRING_MAIN_WEB_APPLICATION_TYPE
65+
value: "reactive"
66+
- name: SPRING_MAIN_ALLOW_CIRCULAR_REFERENCES
67+
value: "true"
68+
- name: MANAGEMENT_ENDPOINTS_WEB_CORS_ALLOW_CREDENTIALS
69+
value: "false"
70+
- name: KEYSTORE_PASSWORD
71+
value: Cert202!
72+
- name: KEYSTORE
73+
value: file:/etc/ssl_certs_pub/www.spendingbetter.com.pub
74+
- name: KEYSTORE_ALIAS
75+
value: spendingbetter
76+
- name: COM_MICROSERVICE_AUTHENTICATION_JWT_ENABLED_PUBLIC_KEY
77+
value: "true"
78+
# - name: SPRING_CLOUD_GATEWAY_DISCOVERY_LOCATOR_ENABLED
79+
# value: "true"
80+
- name: LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_CLOUD_GATEWAY
81+
value: "trace"
82+
ports:
83+
- containerPort: 8080
84+
livenessProbe:
85+
httpGet:
86+
scheme: HTTP
87+
path: /actuator/health/liveness
88+
port: 8080
89+
initialDelaySeconds: 1000
90+
periodSeconds: 5
91+
readinessProbe:
92+
httpGet:
93+
scheme: HTTP
94+
path: /actuator/health/readiness
95+
port: 8080
96+
initialDelaySeconds: 1000
97+
volumes:
98+
- name: spendingbetter-pub-key
99+
secret:
100+
secretName: spendingbetter-pub-key
101+

.github/workflows/kubernetes/deployment-ingress-gateway.yml

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -70,77 +70,92 @@
7070
# servicePort: http-port
7171
#
7272
---
73-
apiVersion: networking.k8s.io/v1beta1
73+
apiVersion: networking.k8s.io/v1
7474
kind: Ingress
7575
metadata:
7676
name: ingress
7777
annotations:
7878
kubernetes.io/ingress.class: nginx
7979
spec:
80-
backend:
81-
serviceName: react-webapp
82-
servicePort: 3003
80+
# backend:
81+
# serviceName: react-webapp
82+
# servicePort: 3003
8383
# tls:
8484
# - secretName: ingress-tls
8585
# hosts:
8686
# - "*"
8787
rules:
88-
- host: "*"
88+
- host: "mydomain.com"
8989
http:
9090
paths:
91-
- path: /grafana
92-
backend:
93-
serviceName: grafana
94-
servicePort: 3000
95-
- path: /monitoring
96-
backend:
97-
serviceName: admin-server
98-
servicePort: http-port
99-
- path: /eureka
100-
backend:
101-
serviceName: eureka-server
102-
servicePort: http-port
91+
# - path: /grafana
92+
# backend:
93+
# serviceName: grafana
94+
# servicePort: 3000
95+
# - path: /monitoring
96+
# backend:
97+
# serviceName: admin-server
98+
# servicePort: http-port
99+
# - path: /eureka
100+
# backend:
101+
# serviceName: eureka-server
102+
# servicePort: http-port
103103
- path: /api/users
104104
backend:
105-
serviceName: user-service
106-
servicePort: http-port
105+
service:
106+
name: user-service
107+
port:
108+
name: http-port
109+
pathType: Prefix
107110
- path: /api/people
108111
backend:
109-
serviceName: person-service
110-
servicePort: http-port
111-
- path: /api/tasks
112-
backend:
113-
serviceName: kotlin-service
114-
servicePort: http-port
115-
- path: /api/products
116-
backend:
117-
serviceName: python-service
118-
servicePort: http-port
112+
service:
113+
name: person-service
114+
port:
115+
name: http-port
116+
pathType: Prefix
117+
# - path: /api/tasks
118+
# backend:
119+
# serviceName: kotlin-service
120+
# servicePort: http-port
121+
# - path: /api/products
122+
# backend:
123+
# serviceName: python-service
124+
# servicePort: http-port
119125
- path: /api/account
120126
backend:
121-
serviceName: authentication-service
122-
servicePort: http-port
127+
service:
128+
name: authentication-service
129+
port:
130+
name: http-port
131+
pathType: Prefix
123132
- path: /api/authenticate
124133
backend:
125-
serviceName: authentication-service
126-
servicePort: http-port
134+
service:
135+
name: authentication-service
136+
port:
137+
name: http-port
138+
pathType: Prefix
127139
- path: /api/logout
128140
backend:
129-
serviceName: authentication-service
130-
servicePort: http-port
131-
- path: /docs
132-
backend:
133-
serviceName: week-menu-api
134-
servicePort: http-port
135-
- path: /api-docs
136-
backend:
137-
serviceName: week-menu-api
138-
servicePort: http-port
139-
- path: /zipkin
140-
backend:
141-
serviceName: zipkin-server
142-
servicePort: http-port
143-
- path: /
144-
backend:
145-
serviceName: react-webapp
146-
servicePort: 3003
141+
service:
142+
name: authentication-service
143+
port:
144+
name: http-port
145+
pathType: Prefix
146+
# - path: /docs
147+
# backend:
148+
# serviceName: week-menu-api
149+
# servicePort: http-port
150+
# - path: /api-docs
151+
# backend:
152+
# serviceName: week-menu-api
153+
# servicePort: http-port
154+
# - path: /zipkin
155+
# backend:
156+
# serviceName: zipkin-server
157+
# servicePort: http-port
158+
# - path: /
159+
# backend:
160+
# serviceName: react-webapp
161+
# servicePort: 3003

0 commit comments

Comments
 (0)