-
Install Google Cloud SDK: to manipulate cloud resources
-
Install Terraform: to create/destroy clusters from pre-defined specs
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
| #!/usr/bin/env bpftrace | |
| /* | |
| * trace_dns_drops traces DNS drops by ip_vs_in and ipt_do_table. | |
| * | |
| * Background: | |
| * 1. Before 5.9, ip_vs_in can cause UDP packets drops when IPVS RS deleted | |
| * and source port reused, See https://github.com/kubernetes/kubernetes/issues/71514 for more details. | |
| * 2. Misconfiguration of iptables can cause DNS drops. | |
| * | |
| * Usage: |
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
| $ modprobe bridge | |
| $ echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf | |
| $ sysctl -p /etc/sysctl.conf | |
| sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory | |
| # SOLUTION | |
| $ modprobe br_netfilter | |
| $ sysctl -p /etc/sysctl.conf |
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
| #KAFKA ALIAS TO BE USED INSIDE DOCKER | |
| export KAFKA_HOME=/opt/kafka | |
| export BROKER="172.17.0.1:32768" | |
| export BOOTSTRAP="172.17.0.1:32768" | |
| export ZK="172.17.0.1:2181" | |
| alias k-list-topics="$KAFKA_HOME/bin/kafka-topics.sh --list --zookeeper $ZK" | |
| alias k-create-topic="$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $ZK --replication-factor 1 --partitions 3 --topic" |
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
| # Create a pod that reads and writes to the | |
| # NFS server via an NFS volume. | |
| kind: Pod | |
| apiVersion: v1 | |
| metadata: | |
| name: pod-using-nfs | |
| spec: | |
| # Add the server as an NFS volume for the pod | |
| volumes: |
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 {createLogger, format, transports } from 'winston'; | |
| const {combine, timestamp, printf } = format; | |
| const myFormat = printf((info, opts) => { | |
| return `${info.time_is_money}: ${info.message}`; | |
| }); | |
| const logger = createLogger({ | |
| format: combine( | |
| timestamp({ |
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
| version: "3" | |
| networks: | |
| kong-net: | |
| driver: bridge | |
| services: | |
| ####################################### | |
| # Postgres: The database used by Kong |
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
| async function bootstrap() { | |
| const server = express(); | |
| const app = await NestFactory.create(ApplicationModule, server); | |
| const options = new DocumentBuilder() | |
| .setTitle('My API') | |
| .setDescription('Rest API') | |
| .setVersion('1.0') | |
| .setSchemes("https") |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
NewerOlder