Skip to content

Instantly share code, notes, and snippets.

View hongchaodeng's full-sized avatar
👋
Anyscale is hiring! Send your resume to hongchao.deng@anyscale.com

Hongchao Deng hongchaodeng

👋
Anyscale is hiring! Send your resume to hongchao.deng@anyscale.com
  • Anyscale
  • San Francisco, CA
View GitHub Profile
# Generated by iptables-save v1.4.21 on Tue Feb 21 01:00:01 2017
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:DOCKER - [0:0]
:KUBE-HOSTPORTS - [0:0]
:KUBE-MARK-DROP - [0:0]
:KUBE-MARK-MASQ - [0:0]
@hongchaodeng
hongchaodeng / ca-config.json
Last active April 5, 2017 05:17
self-hosted etcd tls
{
"signing": {
"default": {
"expiry": "43800h"
},
"profiles": {
"server": {
"expiry": "43800h",
"usages": [
"signing",
package main
import (
"context"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
@hongchaodeng
hongchaodeng / ca-config.json
Last active November 29, 2017 09:47
Generate Secrets
{
"signing": {
"default": {
"expiry": "43800h"
},
"profiles": {
"server": {
"expiry": "43800h",
"usages": [
"signing",
# HELP vault_barrier_get Metric autogenerated by statsd_exporter.
# TYPE vault_barrier_get summary
vault_barrier_get{quantile="0.5"} 1.169558
vault_barrier_get{quantile="0.9"} 1.648282
vault_barrier_get{quantile="0.99"} 2.089528
vault_barrier_get_sum 34.97571799999999
vault_barrier_get_count 29
# HELP vault_barrier_list Metric autogenerated by statsd_exporter.
# TYPE vault_barrier_list summary
vault_barrier_list{quantile="0.5"} 1.135013

Assumption:

  • namespace "default"

Go to directory of etcd-operator/example/tls/certs/: https://github.com/coreos/etcd-operator/tree/master/example/tls/certs

create secret:

kubectl create secret generic etcd-peer-tls --from-file=peer-ca.crt --from-file=peer.crt --from-file=peer.key
kubectl create secret generic etcd-client-tls --from-file=etcd-client-ca.crt --from-file=etcd-client.crt --from-file=etcd-client.key
@hongchaodeng
hongchaodeng / ack.go
Last active April 23, 2020 18:27
使用 alibaba-cloud-sdk-go 创建 ROS 资源
package main
import (
"fmt"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
)
var (
templateBody = ```
@hongchaodeng
hongchaodeng / app.yaml
Last active May 6, 2021 13:49
CD 跟 CI 为啥不用一套?
kind: Application
spec:
componnets:
- ... # 微服务组件
# policies are applied first and only once unless changed
policies:
- type: security
properties:
rbac: ...
@hongchaodeng
hongchaodeng / command.cue
Last active November 8, 2022 13:17
dagger read/write
package main
import (
"dagger.io/dagger"
"universe.dagger.io/alpine"
"universe.dagger.io/bash"
"universe.dagger.io/docker"
)
dagger.#Plan & {
#!/usr/bin/env bash
path=$1
# sync dir append '/' at the end, e.g. my-code/
rsync -avzhe ssh --progress \
--exclude ".git" \
$path user@remote:$path