Setup some variables first
export PROJECT_ID=$(gcloud config get-value project)
export REGION=europe-west3 # should be the same as your mig
export MIG_NAME=service-x-mig # or whatever you already have| param( | |
| [string]$Url, | |
| [string]$OutDir = ".\download" | |
| ) | |
| # Load .env file | |
| function Load-EnvFile { | |
| $envPath = Join-Path $PSScriptRoot ".env" | |
| if (-not (Test-Path $envPath)) { |
| RANCHER_URL=https://rancher-ui.com | |
| RANCHER_USER=user | |
| RANCHER_PASS=pass | |
| KUBE_USER=kube-user |
| VAULT_TOKEN=<your token> |
| import os | |
| import shutil | |
| import gitlab | |
| from git import Repo | |
| import time | |
| # Configuration | |
| GITLAB_URL = "https://git.acme.dk" | |
| GITLAB_TOKEN = "..." |
| This is confirmed working with Harbor v2.0.0 | |
| # Parameters ------------------------ | |
| HARBOR_URL="https://reg.registry.dk" | |
| HARBOR_USER="username" | |
| HARBOR_PASSWORD="secret" | |
| PROJECT="project" | |
| REPOSITORY="repository" | |
| TAG="0.0.1" |
| # Step 1: Use the kasten UI to create a role (<role>) | |
| # Create service account for those who needs access | |
| kubectl create serviceaccount <user> --namespace kasten-io | |
| # For the namespace that the user needs access to: | |
| kubectl create rolebinding backup_manager1 --namespace <namespace> \ | |
| --clusterrole=<role> \ | |
| --serviceaccount=kasten-io:<user> | |
| # THIS IS A VERY HACKY AD-HOC SOLUTION TO BALANCE NODES BASED ON MEMORY USAGE ACROSS THE CLUSTER | |
| import subprocess | |
| import json | |
| import time | |
| def execute_kubectl_command(command): | |
| """Executes a kubectl command and returns the output.""" | |
| full_command = ["kubectl"] + command.split() | |
| result = subprocess.run(full_command, capture_output=True, text=True) |
| #!/bin/bash | |
| fix_rgb() { | |
| fixes=0 | |
| dryrun=false | |
| if [ ! -t 0 ]; then | |
| read -p "Do you want to proceed with fixing? (y/n): " answer | |
| if [ "$answer" = "n" ]; then | |
| dryrun=true |
| { | |
| init: function(elevators, floors) { | |
| // helper function to check if a floor is already queued | |
| function isFloorQueued(elevator, floorNum) { | |
| return elevator.destinationQueue.indexOf(floorNum) > -1; | |
| } | |
| function isFloorQueuedForAnyElevator(floorNum) { | |
| for (let e = 0; e < elevators.length; e++) { |