Skip to content

Instantly share code, notes, and snippets.

@wonderzerg
wonderzerg / README.md
Created May 27, 2022 06:44 — forked from squidpickles/README.md
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.

Steps

Follow the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for setting up the master node. I've been using Weave Net as the network plugin; it see

@wonderzerg
wonderzerg / docker.md
Created April 18, 2022 02:07 — forked from FreddieOliveira/docker.md
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@wonderzerg
wonderzerg / jinja2_file_less.py
Created March 4, 2022 03:32 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@wonderzerg
wonderzerg / Office_kms
Created March 3, 2022 02:36 — forked from OkoyaUsman/Office_kms
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@wonderzerg
wonderzerg / k8s_crd.md
Created June 30, 2021 08:03 — forked from pydevops/k8s-crd.md
k8s crd operator

Some useful resources regarding Kubernetes Operators, CRDs, etc.

@wonderzerg
wonderzerg / gist:1c124b63206735675d8a92343facfec8
Created December 28, 2020 02:49 — forked from msjyoo/gist:78b741fb48a9f0936e20
How to set up NAT for Internet access with Hyper-V
In the Virtual SAN Editor:
Select Internal mode.
Then, open cmd, type in `ipconfig`.
You should see something like this:
```
Ethernet adapter vEthernet (Internal Virtual Switch 1):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : xxmacaddressxx:1:2:3:randomidentifier
@wonderzerg
wonderzerg / test_ansible_api.py
Created June 17, 2020 03:18
use ansible as APIs
import json
import shutil
from ansible.module_utils.common.collections import ImmutableDict
from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
from ansible.inventory.manager import InventoryManager
from ansible.playbook.play import Play
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.plugins.callback import CallbackBase
from ansible import context
@wonderzerg
wonderzerg / my_mongo_util.go
Created April 24, 2020 07:48
mongo go client
func CreateMongoClient(mongoURI string, timeOut time.Duration) (*mongo.Client, error) {
client, err := mongo.NewClient(options.Client().ApplyURI(mongoURI))
if err != nil {
mlog.Warning(err.Error())
return nil, err
}
// connect to mongo , cus mongo is rest client ,we don`t care about its state.
ctx, cancel := context.WithTimeout(context.Background(), timeOut*time.Second)
defer cancel()
// connect to mongo
@wonderzerg
wonderzerg / get_yamls.sh
Created April 20, 2020 08:14
get yamls from helm chart
#!/bin/sh
# first download chart to /helm/inspur-redis-cluster
cd /helm/inspur-redis-cluster
mkdir yamls
helm template --output-dir "./yamls" "."