#!/usr/bin/env bash NGINX_CONFIGMAP=$(kubectl -n infctl create configmap nginx-config --from-file files/ctl/nginx/default.conf --dry-run=client -oyaml) if [ -z "$NGINX_CONFIGMAP" ]; then echo "Failed to create NGINX configmap." exit 1 fi echo "$NGINX_CONFIGMAP" | kubectl apply -f - if [ $? -ne 0 ]; then echo "Failed to apply NGINX configmap." exit 1 fi echo "NGINX configmap created successfully."