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
resource "azurerm_kubernetes_cluster_node_pool" "aks_node_pool" { | |
for_each = { | |
for index, node_pool in local.node_pools : | |
node_pool.name => node_pool | |
} | |
name = each.value.name | |
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id | |
vm_size = each.value.vm_size | |
node_count = each.value.node_count |
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
$ terraform apply | |
random_id.cluster_name[0]: Refreshing state... [id=26Ak6SRX] | |
azurerm_resource_group.rg[0]: Refreshing state... [id=/subscriptions/104e4289-6059-4afb-885a-982ba31991ee/resourceGroups/K8sRG1] | |
data.azurerm_kubernetes_service_versions.current[0]: Reading... | |
data.azurerm_kubernetes_service_versions.current[0]: Read complete after 1s [id=/subscriptions/104e4289-6059-4afb-885a-982ba31991ee/providers/Microsoft.ContainerService/locations/southindia] | |
azurerm_kubernetes_cluster.aks[0]: Refreshing state... [id=/subscriptions/104e4289-6059-4afb-885a-982ba31991ee/resourceGroups/K8sRG1/providers/Microsoft.ContainerService/managedClusters/k8s-dba024e92457] | |
azurerm_public_ip.public_ip[0]: Refreshing state... [id=/subscriptions/104e4289-6059-4afb-885a-982ba31991ee/resourceGroups/MC_K8sRG1_k8s-dba024e92457_southindia/providers/Microsoft.Network/publicIPAddresses/k8s-public-ip-dba024e92457] | |
local_file.kubeconfigaks[0]: Refreshing state... [id=6d63d7a3898cbab172185eb9d0d1d56b753f4d3b] | |
azurerm_kubernetes_cluster_ |
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
locals { | |
node_pools = yamldecode(file("${path.module}/node-pool.yaml")) | |
} | |
resource "azurerm_kubernetes_cluster_node_pool" "aks_node_pool" { | |
count = length(local.node_pools) | |
name = local.node_pools[count.index].name | |
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id | |
vm_size = local.node_pools[count.index].vm_size |
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
resource "random_id" "cluster_name" { | |
byte_length = 6 | |
} | |
resource "azurerm_resource_group" "rg" { | |
name = "K8sRG1" | |
location = var.aks_region | |
} | |
data "azurerm_kubernetes_service_versions" "current" { |
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
- name: "nodepool1" | |
vm_size: "Standard_D2_v2" | |
node_count: 1 | |
tags: | |
- project: foo | |
- environment: dev | |
- name: "nodepool2" | |
vm_size: "Standard_D2_v2" | |
node_count: 2 | |
tags: |
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
{ | |
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI4VlVBWFQ1U0VFeDB5VklqR1FLemxjaXZoanl4aDQwOEJHbzQ4dmItUG9NIn0.eyJleHAiOjE2NzU3NTQwNzksImlhdCI6MTY3NTc1NDAxOSwiYXV0aF90aW1lIjoxNjc1NzU0MDE5LCJqdGkiOiI5ODUzYWEyOS05YzM3LTQzYjgtOWI2Ni1iYzE0ZjhjZjE2MzQiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvcmVhbG1zL21hc3RlciIsInN1YiI6IjZmMDhlNzFlLTE5MWEtNDc4ZS04ZTIyLWVmZDU4OTE1OGQ5MCIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFjY291bnQiLCJzZXNzaW9uX3N0YXRlIjoiNTc0NTBmYTctZDgwNS00NmM0LWIxMjctNzNmMmQ2YzMzNmUwIiwiYWNyIjoiMSIsInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6Im9wZW5pZCBlbWFpbCBwcm9maWxlIiwic2lkIjoiNTc0NTBmYTctZDgwNS00NmM0LWIxMjctNzNmMmQ2YzMzNmUwIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhZG1pbiJ9.XFjPipVVJ6VR2FIPRAkGn-1tW6tHimHfhvncJ-Rl_3N9vK3Ty4dZYMtyZvrghG03Sbj9NdFuli4JHXbfWWZmsmUBN5fCixzvO0KkGIbYqKzixV2gAqBXCwVMCvYTSprvD_jXZldoR4TqAtnEdrqfwI87VVf5MHrKaCQqkF9oCLz31naarpg0fgzPDQAiZtCufpyY2o9PM75uSW |
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: Namespace | |
metadata: | |
name: kong-api-gateway | |
labels: | |
istio.io/rev: asm-1153-6 |
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 paho.mqtt.client as mqtt | |
from random import randrange, uniform | |
import time | |
mqttBroker ="vernemq.itransz.in" | |
client = mqtt.Client("Temperature_Inside") | |
client.connect(mqttBroker, 443) | |
while True: |
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
local resty_rsa = require "resty.rsa" | |
local b64 = require("ngx.base64") | |
-- local rsa_public_key, rsa_priv_key, err = resty_rsa:generate_rsa_keys(2048) | |
-- if not rsa_public_key then | |
-- ngx.say('generate rsa keys err: ', err) | |
-- end | |
local algorithm = "SHA256" | |
local key = "MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAOz0YTcc5qsRSyNYUBPD/6H/vcbFqtTb+IcW45PAZ5lMIMj4DLdNF+/4ZlVSVKU9QfC5lio/X76sZhwG2u+7vwOBi1awuwQ91xVroeR4ozpRqs31DYDl7uCfbMZhbG2m4wIDAQAB" | |
local rsa_public_key = "-----BEGIN PUBLIC KEY-----\n" .. key .. "\n-----END PUBLIC KEY-----" |
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
local resty_rsa = require "resty.rsa" | |
local function verify_saml2_signature(payload, signature, public_key) | |
local rsa_public_key = "-----BEGIN PUBLIC KEY-----\n" .. public_key .. "\n-----END PUBLIC KEY-----" | |
local pub, err = resty_rsa:new({ public_key = rsa_public_key, key_type = resty_rsa.KEY_TYPE.PKCS8, algorithm = "SHA256" }) | |
if not pub then | |
ngx.say('unable to extract public key') | |
return nil | |
end |