Skip to content

Instantly share code, notes, and snippets.

View markjacksonfishing's full-sized avatar
🎣
Fishing

Mark Jackson markjacksonfishing

🎣
Fishing
View GitHub Profile
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status
set -o pipefail # Fail if any piped command fails
# Variables (Adjust as needed)
DB_ROOT_PASSWORD="strong_root_password"
DB_NAME="my_project_db"
DB_USER="project_user"
DB_USER_PASSWORD="strong_user_password"
@markjacksonfishing
markjacksonfishing / troubleshoot_backstage.ps1
Created August 12, 2024 23:58
troubleshoot_backstage.ps1
# Set variables
$namespace = "default"
$serviceAccount = "backstage-sa"
$roleBinding = "backstage-sa-binding"
$tokenFile = "backstage-sa-token.txt"
$kubeApiServer = "https://127.0.0.1:50442"
$appConfigPath = "./app-config.yaml"
Write-Host "Starting troubleshooting for Backstage Kubernetes integration..." -ForegroundColor Green
#!/bin/bash -e
# --------------------------------------------------------------
# Backstage Kubernetes Debug Script
# --------------------------------------------------------------
# This script helps troubleshoot and validate the integration
# between a Backstage app and a Kubernetes cluster (AKS). It:
# 1. Checks if the required command-line tools (Azure CLI and kubectl) are installed.
# 2. Verifies Azure login status.
# 3. Assigns the necessary RBAC role to a specified service principal or user.
@markjacksonfishing
markjacksonfishing / aws_auth.sh
Last active August 4, 2024 14:06
Backstage aws auth
#!/bin/bash
# Check if AWS environment variables are set
if [ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_SECRET_ACCESS_KEY" ] || [ -z "$AWS_SESSION_TOKEN" ]; then
echo "One or more AWS environment variables are missing. Please check your environment."
exit 1
fi
echo "AWS environment variables are set correctly."
#!/bin/bash
# Log file
LOGFILE="backstage_debug.log"
# Function to log messages
log() {
echo "$(date +'%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOGFILE"
}
#!/bin/bash
# Function to prompt user for input
prompt_user_input() {
read -p "Enter your GCP Project ID: " PROJECT_ID
read -p "Enter your GKE Cluster Name: " CLUSTER_NAME
read -p "Enter your GKE Cluster Zone: " ZONE
LOG_FILE="setup_gke_backstage.log"
}
#!/bin/bash
# Variables - Please update these variables with your actual values
BACKSTAGE_ACCOUNT_ID="1111111111"
EKS_ACCOUNT_ID="2222222222"
EKS_CLUSTER_NAME="EKS-secure-coding-cluster"
BACKSTAGE_ROLE_NAME="Backstage"
CA_KEY="<CA_KEY>"
REGION="us-east-1"
AWS_PROFILE_BACKSTAGE="backstage-profile"
#!/bin/bash
# Variables - Please update these variables with your actual values
BACKSTAGE_ACCOUNT_ID="1111111111"
EKS_ACCOUNT_ID="2222222222"
EKS_CLUSTER_NAME="EKS-secure-coding-cluster"
BACKSTAGE_ROLE_NAME="Backstage"
CA_KEY="<CA_KEY>"
REGION="us-east-1"
AWS_PROFILE_BACKSTAGE="backstage-profile"
@markjacksonfishing
markjacksonfishing / readme.md
Created January 13, 2020 02:51 — forked from jimangel/readme.md
Examples of how to test the impact of the v1.16 API deprecations

Kubernetes v1.16 API deprecation testing

Examples of how to test the impact of the v1.16 API deprecations and ways to debug early!

If this is the first time you're hearing of these deprecations STOP and read this blog post (thanks @vllry!).

Common misunderstandings

  1. The exact apiVersion: value that I use in my manifest is stored in on disk (etcd).
apiVersion: v1
kind: Service
metadata:
name: kube-struts-svc
spec:
type: LoadBalancer
ports:
- port: 8080
selector:
app: kube-struts-pod