Just for exclude mistake like kubeconfig delete ns --all.
kubectl apply -f operator.yamlbash -xe kubeconfig.shkubectl --kubeconfig operator-kubeconfig.yaml get ns,sa,po,hpa,rs,deploy,sts,pv,pvc,svc,ingress,secrets,ep,nodes > /dev/null
| # ================================================================================================================================================================= | |
| # all | |
| echo "1" > /proc/sys/net/ipv4/ip_forward | |
| apt-get update -q | |
| apt-get install -yq strongswan lxc | |
| # ================================================================================================================================================================= | |
| # node1 |
| --- | |
| - hosts: all | |
| gather_facts: no | |
| vars: | |
| sysctl: | |
| vm.swappiness: 0 | |
| net.ipv4.tcp_wmem: 4096 65536 33554432 | |
| net.core.netdev_max_backlog: 262144 | |
| net.ipv4.tcp_no_metrics_save: 1 |
| #!/bin/sh -xe | |
| # backup | |
| cp /usr/share/initramfs-tools/scripts/local{,.orig} | |
| cp /etc/fstab{,.orig} | |
| # prepare | |
| echo 'none / tmpfs defaults 0 0' > /etc/fstab | |
| # echo 'none / tmpfs defaults,noatime,nodiratime,discard 0 0' > /etc/fstab | |
| curl -s https://gist.githubusercontent.com/egeneralov/89f6294f5cdfabffc9c15d9fa9bf14ba/raw/f4cf9c786ef818c333a2e5d0c10401b1706ab933/local.patch | patch -p0 /usr/share/initramfs-tools/scripts/local |
| kind delete cluster --name kind | |
| cat <<EOF | kind create cluster --config=- | |
| kind: Cluster | |
| apiVersion: kind.x-k8s.io/v1alpha4 | |
| networking: | |
| apiServerAddress: "0.0.0.0" | |
| apiServerPort: 6443 |
| version: '2.2' | |
| services: | |
| kibana: | |
| image: docker.elastic.co/kibana/kibana:7.6.0 | |
| environment: | |
| SERVER_NAME: 127.0.0.1 | |
| ELASTICSEARCH_URL: http://elasticsearch:9200/ | |
| ports: | |
| - 5601:5601 | |
| logging: |
| package main | |
| import ( | |
| "encoding/json" | |
| "strings" | |
| "bufio" | |
| "fmt" | |
| "os" | |
| ) |
| # helm repo add stable https://kubernetes-charts.storage.googleapis.com | |
| # helm repo add elastic https://helm.elastic.co | |
| # helm repo update | |
| # terraform apply -auto-approve -no-color -var "access_key=" -var "secret_key=" -var "organization_id=" | |
| variable "access_key" { | |
| type = string | |
| } | |
| variable "secret_key" { | |
| type = string |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: echoserver | |
| labels: | |
| app: echoserver | |
| spec: | |
| replicas: 3 | |
| selector: |
| ip tunnel add ipip local ${linux_ip} remote ${mikrotik_ip} mode ipip | |
| ip link set ipip up | |
| ip addr add 192.168.3.1/30 dev ipip | |
| iptables -t mangle -A POSTROUTING -o ipip -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu | |
| iptables -t nat -A POSTROUTING -s 192.168.3.0/30 -o ${linux_output_iface} -j MASQUERADE |