Skip to content

Commit

Permalink
Serve External Traffic with K8s Services
Browse files Browse the repository at this point in the history
  • Loading branch information
codingforentrepreneurs committed Jan 9, 2024
1 parent ebbc952 commit d53cdc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion k8s/3-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: content-engine
spec:
replicas: 3
replicas: 10
selector:
matchLabels:
app: web
Expand Down
15 changes: 15 additions & 0 deletions k8s/4-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: content-engine
spec:
selector:
app: web
type: LoadBalancer # -> Node Balancer
# type: NodePort # public ip -> attached to the vm
# type: ClusterIp # private service
ports:
- name: http
protocol: TCP
port: 80 # mydomain.com -> mydomain.com:80
targetPort: 8080

0 comments on commit d53cdc9

Please sign in to comment.