-
Notifications
You must be signed in to change notification settings - Fork 1
Kubernetes Locally
First you need to get your LAN IP address
# macOS
ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'
Example response:
192.168.1.74
For this example we'll use http://192.168.1.74
as an example, but
you will have to change this value with your IP.
We can use an external cloud database or we can spin one up in Docker. Anyhow we need a connectionstring.
If you don't use your own then do the following.
docker run -p 1433:1433 --name local_kube_db mcr.microsoft.com/mssql/server
The connectionstring will be
Server=http://192.168.1.74:1433;Database=db_name;User=sa;Password=Your_password123;
docker build -t ui --build-arg APP_URL=http://192.168.1.74 --build-arg GATEWAY_URL=http://192.168.1.74:30010 .
Copy and paste appsettings.json
and rename it to appsettings.k8s.json
Set the following values based on your IP.
"PackageApiUrl": "http://192.168.1.74:30001",
"LocationApiUrl": "http://192.168.1.74:30002",
"PersonApiUrl": "http://192.168.1.74:30003"
Build the image with build-arg BUILD_ENV
as defined in the Dockerfile.
Set this variable to k8s
to use appsettings.k8s.json
.
docker build -t gateway --build-arg BUILD_ENV=k8s .
Copy and paste appsettings.json and rename it to appsettings.k8s.json
Set the following values based on your IP.
"ConnectionString": "Server=http://192.168.1.74:1433;Database=pakket_db;User=sa;Password=Your_password123;"
Build the image with build-arg BUILD_ENV
as defined in the Dockerfile.
Set this variable to k8s
to use appsettings.k8s.json
.
docker build -t pakketsvc --build-arg BUILD_ENV=k8s .
Copy and paste appsettings.json and rename it to appsettings.k8s.json
Set the following values based on your IP.
"ConnectionString": "Server=http://192.168.1.74:1433;Database=location_db;User=sa;Password=Your_password123;"
Build the image with build-arg BUILD_ENV
as defined in the Dockerfile.
Set this variable to k8s
to use appsettings.k8s.json
.
docker build -t locationsvc --build-arg BUILD_ENV=k8s .
docker build -t personeelsvc .
Go to /docs/deployments/local
and run
kubectl apply -f .
FIPost should now be available on 192.168.1.74:30080 (your ip might differ)!