Service v1 core
--------------------------
kind: Service
apiVersion: v1
metadata:
# Unique key of the Service instance
name: service-example
spec:
ports:
# Accept traffic sent to port 80
- name: http
port: 80
targetPort: 80
selector:
# Loadbalance traffic across Pods matching
# this label selector
app: nginx
# Create an HA proxy in the cloud provider
# with an External IP address - *Only supported
# by some cloud providers*
type: LoadBalancer
apiVersion: v1
kind: Service
metadata:
name: hello-svc
labels:
app: hello-world
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30001
protocol: TCP
selector:
app: hello-world
apiVersion: v1
kind: Service
metadata:
name: helloworld-service
spec:
ports:
- port: 31001
nodePort: 31001
targetPort: nodejs-port
protocol: TCP
selector:
app: helloworld
type: NodePort
apiVersion: v1
kind: Service
metadata:
name: helloworld-service
spec:
ports:
- port: 80
targetPort: nodejs-port
protocol: TCP
selector:
app: helloworld
type: LoadBalancer
apiVersion: v1
kind: Service
metadata:
name: helloworld-nginx-service
spec:
ports:
- port: 80
protocol: TCP
selector:
app: helloworld-nginx
type: NodePort
apiVersion: v1
kind: Service
metadata:
name: hello-svc
labels:
app: hello-world
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30001
protocol: TCP
selector:
app: hello-world
apiVersion: v1
kind: Service
metadata:
name: hello-svc
labels:
app: hello-world
spec:
type: NodePort
ports:
- port: 80
nodePort: 30001
protocol: TCP
selector:
app: hello-world
Kubernetes – CKA Certification Overview – By DevOpsSchool.com
Session 1 – Kubernetes – CKA Certification – Introduction – Part 1 Out of 13
Session 2 – Kubernetes – CKA Certification – Introduction – Part 2 Out of 13
Session 3 – Kubernetes – CKA Certification – Introduction – Part 3 Out of 13
Session 4 – Kubernetes – CKA Certification – Introduction – Part 4 Out of 13
Session 5 – Kubernetes – CKA Fundamental Certification for Beginners with Demo – Part 5 Out of 13
Session 6 – Kubernetes – CKA Fundamental to Essential Certification – Introduction Part 6 Out of 13
Session 7 – Kubernetes – CKA Fundamental Certification – Introduction – Part 7 Out of 13
Session 8 – Kubernetes – CKA Certification – Introduction – Part 8 Out of 13
Session 9 – Kubernetes – CKA Certification – Introduction – Part 9 Out of 13
Session 10 – Kubernetes – CKA Certification – Introduction – Part 10 Out of 13
Session 11 – Kubernetes – CKA Certification – Introduction – Part 11 Out of 13
Session 12 – Kubernetes – CKA Certification – Introduction – Part 12 Out of 13
Session 13 – Kubernetes – CKA Certification – Introduction – Part 13 Out of 13
Latest posts by Rajesh Kumar (see all)
- Gradle versions, their supported Java versions, and unsupported Java versions - December 23, 2024
- An Introduction of GitLab Duo - December 22, 2024
- Best Hospitals for affordable surgery for medical tourism - December 20, 2024