0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-30 18:42:56 +00:00

feat: Improve kubernetes deployment

This commit is contained in:
Alexander Konietzko 2023-09-02 19:17:19 +02:00
parent f8e9ad741c
commit 699d0a725d
No known key found for this signature in database
GPG Key ID: BA6905F37AEC2B5B
2 changed files with 10 additions and 13 deletions

View File

@ -63,10 +63,8 @@ Running the container
### Using Kubernetes
1. Change the ConnectionString in the appsettings.json to `Server=clean-architecture-db-service;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#`
2. Change the RedisHostName in the appsettings.json to `redis-service`
3. Change the RabbitMQ Host in the appsettings.json to `rabbitmq-service`
4. Build the docker image and push it to the docker hub (Change the image name in the `k8s-deployment.yml` to your own)
1. Change the ConnectionString in the appsettings.json to `Server=sql-server;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#`
2. Build the docker image and push it to the docker hub (Change the image name in the `k8s-deployment.yml` to your own)
Apply the deployment file: `kubectl apply -f k8s-deployment.yml` (Delete: `kubectl delete -f k8s-deployment.yml`)

View File

@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: clean-architecture-app
name: clean-architecture-deployment
spec:
replicas: 1
selector:
@ -15,7 +15,7 @@ spec:
containers:
- name: clean-architecture-app
# Replace this with the path to your built image
image: alexdev28/clean-architecture
image: alexdev28/clean-architecture:latest
ports:
- containerPort: 80
@ -23,7 +23,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: clean-architecture-service
name: clean-architecture
spec:
selector:
app: clean-architecture-app
@ -37,7 +37,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: sql-server
name: sql-server-deployment
spec:
replicas: 1
selector:
@ -50,7 +50,7 @@ spec:
spec:
containers:
- name: sql-server
image: mcr.microsoft.com/mssql/server
image: mcr.microsoft.com/mssql/server:latest
env:
- name: ACCEPT_EULA
value: "Y"
@ -63,7 +63,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: clean-architecture-db-service
name: sql-server
spec:
selector:
app: sql-server
@ -71,7 +71,6 @@ spec:
- protocol: TCP
port: 1433
targetPort: 1433
type: ClusterIP
---
apiVersion: apps/v1
@ -110,7 +109,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: redis-service
name: redis
spec:
selector:
app: redis
@ -156,7 +155,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: rabbitmq-service
name: rabbitmq
spec:
selector:
app: rabbitmq