update scripts

This commit is contained in:
2025-07-21 17:52:10 +03:30
parent cbbda9db6f
commit e41aa509c6
2 changed files with 38 additions and 0 deletions

View File

@@ -48,6 +48,13 @@ kubectl get ep -n <namespace>
kubectl get svc -n <namespace>
```
```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 <service-name>` 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
```

View File

@@ -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