added nodeport k8s in svc

This commit is contained in:
2025-08-02 14:02:46 +03:30
parent 61ddfa712f
commit 31639a8049

View File

@@ -107,6 +107,7 @@ spec:
> 🧠 **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 ```yaml
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
@@ -124,3 +125,20 @@ spec:
port: 80 port: 80
targetPort: 8080 targetPort: 8080
``` ```
```yaml
apiVersion: v1
kind: Service
metadata:
name: db-svc
namespace: db
spec:
type: NodePort
ports:
- name: sql
port: 3306
targetPort: 3306
nodePort: 30000
selector:
app: db
```