Skip to content

Instantly share code, notes, and snippets.

# Create Linux Azure AKS Spot instance Node Pool
# Required extension:
# az extension add --name aks-preview
#
resource "azurerm_kubernetes_cluster_node_pool" "nodepool_cpu_spot" {
#availability_zones = [1, 2, 3]
enable_auto_scaling = true
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks_cluster.id
max_count = 3
min_count = 1
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@sathishphcl
sathishphcl / backup-dls.ps1
Created January 20, 2024 04:16 — forked from DaveRuijter/backup-dls.ps1
This PowerShell script performs a copy between two storage accounts using AzCopy.
param(
[String]$sourceStorageAccount,
[String]$targetStorageAccount,
[String]$sourceFolder,
[String]$targetFolder,
[String]$sourceSasToken,
[String]$targetSasToken,
[String]$triggerPeriod,
[Int32]$azCopyConcurrency
)
@sathishphcl
sathishphcl / core-arch-training.md
Created August 29, 2024 01:18 — forked from mikesparr/core-arch-training.md
Core cloud architecture training videos

The following videos, or playlists, can help ensure consistent knowledge amongst all core team members and help make customer support easier.

  • CS fundamentals - 12-min videos (9 hr)

    • Learn about computer origins, transistors, logic gates, and computer architecture

    • Learn about binary, bits, and bytes (bits, bytes, and octets key in networking)

    • Computer architecture, programming, languages, ML, robotics

@sathishphcl
sathishphcl / 01-architecting-solutions.md
Created August 29, 2024 15:00 — forked from mikesparr/01-architecting-solutions.md
Study Guide for GCP Professional Cloud Architect exam (notes from refresher course)

Architecting for the cloud

  • Architect solutions to be scalable and reilient
  • Business requirements involve lowering costs / enhancing user experience
  • Keep an eye on technical needs during development and operation

3 Major Questions To Ask

  1. Where is the company coming from
@sathishphcl
sathishphcl / gcp-global-lb-multi-region-cr-ce.sh
Created August 29, 2024 15:04 — forked from mikesparr/gcp-global-lb-multi-region-cr-ce.sh
Demonstrating how you can deploy Cloud Run (serverless) or Compute Engine instance groups across regions and balance with global load balancer
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/run/docs/multiple-regions
# - https://cloud.google.com/compute/docs/instance-groups/distributing-instances-with-regional-instance-groups
# - https://cloud.google.com/load-balancing/docs/https/setup-global-ext-https-compute
# - https://cloud.google.com/load-balancing/docs/backend-service#named_ports
#####################################################################
@sathishphcl
sathishphcl / cloud-run-nat-serial.sh
Created August 29, 2024 15:07 — forked from mikesparr/cloud-run-nat-serial.sh
Experiment on Google Cloud with Cloud Run, Cloud NAT, Private Google Access, and Secure Web Proxy with NAT only for external requests
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/sdk/gcloud/reference/compute/networks/create
# - https://cloud.google.com/sdk/gcloud/reference/compute/networks/subnets/create
# - https://cloud.google.com/vpc/docs/configure-private-google-access
# - https://cloud.google.com/network-connectivity/docs/router/how-to/create-router-vpc-network#gcloud
# - https://cloud.google.com/nat/docs/set-up-manage-network-address-translation
# - https://cloud.google.com/nat/docs/using-nat-rules
@sathishphcl
sathishphcl / gcp-vpn-vpc-to-vpc.sh
Created August 29, 2024 15:11 — forked from mikesparr/gcp-vpn-vpc-to-vpc.sh
Example setting up Cloud VPN on Google Cloud Platform (GCP) to connect two VPCs
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/sql/docs/postgres/configure-private-ip
# - https://cloud.google.com/build/docs/private-pools/set-up-private-pool-to-use-in-vpc-network#setup-private-connection
# - https://cloud.google.com/network-connectivity/docs/vpn/how-to/creating-ha-vpn2#gcloud
# - https://cloud.google.com/network-connectivity/docs/vpn/how-to/creating-ha-vpn (optional with peering)
#####################################################################
@sathishphcl
sathishphcl / org-policies-gcloud-gcp.sh
Created August 29, 2024 15:21 — forked from mikesparr/org-policies-gcloud-gcp.sh
Recommended GCP Organization Policies
#####################################################################
# ORG POLICIES (SET ON DEMO PARENT FOLDER FOR DEMO [SHOULD SET ON ORG])
# REF: https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints#how-to_guides
# REF: https://cloud.google.com/storage/docs/org-policy-constraints
#####################################################################
# disable external IPs for VMs
export IP_POLICY_FILE=policy-extip.json
cat > $IP_POLICY_FILE << EOF
{
"constraint": "constraints/compute.vmExternalIpAccess",
@sathishphcl
sathishphcl / gcp-startup-script-secret-manager.sh
Created August 29, 2024 15:21 — forked from mikesparr/gcp-startup-script-secret-manager.sh
Example fetching and using Google Cloud Platform Secret Manager secrets from Compute Engine VM startup script
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://cloud.google.com/secret-manager/docs/create-secret-quickstart
# - https://cloud.google.com/secret-manager/docs/manage-access-to-secrets
# - https://cloud.google.com/secret-manager/docs/creating-and-managing-expiring-secrets
# - https://cloud.google.com/secret-manager/docs/secret-rotation
# - https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances
# - https://cloud.google.com/iam/docs/best-practices-service-accounts#single-purpose