Skip to content

Instantly share code, notes, and snippets.

@identw
identw / netbird.yaml
Created July 29, 2024 12:52
netbird
# dex config:
# ...
# staticClients:
# - id: netbird-backend
# name: netbird-backend
# redirectURIs:
# - https://netbird.example.com
# - https://netbird.example.com/#callback
# secret: <DEX_NETBIRD_BACKEND_SECRET>
# - id: netbird-client
# An OIDC provider is required (e.g., Dex).
# OIDC must be configured for the kube-apiserver. For example:
# - --oidc-client-id=kubernetes-oidc
# - --oidc-groups-claim=groups
# - --oidc-issuer-url=https://dex.example.com
# - --oidc-username-claim=email
# For cloud setups, you can use kube-oidc-proxy (https://github.com/TremoloSecurity/kube-oidc-proxy)
#
# <secret_cookie_auth_key> - 32 bytes string (regex: a-z0-9, example: rpb7aos4rd0m32x9omcrcqacnia0xty2)
# <secret_cookie_enc_key> - 32 bytes string (regex: a-z0-9, example: gg1ejofgupoc19wyuywr2yflm75aeiwg)
@identw
identw / result.json
Created April 5, 2024 19:01
result.json
{
"arr": [
{
"containerPort": 53,
"name": "dns",
"protocol": "TCP"
},
{
"containerPort": 8443,
"name": "https",
@identw
identw / test.jsonnet
Created April 5, 2024 18:56
test.jsonnet
local h = import './helpers.jsonnet';
local object = {
arr: [
{
containerPort: 53,
name: 'dns',
protocol: 'TCP',
},
{
@identw
identw / helpers.jsonnet
Created April 5, 2024 18:55
helpers.jsonnet
{
mapArrayByField(f, mixinField):: {
local m = super[mixinField],
[mixinField]: std.prune(std.map(f, m))
},
mapArrayWithField(fieldValues, fieldName, mixinField, f):: (
local fieldValuesSet = std.set(fieldValues);
local inFieldValuesSet(value) = std.length(std.setInter(fieldValuesSet, std.set([value]))) > 0;
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: disallow-host-namespaces
spec:
background: true
failurePolicy: Fail
rules:
- match:
any:
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
name: k8spsphostnamespace
annotations:
description: Controls usage of host namespaces.
spec:
crd:
spec:
names:
apiVersion: apps/v1
kind: Deployment
metadata:
name: pre-stop
labels:
app: pre-stop
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
@identw
identw / 1.tf
Created December 14, 2023 19:17
variable "data" {
default = [
{
name = "vapp1"
metadata = {
a = 1
b = 2
}
virtuals = [
{ name = "v1" },
vapp1/v1:
name: vapp1-v1
metadata:
a: 1
b: 2
vapp1/v2:
name: vapp1-v2
metadata:
a: 1
b: 2