Skip to content

Instantly share code, notes, and snippets.

View alicek106's full-sized avatar

Chanho Yong alicek106

View GitHub Profile
@alicek106
alicek106 / Makefile.keycloak
Created February 24, 2021 22:56
Keycloak Deployment Script (standalone for test)
all: cert keycloak
cert:
mkdir certs
openssl req -x509 -newkey rsa:2048 -keyout certs/ca-key.pem \
-out certs/ca.pem -days 3650 -nodes -subj "/CN=auth.alicek106.com"
openssl req -newkey rsa:2048 -days 3600 -nodes -keyout certs/server-key.pem -out certs/server-req.pem \
-subj "/CN=mysql"
openssl x509 -req -in certs/server-req.pem -days 3600 -CA certs/ca.pem -CAkey certs/ca-key.pem \
-set_serial 01 -out certs/server-cert.pem
@alicek106
alicek106 / .terraform-workspace-prompt.zsh
Created February 24, 2021 22:50
Terraform workspace prompt in shell (bash, zsh, etc.)
function tf_prompt_info() {
# dont show 'default' workspace in home dir
[[ "$PWD" == ~ ]] && return
# check if in terraform dir
if [ -d .terraform ]; then
# Most of scripts uses 'terraform workspace show' but it's too slow in some cases.
# We can just bring out the environment file to bash
if [ -f .terraform/environment ]; then
workspace=$(cat .terraform/environment 2> /dev/null) || return
echo "[${workspace}]"
const React = require("react")
const Keycloak = require("keycloak-js")
const { KeycloakProvider } = require("@react-keycloak/web")
const keycloak = new Keycloak({
realm: 'alicek106',
url: 'https://auth.alicek106.com/auth',
clientId: 'react-frontend',
})
@alicek106
alicek106 / envoy-basic.yaml
Created June 14, 2020 07:34
Envoy basic YAML setting
node:
id: node0 # 고유한 envoy node의 ID
cluster: cluster.local
admin: # Envoy는 자체적으로 Admin 페이지를 제공한다.
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 0.0.0.0, port_value: 9900 } # 9900 포트로 Admin 접근 가능
static_resources:
@alicek106
alicek106 / main.py
Created June 12, 2020 03:51
Envoy Simple EDS Flask Server Example
import logging
from flask import Flask, request
class ServicesDAO(object):
def __init__(self):
self.services = {}
def get(self, service_name):
@alicek106
alicek106 / alertmanager.yaml
Last active April 15, 2020 10:30
alertmanager.yaml
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
labels:
owner: alicek106
name: alice-alertmanager
namespace: default
spec:
configMaps:
- alert-notification-tmpl
@alicek106
alicek106 / example-prometheusrule.yaml
Last active April 15, 2020 11:45
example-prometheusrule.yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
owner: alicek106
role: alert-rules
name: example-app-latency
namespace: default
spec:
groups:
@alicek106
alicek106 / istio-mesh-monitor.yaml
Created April 13, 2020 13:53
istio-mesh-monitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: istio-mesh-monitor
namespace: default
labels:
app: monitoring
monitoring: istio-mesh
spec:
selector:
@alicek106
alicek106 / istio-component-servicemonitor.yaml
Last active April 13, 2020 13:30
istio-component-servicemonitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: istio-component-monitor
namespace: default
labels:
app: monitoring
monitoring: istio-components
spec:
jobLabel: istio
@alicek106
alicek106 / deployment-if-no-file-sleep.yaml
Last active April 13, 2020 13:35
deployment-if-no-file-sleep.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-annotation-test
namespace: example-app
labels:
app: ingress-annotation-test
spec:
replicas: 3
selector: