Skip to content

Instantly share code, notes, and snippets.

View Yapcheekian's full-sized avatar

Yap Yapcheekian

View GitHub Profile
@Yapcheekian
Yapcheekian / guide.md
Created July 22, 2021 12:29
Integrate elastic cloud with okta

Okta

  1. Create an application in okta
  2. Choose SAML2.0
  3. Give a random app name
  4. Single sign on URL: KIBANA_ENDPOINT_URL/api/security/saml/callback
  5. Audience URI (SP Entity ID): KIBANA_ENDPOINT_URL/

elasticsearch.yml

xpack:
@Yapcheekian
Yapcheekian / notes.md
Last active February 5, 2024 15:04
Notes on linux, container and kubernetes networking commands and concepts

Scenario 1: only 2 container (red and blue) created

ip link add veth-red type veth peer name veth-blue

ip link set veth-red netns red

ip link set veth-blue netns blue

ip -n red addr add 192.168.15.1 dev veth-red

@Yapcheekian
Yapcheekian / generic.md
Last active August 9, 2023 04:05
generic.md
type Model interface {
	comparable
	TableName() (schema, table string)
}

type Change[T Model] struct {
	New T
	Old T
}
@Yapcheekian
Yapcheekian / k8s.md
Last active March 4, 2022 05:53
K8s deep dive
docker run -it --rm k8s.gcr.io/kube-apiserver:v1.19.0 kube-apiserver --help

docker run -it --rm k8s.gcr.io/kube-scheduler:v1.19.0 kube-scheduler --help

Custom Scheduler

apiVersion: v1
kind: Pod
@Yapcheekian
Yapcheekian / mutating.go
Created March 4, 2022 00:33
mutating webhook in k8s
package mutator
import (
"encoding/json"
"log"
"net/http"
admission "k8s.io/api/admission/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@Yapcheekian
Yapcheekian / authenticate.go
Created March 4, 2022 00:16
authentication webhook is k8s
package authenticate
import (
"encoding/json"
"errors"
"log"
"net/http"
"strings"
authentication "k8s.io/api/authentication/v1beta1"
)
@Yapcheekian
Yapcheekian / authorization.go
Created March 4, 2022 00:13
k8s authorization webhook
package authorize
import (
"encoding/json"
"fmt"
"log"
"net/http"
authorization "k8s.io/api/authorization/v1beta1"
)
@Yapcheekian
Yapcheekian / validating.go
Created March 4, 2022 00:11
validating webhook
package validate
import (
"encoding/json"
"log"
"net/http"
"regexp"
admission "k8s.io/api/admission/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"