Skip to content

Instantly share code, notes, and snippets.

View aslafy-z's full-sized avatar

Zadkiel AHARONIAN aslafy-z

View GitHub Profile
@aslafy-z
aslafy-z / envoy.yaml
Last active May 11, 2023 17:28
Frontend to Kubernetes APIServer to re-encrypt traffic with a client trusted CA
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 443
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
@aslafy-z
aslafy-z / help.Makefile
Created November 23, 2022 14:35
Makefile with self generating help. Try it with `make -f help.Makefile`
help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
execute-foo: ## Executes foo
execute-bar: ## Executes bar
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo
namespace: default
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: demo
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
# RFC-3986 URI component: URI-reference
# from: http://jmrware.com/articles/2009/uri_regexp/URI_regex.html
#
# modifications:
# - https://github.com/jhermsmeier/uri.regex: added capture groups
# - https://github.com/GerHobbelt/uri.regex: added absolute and relative paths as means to specify a (relative, same host only) URI
#
# catch context as well:
^
#!/usr/bin/env bash
# https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22
DEPRECATED_APIS="
apiextensions.k8s.io/v1beta1
admissionregistration.k8s.io/v1beta1
apiregistration.k8s.io/v1beta1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1beta1
certificates.k8s.io/v1beta1
@aslafy-z
aslafy-z / default-ghes-settings-api.json
Last active September 8, 2022 17:12
Default values for GHES settings API
{
"enterprise": {
"abuse_rate_limiting": {
"cpu_millis_per_minute": 90000,
"enabled": false,
"requests_per_minute": 900,
"search_cpu_millis_per_minute": 7500
},
"admin_password": null,
"api_rate_limiting": {
# usage: KUBECONFIG=/tmp/kubectl-token-environment.yaml KUBECTL_TOKEN=sa.jwt.token kubectl get nodes
users:
- name: user-name
user:
exec:
command: "/bin/sh"
apiVersion: "client.authentication.k8s.io/v1"
args:
- "-c"
>>> for i in range(10):
... print(i)
... continue
... print('hahaha')
...
0
1
2
3
4
@aslafy-z
aslafy-z / create_user_for_namespace.sh
Last active April 25, 2022 08:31 — forked from steimntz/create_user_for_namespace.sh
Script to create user with permission for a specific namespace.
#!/bin/bash
#
# Script based on https://jeremievallee.com/2018/05/28/kubernetes-rbac-namespace-user.html
#
# In honor of the remarkable Windson
#/bin/bash
namespace=$1
if [ -z "$namespace" ]; then
echo "usage: $0 <NAMESPACE>"