This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Fetch the master list of all Subscriptions from Azure Resource Manager | |
| arg("").resourcecontainers | |
| | where type =~ "microsoft.resources/subscriptions" | |
| | project SubscriptionId = toupper(subscriptionId), SubscriptionName = name | |
| // 2. Do a left-outer join with our Log Analytics workspace data | |
| | join kind=fullouter ( | |
| AzureActivity | |
| | where TimeGenerated > ago(30d) | |
| | summarize LastLogReceived = max(TimeGenerated), TotalLogs30Days = count() by SubscriptionId = toupper(SubscriptionId) | |
| ) on SubscriptionId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Ensure required CLI tools are installed | |
| command -v jq >/dev/null || { echo "Error: 'jq' required. Install it using 'brew install jq' or similar."; exit 1; } | |
| command -v az >/dev/null || { echo "Error: Azure CLI ('az') required."; exit 1; } | |
| # Configuration | |
| BACKUP_DIR="diag_settings_backups" | |
| API_VER="2021-05-01-preview" | |
| mkdir -p "$BACKUP_DIR" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl | |
| index a1e02aae3..886dc33c1 100644 | |
| --- a/rootfs/etc/nginx/template/nginx.tmpl | |
| +++ b/rootfs/etc/nginx/template/nginx.tmpl | |
| @@ -1229,6 +1229,7 @@ stream { | |
| {{ $ing := (getIngressInformation $location.Ingress $server.Hostname $location.IngressPath) }} | |
| set $namespace {{ $ing.Namespace | quote}}; | |
| set $ingress_name {{ $ing.Rule | quote }}; | |
| + set $service_annotations {{ if $value := $ing.Annotations.log_group }}"{{ $value }}"{{ else }}"-"{{ end }}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: kyverno.io/v1 | |
| kind: ClusterPolicy | |
| metadata: | |
| name: remove-cpu-limits-requests | |
| spec: | |
| rules: | |
| - name: remove-cpu-limits-per-container | |
| match: | |
| any: | |
| - resources: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: kyverno.io/v1 | |
| kind: ClusterPolicy | |
| metadata: | |
| name: add-aks-spot-taint | |
| annotations: | |
| policies.kyverno.io/title: Add AKS spot taint | |
| policies.kyverno.io/category: AKS | |
| policies.kyverno.io/subject: Pod | |
| kyverno.io/kubernetes-version: "1.12" | |
| spec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: kyverno.io/v1 | |
| kind: ClusterPolicy | |
| metadata: | |
| name: add-aks-spot-perference | |
| annotations: | |
| policies.kyverno.io/title: Add AKS spot preference | |
| policies.kyverno.io/category: AKS | |
| policies.kyverno.io/subject: Pod | |
| kyverno.io/kubernetes-version: "1.12" | |
| spec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: nginx-add-headers | |
| data: | |
| x-upstream-addr: $upstream_addr | |
| --- | |
| values.yaml: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import os | |
| import re | |
| import holidays | |
| from dateutil.easter import * | |
| from datetime import datetime, timedelta | |
| def should_run_code(date): | |
| norway_holidays = holidays.Norway() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| controller: | |
| config: | |
| keep-alive: "620" # https://cloud.google.com/load-balancing/docs/https#timeouts_and_retries | |
| use-forwarded-headers: "true" # passes the incoming X-Forwarded-* headers to upstreams. | |
| proxy-real-ip-cidr: "35.191.0.0/16,130.211.0.0/22,<HTTPS_LB_IP>/32" # Trusted IPs that provides correct X-Forwarded-For headers | |
| service: | |
| clusterIP: "-" | |
| enableHttps: false # We don't terminate SSL between the LB and nginx-controller | |
| type: "ClusterIP" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- file should be in /etc/nginx/lua/plugins/headers/main.lua | |
| -- enable via ConfigMap => 'plugins: "headers"' | |
| local ngx = ngx | |
| local split = require("util.split") | |
| local _M = {} | |
| function _M.rewrite() | |
| local h = ngx.req.get_headers() | |
| for k, v in pairs(h) do |
NewerOlder