Skip to content

Instantly share code, notes, and snippets.

{{/*
Validate that only one of haproxy_gateway.enabled or nginx_gateway.enabled is set to true.
*/}}
{{- define "gateway.validate" -}}
{{- $haproxyEnabled := .Values.haproxy_gateway.enabled -}}
{{- $nginxEnabled := .Values.nginx_gateway.enabled -}}
{{- if and $haproxyEnabled $nginxEnabled -}}
{{- printf "Error: Both haproxy_gateway.enabled and nginx_gateway.enabled cannot be set to true simultaneously." -}}
{{- else if and (not $haproxyEnabled) (not $nginxEnabled) -}}
{{- printf "Error: Either haproxy_gateway.enabled or nginx_gateway.enabled must be set to true." -}}
@etrikp
etrikp / gist:a8f7aba1a82c742a38e529a854e65e63
Created September 11, 2023 13:11
Loki distributed haproxy
global
log stdout format raw local0
maxconn 4096
nbproc 5
pidfile /tmp/haproxy.pid
resolvers kube-dns
nameserver default kube-dns.kube-system.svc.cluster.local:53
resolve_retries 3
timeout retry 1s

Keybase proof

I hereby claim:

  • I am etrikp on github.
  • I am epatricella (https://keybase.io/epatricella) on keybase.
  • I have a public key ASAF_BWLngxSIP3FDefoxbbCH7zJYPrx2ifr7SbqmnkMaAo

To claim this, I am signing this object:

private static CommandLine git() {
return CommandLine.createCommandLine("git").withEncoding("UTF-8");
}
private void cleanUnversionedFiles(File workingDir) {
String[] args = new String[]{"clean", "-dff"};
CommandLine gitCmd = git().withArgs(args).withWorkingDir(workingDir);
runOrBomb(gitCmd);
}
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default utun0 UCS 26 0 utun0
default 10.0.1.1 UGScI 0 0 en1
10.0.1/24 link#5 UCS 7 0 en1
10.0.1.1 20:c9:d0:13:c9:b3 UHLWIir 2 4672 en1 985
10.0.1.2 9c:20:7b:df:8a:11 UHLWI 0 0 en1 923
10.0.1.3 b4:7:f9:fb:1c:24 UHLWI 0 1093 en1 1200
# Creates a new VM and attaches to a network and passes metadata to the instance
# Needs a recent version of eventlet per https://bugs.launchpad.net/nova/+bug/1266974
---
- name: create nimbus instance
hosts: localhost
connection: local
gather_facts: False
tasks:
- name: launch openldap instance
#!/bin/bash
#
# This script is meant to be put in the post creation phase of bringing up an instances
# It properly configures the seocond nic so the outside world is reachable.
cat << EOF > /etc/network/interfaces.d/eth1.cfg
# The primary network interface
auto eth1
iface eth1 inet dhcp
#!/bin/bash
rm -rf modules/profile/
mkdir -p modules/profile/{manifests,files,templates}
if [ -d 'profiles' ]; then
for prof in `ls profiles`
do
if [ -d "profiles/$prof/manifests" ]; then
cp -R profiles/$prof/manifests/*.pp modules/profile/manifests/
if [ -d "profiles/$prof/files" ]; then
.
|-- environments
| `-- example_env
|-- hieradata
| |-- env
| |-- hiera-local
| `-- profile
|-- manifests
|-- modules
| |-- apt