first commit

This commit is contained in:
2025-11-06 06:41:45 +01:00
commit b8dceaf896
92 changed files with 5382 additions and 0 deletions

34
services/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Introduction to Kubernetes: Services
## Create a Kubernetes cluster
Firstly, we will need a Kubernetes cluster and will create one using [kind](https://kind.sigs.k8s.io/)
```
kind create cluster --name services --image kindest/node:v1.31.1
```
Test the cluster
```
kubectl get nodes
NAME STATUS ROLES AGE VERSION
services-control-plane Ready control-plane 5m48s v1.31.1
```
## Deploy a few pods
Let's deploy a few pods using a Kubernetes Deployment. To understand services, we need to deploy some pods that become our "upstream" or "endpoint" that we want to access. </br>
```
kubectl apply -f kubernetes/deployments/deployment.yaml
```
## Deploy a service
We can now deploy a Kubernetes service that targets our deployment:
```
kubectl apply -f kubernetes/services/service.yaml
```

15
services/service.yaml Normal file
View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: example-service
labels:
app: example-app
spec:
type: ClusterIP
selector:
app: example-app
ports:
- protocol: TCP
name: http
port: 80
targetPort: 5000