Skip to content

Instantly share code, notes, and snippets.

@janeczku
janeczku / dhcp.md
Created December 13, 2021 09:20
Harvester Network Config Examples
#cloud-config
version: 1
config:
  - type: physical
    name: eth0
    subnets:
      - type: dhcp
  - type: physical
 name: eth1
@janeczku
janeczku / config-create.yaml
Last active November 22, 2021 14:00
Harvester IPXE Boot Files
token: changeme
os:
hostname: harvey
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4dPexLIQWUjATwjGGX0LbKXADFSj9mUWFACYDqVRzDF3Dx+G7OssPekHKKFREN1MQOMfHQgJep1avdrQom0HEEjjzWxuKHi8J8wfcb3H7xZr6ojTv6xPpJfvY9IWDqWjLpvXkSeb9dmUClXZk7mvhAIt7s+wtUhlG8ZRDWZ8k2R17tcy9L73oHzW+7DyLflkJoetjYPrew9ifyaH/WFIqtEX7NHdIHHSQoxlWNxf+QzVB4DmYMOzf/FHiKCwNuqEUhbB4h3yWUUKiB/5/psD2CGDnAlN0whHXGSJqn6DeyG7xBnsxg0T5k9OsX65KNSOAgrr/1grtL0Nz7+ll0Ylp
password: rancher
dns_nameservers:
- 8.8.8.8
- 1.1.1.1
install:
@janeczku
janeczku / userdata.yaml
Created August 18, 2021 19:38
Exclude NICs for reporting VM IP addresses with Open VM / VMware Tools
#cloud-config
write_files:
- path: /etc/vmware-tools/tools.conf
permissions: 0644
content: |
[guestinfo]
# Ref: https://docs.vmware.com/en/VMware-Tools/11.3.0/com.vmware.vsphere.vmwaretools.doc/GUID-ECCF9D01-3666-40CE-B9FD-7EE0738AB5D9.html
exclude-nics=docker*,veth*,flannel*,cni*,calico*,ens193
primary-nics=ens192
@janeczku
janeczku / gosund_sp1.yaml
Last active March 21, 2023 09:44
Gosund SP1 + Esphome
substitutions:
devicename: gosund_sp1_01
friendlyname: SP1 Socket 01
sp1_current_resistor: "0.00221"
sp1_voltage_divider: "871"
#############
# Note: These numbers were found online
# BW SHP2 Current Resistor: 0.0028
# BW SHP2 Voltage Devider: 960
# Gosund SP1 Current Resistor: 0.00221
@janeczku
janeczku / client-server-test-pods.yaml
Created June 28, 2021 17:17
Simple Kubernetes manifest to check connectivity between two pods running on different nodes
apiVersion: v1
kind: Pod
metadata:
name: test-server
labels:
app: test-server
spec:
terminationGracePeriodSeconds: 1
containers:
- name: netshoot

Windows Troubleshooting Summary

There are two servicing channels of Windows: LTSC (Long-Term Servicing Channel) and SAC (Semi-Annual Channel). 1903 or Windows Server, version 1903 is meaning the SAC server, oppositely, Windows Server 2019 is meaning the LTSC server. The SAC server only has the well known Core mode, which offers great advantages such as smaller hardware requirements, much smaller attack surface, and a reduction in the need for updates. The LTSC server support both GUI mode and Core mode.

The SAC server is not an "update" or "service pack" for LTSC. It's the current twice-yearly server release on the release track that is designed for customers who are moving at a "cloud cadence", such as those on rapid development cycles. This track is ideal for modern applications and innovation scenarios such as containers and micro-services. Each release in this track is supported for 18 months from the initial release. Get more from [Windows Server servicing channels: LTSC and SAC](

@janeczku
janeczku / gist:6e989b7852ee694cd4a15f22616e34c2
Created January 11, 2021 23:10
Fix RHEL8 firewall configuration for Rancher agent
sudo iptables -P FORWARD ACCEPT
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/50-docker-forward.conf
for mod in ip_tables ip_vs_sh ip_vs ip_vs_rr ip_vs_wrr; do sudo modprobe $mod; echo $mod | sudo tee -a /etc/modules-load.d/iptables.conf; done
sudo dnf -y install network-scripts
sudo systemctl enable network
sudo systemctl disable NetworkManager
@janeczku
janeczku / eks-launch-template-cloud-init.md
Last active November 17, 2020 18:54
EKS Launch Template /w Cloud-Init Userdata

Terraform Example: Create EC2 Launch Template with Cloud-Init Userdata

Create Cloud-Init template

data "template_file" "cloud_init" {
  template = "${file("init.tpl")}"
  template = <<EOF
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==BOUNDARY=="
@janeczku
janeczku / 01-multus-k3s.md
Last active March 12, 2025 12:29
Multus CNI with k3s and RKE

Using Multus CNI in K3S

By default, K3S will run with flannel as the CNI and use custom directories to store CNI plugin binaries and config files(You can inspect the kubelet args K3S uses via journalctl -u k3s|grep cni-conf-dir). So you need to configure that properly When deploying Multus CNI.

For example given the official Multus manifests in https://github.com/intel/multus-cni/blob/36f2fd64e0965e639a0f1d17ab754f0130951aba/images/multus-daemonset.yml, the following changes are needed:

volumes:
 - name: cni
@janeczku
janeczku / import-airgapped-downstream-cluster.md
Last active January 12, 2021 16:12
How-to: Connect an air-gapped k3s cluster to Rancher via enterprise proxy

How-to: Connect an air-gapped k3s cluster to Rancher via enterprise proxy

    +----------------+
    |  Rancher Mgmt  |
    +--------+-------+
             ^
             |
 | Firewall