Anul 3 Semestrul 2

This commit is contained in:
2025-07-03 20:56:38 +03:00
parent 184f3bd92e
commit 3b7fb85767
269 changed files with 20955 additions and 0 deletions
@@ -0,0 +1,57 @@
# kubernetes-deployment-service.yaml
# ---- Deployment ----
# This object defines how to run and manage your application pods.
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend # Name of the Deployment
labels:
app: react-app # Label to identify resources related to this app
spec:
replicas: 1 # Number of desired pods (you can adjust this)
selector:
matchLabels:
app: frontend # This must match the labels in the Pod template
template: # Defines the Pod that will be created
metadata:
labels:
app: frontend # Labels applied to each Pod
spec:
containers:
- name: frontend # Name of the container within the Pod
image: frontend:latest # <<< IMPORTANT: Replace with your actual image name and tag
# Ensure this image is accessible by your Kubernetes cluster.
imagePullPolicy: Always # Or "IfNotPresent" if you prefer, especially for "latest" tags
ports:
- containerPort: 80 # The port your Nginx server is listening on inside the container
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "200m"
memory: "256Mi"
---
# ---- Service ----
# This object defines how to access your application.
apiVersion: v1
kind: Service
metadata:
name: react-app-service # Name of the Service
labels:
app: frontend # Label to identify resources related to this app
spec:
type: LoadBalancer # Exposes the Service externally using a cloud provider's load balancer.
# Alternatives:
# - NodePort: Exposes the Service on each Node's IP at a static port.
# - ClusterIP: Exposes the Service on a cluster-internal IP (default).
# - Ingress: For more advanced HTTP/HTTPS routing (requires an Ingress controller).
selector:
app: frontend # This must match the labels of the Pods you want to target (from the Deployment)
ports:
- protocol: TCP
port: 3000 # The port the Service will be available on (externally or within the cluster)
targetPort: 80 # The port on the Pods (containerPort) that the Service will forward traffic to