diff --git a/Containerization & Orchestration/Kubernetes/workloads/09-Services.md b/Containerization & Orchestration/Kubernetes/workloads/09-Services.md index aa5f782..a4a3812 100644 --- a/Containerization & Orchestration/Kubernetes/workloads/09-Services.md +++ b/Containerization & Orchestration/Kubernetes/workloads/09-Services.md @@ -48,6 +48,13 @@ kubectl get ep -n kubectl get svc -n ``` + +```bash +kubectl expose deployment web-server-dep -n dev --port 80 +``` + + + --- ## 🔁 **Port Forwarding** @@ -99,3 +106,21 @@ spec: > 🔍 **Note:** The `selector` must match the labels of the target Pods. > 🧠 **Tip:** Use `kubectl describe svc ` to inspect the service and verify connectivity. + +```yaml +apiVersion: v1 +kind: Service +metadata: + name: nginx + namespace: ns + labels: + app: web-server +spec: + type: LoadBalancer + selector: + app: nginx + ports: + - name: http + port: 80 + targetPort: 8080 +``` diff --git a/Containerization & Orchestration/Kubernetes/workloads/11-Pv.md b/Containerization & Orchestration/Kubernetes/workloads/11-Pv.md index 35a594b..aa7fa5b 100644 --- a/Containerization & Orchestration/Kubernetes/workloads/11-Pv.md +++ b/Containerization & Orchestration/Kubernetes/workloads/11-Pv.md @@ -108,6 +108,19 @@ spec: type: DirectoryOrCreate ``` +```yaml +spec: + containers: + volumeMounts: + - name: nginx-log + mountPath: /var/log/nginx + +volumes: + - name: nginx-log + emptyDir: + sizeLimit: 500Mi +``` + --- ## 📂 Example 2: NFS-backed Persistent Volume