update scripts
This commit is contained in:
@@ -48,6 +48,13 @@ kubectl get ep -n <namespace>
|
|||||||
kubectl get svc -n <namespace>
|
kubectl get svc -n <namespace>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl expose deployment web-server-dep -n dev --port 80
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔁 **Port Forwarding**
|
## 🔁 **Port Forwarding**
|
||||||
@@ -99,3 +106,21 @@ spec:
|
|||||||
> 🔍 **Note:** The `selector` must match the labels of the target Pods.
|
> 🔍 **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.
|
> 🧠 **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
|
||||||
|
```
|
||||||
|
|||||||
@@ -108,6 +108,19 @@ spec:
|
|||||||
type: DirectoryOrCreate
|
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
|
## 📂 Example 2: NFS-backed Persistent Volume
|
||||||
|
|||||||
Reference in New Issue
Block a user