Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekrana committed Sep 23, 2023
1 parent f1731af commit 72b1041
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
31 changes: 31 additions & 0 deletions k8s/templates/hello-world/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
labels:
app: hello-world
app.kubernetes.io/name: hello-world
app.kubernetes.io/instance: tech-stack
app.kubernetes.io/version: '0.1.0'
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
app.kubernetes.io/name: hello-world
app.kubernetes.io/instance: tech-stack
template:
metadata:
labels:
app: hello-world
app.kubernetes.io/name: hello-world
app.kubernetes.io/instance: tech-stack
spec:
containers:
- name: hello-world
image: abhishekrana502/hello-world:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
protocol: TCP
18 changes: 18 additions & 0 deletions k8s/templates/hello-world/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
labels:
app.kubernetes.io/name: hello-world
app.kubernetes.io/instance: tech-stack
app.kubernetes.io/version: '0.1.0'
spec:
type: ClusterIP
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: hello-world
app.kubernetes.io/instance: tech-stack
22 changes: 22 additions & 0 deletions k8s/templates/nginx/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
# image: abhishekrana502/hello-world:latest
ports:
- containerPort: 80
17 changes: 17 additions & 0 deletions k8s/templates/nginx/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
ports:
- port: 80 # the port that this service should serve on
# the container on each pod to connect to, can be a name
# (e.g. 'www') or a number (e.g. 80)
targetPort: 80
protocol: TCP
# just like the selector in the deployment,
# but this time it identifies the set of pods to load balance
# traffic to.
selector:
app: nginx
# type: LoadBalancer

0 comments on commit 72b1041

Please sign in to comment.