Skip to content

Commit

Permalink
Update the manifests
Browse files Browse the repository at this point in the history
Signed-off-by: bharathappali <abharath@redhat.com>
  • Loading branch information
bharathappali committed Aug 9, 2023
1 parent 541ac38 commit cb52066
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 24 deletions.
26 changes: 16 additions & 10 deletions manifests/crc/BYODB-installation/minikube/kruize-crc-minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,20 @@ data:
}
server {
listen 80;
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /api/ {
root /usr/share/nginx/html;
location ^~ /api/ {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://kruize-api;
}
location / {
index index.html;
error_page 404 =200 /index.html;
}
}
}
---
Expand All @@ -171,8 +173,8 @@ spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: 80
port: 8080
targetPort: 8080
selector:
app: kruize-ui-nginx
---
Expand All @@ -186,8 +188,11 @@ metadata:
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:test
image: docker.io/bharathappali/kruize-ui:central-config
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
value: "production"
volumeMounts:
- name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
Expand All @@ -196,3 +201,4 @@ spec:
- name: nginx-config-volume
configMap:
name: nginx-config

Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,72 @@ spec:
- port: kruize-port
interval: 30s
path: /metrics
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: openshift-tuning
data:
nginx.conf: |
events {}
http {
upstream kruize-api {
server kruize:8080;
}
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;
location ^~ /api/ {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://kruize-api;
}
location / {
index index.html;
error_page 404 =200 /index.html;
}
}
}
---
apiVersion: v1
kind: Service
metadata:
name: kruize-ui-nginx-service
namespace: openshift-tuning
spec:
type: NodePort
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: kruize-ui-nginx
---
apiVersion: v1
kind: Pod
metadata:
name: kruize-ui-nginx-pod
namespace: openshift-tuning
labels:
app: kruize-ui-nginx
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
value: "production"
volumeMounts:
- name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
volumes:
- name: nginx-config-volume
configMap:
name: nginx-config
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,20 @@ data:
}
server {
listen 80;
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /api/ {
root /usr/share/nginx/html;
location ^~ /api/ {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://kruize-api;
}
location / {
index index.html;
error_page 404 =200 /index.html;
}
}
}
---
Expand All @@ -249,8 +251,8 @@ spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: 80
port: 8080
targetPort: 8080
selector:
app: kruize-ui-nginx
---
Expand All @@ -264,8 +266,11 @@ metadata:
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:test
image: docker.io/bharathappali/kruize-ui:central-config
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
value: "production"
volumeMounts:
- name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
Expand All @@ -274,3 +279,4 @@ spec:
- name: nginx-config-volume
configMap:
name: nginx-config

Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,73 @@ spec:
- port: kruize-port
interval: 30s
path: /metrics
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: monitoring
data:
nginx.conf: |
events {}
http {
upstream kruize-api {
server kruize:8080;
}
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;
location ^~ /api/ {
rewrite ^/api(.*)$ $1 break;
proxy_pass http://kruize-api;
}
location / {
index index.html;
error_page 404 =200 /index.html;
}
}
}
---
apiVersion: v1
kind: Service
metadata:
name: kruize-ui-nginx-service
namespace: openshift-tuning
spec:
type: NodePort
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: kruize-ui-nginx
---
apiVersion: v1
kind: Pod
metadata:
name: kruize-ui-nginx-pod
namespace: openshift-tuning
labels:
app: kruize-ui-nginx
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
value: "production"
volumeMounts:
- name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
volumes:
- name: nginx-config-volume
configMap:
name: nginx-config

17 changes: 13 additions & 4 deletions scripts/common_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function check_running() {

check_pod=$1
check_pod_ns=$2
ignore_pod=$3
kubectl_cmd="kubectl -n ${check_pod_ns}"

echo "Info: Waiting for ${check_pod} to come up....."
Expand All @@ -29,8 +30,16 @@ function check_running() {
while true;
do
sleep 2
${kubectl_cmd} get pods | grep ${check_pod}
pod_stat=$(${kubectl_cmd} get pods | grep ${check_pod} | awk '{ print $3 }')
# Check if ignore pod is sent
if [[ ! -z "${ignore_pod}" ]]; then
${kubectl_cmd} get pods | grep ${check_pod} | grep -v ${ignore_pod}
pod_stat=$(${kubectl_cmd} get pods | grep ${check_pod} | grep -v ${ignore_pod} | awk '{ print $3 }')
else
${kubectl_cmd} get pods | grep ${check_pod}
pod_stat=$(${kubectl_cmd} get pods | grep ${check_pod} | awk '{ print $3 }')
fi


case "${pod_stat}" in
"Running")
echo "Info: ${check_pod} deploy succeeded: ${pod_stat}"
Expand All @@ -49,7 +58,7 @@ function check_running() {
*)
sleep 2
if [ $counter == 200 ]; then
${kubectl_cmd} describe pod ${scheck_pod}
${kubectl_cmd} describe pod ${check_pod}
echo "ERROR: Prometheus Pods failed to come up!"
exit -1
fi
Expand Down Expand Up @@ -95,7 +104,7 @@ kruize_crc_start() {
} else { print }
}' ${CRC_MANIFEST_FILE_OLD} > ${CRC_MANIFEST_FILE}
${kubectl_cmd} apply -f ${CRC_MANIFEST_FILE}
check_running kruize ${autotune_ns}
check_running kruize ${autotune_ns} kruize-ui
if [ "${err}" != "0" ]; then
# Indicate deploy failed on error
exit 1
Expand Down

0 comments on commit cb52066

Please sign in to comment.