[//]: # (Confidential document)
[//]: # (01/05/2025)
[//]: # (v 1.7.3)


# Kubernetes labs v1.7.3  - Network

##  Services

Services within Kubernetes are the unified method of accessing the exposed workloads of Pods. They are a durable resource (unlike Pods) that is given a static cluster-unique IP and provide simple load-balancing through kube-proxy.


## Lab 1 : Services
 - Create single and multi-container Pods
 - Labes pods
 - Create a ClusterIP service and view the different ways it is accessible within the cluster

```
kubectl create -f manifests/pod-example.yaml
kubectl create -f manifests/pod-multi-container-example.yaml
kubectl label pod pod-example app=nginx environment=dev
kubectl label pod multi-container-example  app=nginx environment=prod
kubectl create -f manifests/service-clusterip.yaml
kubectl describe service clusterip

kubectl proxy
```
create a new ssh session and consult the URL

```
ssh -i XXX.pem -L 8001:localhost:8001 ubuntu@IP
```
-  http://127.0.0.1:8001/api/v1/namespaces/dev/services/clusterip/proxy/



## Clean up

```
kubectl delete -f manifests/

```