21 lines
515 B
Bash
Executable File
21 lines
515 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Prompt user for MariaDB root password
|
|
read -sp "Enter MariaDB root password: " ROOT_PASSWORD
|
|
echo ""
|
|
|
|
# Ensure the password is not empty
|
|
if [[ -z "$ROOT_PASSWORD" ]]; then
|
|
echo "Error: Password cannot be empty."
|
|
exit 1
|
|
fi
|
|
|
|
# Define namespace
|
|
NAMESPACE="phpipam"
|
|
|
|
# Create the Kubernetes secret
|
|
kubectl create secret generic mariadb-secret \
|
|
--from-literal=root-password="$ROOT_PASSWORD" \
|
|
--namespace="$NAMESPACE"
|
|
|
|
echo "✅ MariaDB secret created successfully in namespace '$NAMESPACE'." |