Skip to content

Instantly share code, notes, and snippets.

View pichuang's full-sized avatar

Phil Huang pichuang

View GitHub Profile
# {type}-{org}-{workload}-{env}-{region}-{instance}
# https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations
- rg-connectivity-prod-jpe-00
- vnet-connectivity-prod-jpe-00
- snet-vm-jpe
- snet-dnspr-in-prod-jpe
- snet-dnspr-out-prod-jpe
- GatewaySubnet
- vpng-prod-jpe-00 // VPN Gateway
- vcn-onpremise-00 // VPN Connection
# Onpremise Side
onpremise-vm 192.168.100.68
tcp-333 192.168.100.68 tcp=dstport:333
tcp-21 192.168.100.68 tcp=dstport:21
tcp-22 192.168.100.68 tcp=dstport:22
tcp-53 192.168.100.68 tcp=dstport:53
tcp-80 192.168.100.68 tcp=dstport:80
tcp-179 192.168.100.68 tcp=dstport:179
tcp-443 192.168.100.68 tcp=dstport:443
tcp-3399 192.168.100.68 tcp=dstport:3389
#cloud-config
package_update: true
package_upgrade: true
packages:
- iputils-ping
- iputils-tracepath
- mtr
- git
- vim
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: overprovisioning
value: -1
globalDefault: false
description: "This priority class is for overprovisioning"
---
apiVersion: v1
kind: Namespace
@pichuang
pichuang / ars.sh
Created August 15, 2024 10:04
Azure Route Server / VNG
#!/bin/bash
RESOURCE_GROUP=""
ARS_NAME=""
PEERNAME=""
echo "====="
echo "Show Azure Route Server Advertised Routes"
echo "====="
az network routeserver peering list-advertised-routes \
curl -X POST -H "Content-Type: application/Json;charset=utf-8" -d '{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content":{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
@pichuang
pichuang / ENV
Created April 17, 2024 05:11
Disable ARM_PROVIDER_ENHANCED_VALIDATION
$ ARM_PROVIDER_ENHANCED_VALIDATION=false terraform plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
+ create
Terraform will perform the following actions:
# azurerm_resource_group.rg-taiwannorth will be created
+ resource "azurerm_resource_group" "rg-taiwannorth" {
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx \
--create-namespace \
--namespace ingress-basic \
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz
---
apiVersion: apps/v1
kind: Deployment
spec:
selector:
matchLabels:
app: night9-app
component: night9-app
node-type: worker
progressDeadlineSeconds: 600