Skip to content

Commit

Permalink
simplied
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyan-manivasagam committed Apr 26, 2024
1 parent 31cfb93 commit 55369cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ This repo has the example code to run the php producer and consumer setup with k

## Steps to run in Local

Before start executing the below commands please make sure you have minikube installed and renamed the .env.default to .env and make sure all values are updated as per streamnative cluster.
Before start executing the below commands please make sure you have minikube,kubectl and set kubectl context to minikube and rename the env.default to .env and make sure all values are updated as per streamnative cluster.

minikube start
cd k8s
kubectl apply -f ./
cd ../source setenv.sh
minikube service nginx-service -n default

Then navigate to http://host/index.php to send messages

source setenv.sh

Then Enter some value the form and submit

Then navigate to http://host/consumer.php to see the messages
Expand Down
3 changes: 2 additions & 1 deletion k8s/nginx-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ data:
location / {
root /var/www/html;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ consumer\.php$ {
root /var/www/html;
fastcgi_pass consumer-service:9000;
Expand Down
6 changes: 6 additions & 0 deletions setenv.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

cd k8s
kubectl apply -f ./
cd ..

# Load the .env file
export $(grep -v '^#' .env | xargs)

Expand All @@ -20,3 +24,5 @@ kubectl set env deployment/producer-deployment SECURITY_PROTOCOL=$SECURITY_PROTO
TOPIC_NAME=$TOPIC_NAME \
CONSUMER_GROUP_ID=$CONSUMER_GROUP_ID

minikube service nginx-service -n default

0 comments on commit 55369cc

Please sign in to comment.