-
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.
k8s: route http traffic using ingress
- Loading branch information
1 parent
2ab116d
commit 8d39e49
Showing
7 changed files
with
134 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: bookings | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
myevents/app: bookings | ||
myevents/tier: api | ||
template: | ||
metadata: | ||
labels: | ||
myevents/app: bookings | ||
myevents/tier: api | ||
spec: | ||
containers: | ||
- name: api | ||
imagePullPolicy: Never | ||
image: myevents/bookingservice | ||
ports: | ||
- containerPort: 8282 | ||
name: http | ||
env: | ||
- name: MONGO_URL | ||
value: mongodb://events-db/users | ||
- name: AMQP_BROKER_URL | ||
value: amqp://guest:guest@amqp-broker:5672/ | ||
|
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: bookings | ||
spec: | ||
selector: | ||
myevents/app: bookings | ||
myevents/tier: api | ||
ports: | ||
- port: 80 | ||
targetPort: 8282 | ||
name: http |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: frontend | ||
spec: | ||
selector: | ||
matchLabels: | ||
myevents/app: frontend | ||
template: | ||
metadata: | ||
labels: | ||
myevents/app: frontend | ||
spec: | ||
containers: | ||
- name: frontend | ||
image: myevents/frontend | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 80 | ||
name: http | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: frontend | ||
spec: | ||
type: NodePort | ||
selector: | ||
myevents/app: frontend | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
name: http |
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,20 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: myevents-controller | ||
namespace: default | ||
spec: | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
nodePort: 30100 | ||
- name: https | ||
protocol: TCP | ||
port: 443 | ||
targetPort: 443 | ||
nodePort: 30101 | ||
selector: | ||
app.kubernetes.io/name: myevents | ||
type: NodePort |
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,39 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: myevents | ||
namespace: default | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-path: / | ||
# kubernetes.io/ingress.class: "nginx" | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: api.myevents.example | ||
http: | ||
paths: | ||
- path: /events | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: events | ||
port: | ||
number: 80 | ||
- path: /bookings | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: bookings | ||
port: | ||
number: 80 | ||
- host: www.myevents.example | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: frontend | ||
port: | ||
number: 80 | ||
|
8d39e49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://blog.woodenstake.se/minikube-with-dns-on-apple-silicon/
https://stackoverflow.com/questions/52021925/kubernetes-ingress-non-root-path-404-not-found
https://velog.io/@gentledev10/install-minikube
kubectl describe ingress myevents
8d39e49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack/webpack-dev-server#547
https://stackoverflow.com/questions/65734632/should-dockerfile-execute-npm-install-and-npm-run-build-or-should-it-only-co
https://stackoverflow.com/questions/66937713/webpack-react-ingress-nginx-kubernetes-shows-bad-gateway
https://stackoverflow.com/questions/57523726/kubernetes-ingress-not-loading-static-assets
https://kgw7401.tistory.com/99
webpack serve --host 0.0.0.0
docker image build -t myevents/frontend -f Dockerfile.frontend3 . --no-cache
cat /etc/passwd
sudo brew services restart chipmk/tap/docker-mac-net-connect