Skip to content

Instantly share code, notes, and snippets.

@vyta
vyta / alerts-with-prometheus.md
Created June 27, 2018 21:00
Alerts with Prometheus

Alerts with Prometheus

The helm installation makes it particularly simple to get going: https://github.com/kubernetes/charts/tree/master/stable/prometheus.

Now you just have to worry about

  1. Creating the alert
  2. Creating the alert rules

Creating the alert

What kind of alert do you want and where do you want it to go? This is defined in the configMap for alertManager, which can be found in the alertmanagerFiles.alertmanager.yml portion of the values.yaml file of the helm chart.

@vyta
vyta / troubleshooting-performance-on-windows-with-containers.md
Last active November 21, 2018 00:59
Troubleshooting Performance on Windows w/ Containers

Observation

Approximately 10% increase in CPU usage when running containerized application vs running the application directly on the host

Troubleshooting

Tools & Setup:

  • Windows Performance Recorder: built-in tool to troubleshoot performance related issues on Windows.
@vyta
vyta / aks-windows-custom-vnet.md
Created April 24, 2019 22:28
Deploy AKS cluster with Windows support in custom vnet

FYI

  • subnet used for your aks cluster should not overlap with any virtual networks in the environment. This creates a new subnet to be used only by AKS.
  • service prinicipal must have at least network contributor role to vnet rg
  • service-cidr:
    • Must not be within the virtual network IP address range of your cluster
    • Must not overlap with any other virtual networks with which the cluster virtual network peers
    • Must not overlap with any on-premises IPs
    • Must not be within the ranges 169.254.0.0/16, 172.30.0.0/16, or 172.31.0.0/16
  • dns-service-ip must be within service cidr AND must not use the first address, which is used for the kubernetes.default.svc.cluster.local address
@vyta
vyta / k8s-custom-vnets-azure.md
Created May 1, 2019 17:12
Custom vNet Notes for K8s on Azure

Custom VNET Notes

  • subnet used for your aks cluster should not overlap with any virtual networks in the environment. This creates a new subnet to be used only by AKS.
  • service-cidr:
    • Must not be within the virtual network IP address range of your cluster
    • Must not overlap with any other virtual networks with which the cluster virtual network peers
    • Must not overlap with any on-premises IPs
  • dns-service-ip must be within service cidr AND must not use the first address, which is used for the kubernetes.default.svc.cluster.local address
  • docker-bridge-address must not be within vnet address space AND must not overlap with any other address ranges in use.
@vyta
vyta / nginx-prometheus-azmon-example.md
Last active May 11, 2022 16:16
Example of using Azure Monitor to scrape Prometheus metrics from NGINX

Example of using Azure Monitor to scrape Prometheus metrics from NGINX

NGINX Ingress Controller w/ Helm

  1. Enable metrics endpoint:
helm install stable/nginx-ingress --name my-release --set controller.metrics.enabled=true
@vyta
vyta / 2-worker.yaml
Created February 3, 2020 17:30
Kind configuration for 2 workers
---
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
- role: worker
@vyta
vyta / configure-kind-cluster.sh
Last active February 5, 2020 23:35
Script to install docker and create kind cluster
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Microsoft Azure
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@vyta
vyta / 1-worker.yaml
Created February 3, 2020 19:11
Kind configuration for 1 worker
---
kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
@vyta
vyta / 2-worker-public.yaml
Last active May 19, 2020 22:50
Kind configuration with local host and added ip
---
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
apiServerAddress: "0.0.0.0"
apiServerPort: 6443
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
version: v1beta2
kind: ClusterConfiguration
@vyta
vyta / install-k8s.sh
Last active August 26, 2020 16:56
Script to prep a Debian node for k8s
#!/bin/sh -eux
# Docker
sudo apt-get update
sudo apt-get install -y\
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \