Skip to content

Commit

Permalink
updated files
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwembo committed Apr 13, 2024
1 parent c607737 commit 1bece52
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
42 changes: 42 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: cloudapp-django-web
spec:
replicas: 2
selector:
matchLabels:
app: cloudapp-django-web
template:
metadata:
labels:
app: cloudapp-django-web
spec:
containers:
- name: cloudapp-django-web
image: joelwembo/cloudapp-django-web:latest
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
ports:
- containerPort: 80

---
apiVersion: v1
kind: Service
metadata:
name: load-balancer
labels:
app: cloudapp-django-web
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 80
protocol: TCP
nodePort: 31009
selector:
app: cloudapp-django-web
2 changes: 1 addition & 1 deletion deployments/Jenkins/JenkinsfileEKS
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pipeline {
sh "aws eks --region us-east-1 update-kubeconfig --name mycluster"

// Deploy to EKS // k8s deployments folder
sh "kubectl apply -f deployments/k8s/deployment.yaml --namespace=${EKS_NAMESPACE}"
sh "kubectl apply -f deployments/k8s/deployment.yaml --namespace=default"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions deployments/deploy-aws-eks-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ PORT=80
export KUBECONFIG="$KUBECONFIG"

# Apply Kubernetes manifests
kubectl apply -f k8s/deployment.yaml
kubectl apply -f deployments/k8s/deployment.yaml

# Update the Docker image in the deployment
kubectl set image deployment/$DEPLOYMENT_NAME $DEPLOYMENT_NAME=$DOCKER_IMAGE -n $NAMESPACE

# Expose the deployment as a service
kubectl expose deployment $DEPLOYMENT_NAME --type=LoadBalancer --port=$PORT --target-port=$PORT -n $NAMESPACE --name=$SERVICE_NAME
kubectl expose deployment cloudapp-django-web --type=LoadBalancer --port=80 --target-port=8585-n $NAMESPACE --name=cloudapp-django-web

0 comments on commit 1bece52

Please sign in to comment.