CC Us
CC Us
CC Us
Presented To:
Mam Tayyaba
Presented By:
Shooaib (18251598-005)
Luqman (18251598-012)
Ashar (18251598-045)
Topic Name:
Kubernetes
Kubernetes
Introduction:
Cluster IP
Node Port
Load Balancer
External Name
Types of Service
ClusterIP (default)
Exposes the Service on an internal IP in the cluster
This type makes the Service only reachable from within the
cluster
We can check it by minikube ssh and than clusterIP:port
NodePort
Exposes the Service on the same port of each selected Node in the
cluster
Port range is 30000 to 32767
Makes a Service accessible from outside the cluster using
<NodeIP>:<NodePort>
Types of Service
LoadBalancer
Creates an external load balancer for traffic
Assigns a fixed, external IP to the Service
ExternalName
To create a service that serves as an alias for an external service
Let’s say your database is on AWS and it has the following URL
test.database.aws.com
By create externalName you can have let’s say my-db diverted to
test.database.aws.com
Service commands
my-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
ports:
- port: 8080
targetPort: 80
selector:
app: myapp
type: LoadBalancer
HEALTH CHECK
HTTP GET
This type of probe send request on the container’s IP address, a
port and path you specify
Probe is considered a failure and Container will be automatically
restarted if
Probe receives error response code
Container app doesn’t respond at all
TCP SOCKET
TCP SOCKET
TCP Socket probe tries to open a TCP connection to the
specified port of the container
If the connection is established successfully, the probe is
successful
Otherwise, the container is restarted.
EXEC Probe
EXEC Probe
An Exec probe executes some commands you provide inside the
container and checks the command’s exit status code
If the status code is 0, the probe is successful
All other codes are considered failures
READINESS PROBES
TCP SOCKET
TCP Socket probe tries to open a TCP connection to the specified
port of the container
If the connection is established successfully, container will
marked as ready and it will receive traffic
Otherwise, Kubernetes will wait and rerun the probe to check the
status again
EXEC Probe
EXEC Probe
An Exec probe executes some commands you provide inside the
container and checks the command’s exit status code
If the status code is 0, the probe is successful
All other codes are considered failures
VOLUMES