Skip to content

Instantly share code, notes, and snippets.

Avatar

Bruce Kyle brucedkyle

View GitHub Profile
@brucedkyle
brucedkyle / apply-ngnix-yml.sh
Last active Dec 30, 2020
kubernetes deployment
View apply-ngnix-yml.sh
kubectl apply -f nginx-deployment.yml
View minimal-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
View container-with-volume.yaml
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
volumeMounts:
- name: redis-storage
View job-kubectl-create-dryrun.sh
kubectl create job job1 -o yaml --dry-run=client --image=busybox
View ngnix.yaml
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 Oct 29, 2020
Create AKS resources
View azure-vote.yaml
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 Sep 13, 2020
Azure Resource Providers
View listresourceproviders.bash
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 Sep 12, 2020
Resource Group Lifecycle
View create-resource-group.ps1
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 Jul 3, 2020
Create and deploy a custom policy
View assign-policy-definition-to-scope.bash
SCOPE=/subscriptions/$SUBSCRIPTION_ID
az policy assignment create --name "Require https for storage in subscription" --scope $SCOPE \
--policy "denyStorageAccountNotUsingHttps" \
--params '{ "effectType" : { "value": "Deny" } }'
@brucedkyle
brucedkyle / basics-with-git.bash
Last active Jul 19, 2020
Samples for using Git
View basics-with-git.bash
mkdir myclonedrepo && cd myclonedrepo
git clone $REPOSITORY_URL
cd $PROJECT_NAME
git status
# create a new file and add
echo "print('new')" > newpythonfile.py
cat newpythonfile.py # displays the new python file