Skip to content

Instantly share code, notes, and snippets.

View brucedkyle's full-sized avatar

Bruce Kyle brucedkyle

View GitHub Profile
@brucedkyle
brucedkyle / DEBUG.txt
Created April 6, 2023 19:37
crc startup --log-level debug
crc start --log-level debug
DEBU CRC version: 2.15.0+21126a2
DEBU OpenShift version: 4.12.5
DEBU Podman version: 4.3.1
DEBU Running 'crc start'
DEBU Total memory of system is 34098995200 bytes
WARN A new version (2.16.0) has been published on https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.16.0/crc-windows-installer.zip
DEBU Checking file: C:\Users\6J1943897\.crc\machines\crc\.crc-exist
INFO Checking if running in a shell with administrator rights
DEBU Running '$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent());$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)'
@brucedkyle
brucedkyle / apply-ngnix-yml.sh
Last active December 30, 2020 18:39
kubernetes deployment
kubectl apply -f nginx-deployment.yml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
volumeMounts:
- name: redis-storage
@brucedkyle
brucedkyle / job-kubectl-create-dryrun.sh
Last active November 4, 2020 22:52
Basic kubectl commands
kubectl create job job1 -o yaml --dry-run=client --image=busybox
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
@brucedkyle
brucedkyle / azure-vote.yaml
Last active October 29, 2020 18:53
Create AKS resources
apiVersion: apps/v1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
selector:
matchLabels:
app: azure-vote-back
template:
@brucedkyle
brucedkyle / listresourceproviders.bash
Last active September 13, 2020 18:59
Azure Resource Providers
az provider list --query "[].{Provider:namespace, Status:registrationState}" --out table
# register the Microsoft.Batch provider
az provider register --namespace Microsoft.Batch
# show the provider registration state
az provider show --namespace Microsoft.Batch
@brucedkyle
brucedkyle / create-resource-group.ps1
Last active September 12, 2020 20:48
Resource Group Lifecycle
Connect-AzAccount
# You may have more than one subscription.
$SUBSCRIPTION_ID= Read-Host -p "Enter your subscription id"
Select-AzSubscription -Subscription $SUBSCRIPTION_ID
# Set environment variables
$LOCATION = Read-Host -p "Enter your region, such as WestUS "
$RESOURCE_GROUP_NAME = Read-Host -p "Enter your resource group name "
@brucedkyle
brucedkyle / assign-policy-definition-to-scope.bash
Last active July 3, 2020 20:41
Create and deploy a custom policy
SCOPE=/subscriptions/$SUBSCRIPTION_ID
az policy assignment create --name "Require https for storage in subscription" --scope $SCOPE \
--policy "denyStorageAccountNotUsingHttps" \
--params '{ "effectType" : { "value": "Deny" } }'