Skip to content

Instantly share code, notes, and snippets.

View ycliu912's full-sized avatar

Alex liu ycliu912

View GitHub Profile
@liangrog
liangrog / client-go-custom-controller-workqueue-example.go
Last active January 25, 2024 03:24
client-go-custom-controller-workqueue-example
package main
import (
"flag"
"fmt"
"time"
"k8s.io/klog"
"k8s.io/api/core/v1"
@harryge00
harryge00 / Istio环境部署说明.md
Last active July 4, 2019 10:15
mesos-dns 与 CNI 集成

Mesos-DNS 部署

Mesos-dns是 mesos 服务发现工具,能查找app的Ip,端口号以及master,leader等信息。在Apache Mesos 集群中,允许应用程序和服务通过域名系统(DNS)来相互定位。Mesos-DNS 的特点是轻量、无状态,易于部署和维护。Mesos-DNS 将每个集群中正在运行的应用程序的域名转换成IP 地址和端口号。这使得任何链接到集群中运行的服务都可以通过DNS 进行查找。 Mesos-DNS是简单和无状态的,它不需要一致性机制,持久存储或日志复制,因为应用所需的心跳,健康监控或生命周期管理等功能都已经由Master、Agent和框架所提供。Mesos-DNS可以通过使用像Marathon这样的框架来实现容错,可以监控应用程序运行状况并在应用出现故障时重新启动它。Mesos-DNS因故障重新启动时,无需进一步协调它会从Master节点检索最新的应用状态,然后处理DNS请求。可以通过增加Master节点,即可提高可用性并为大规模集群中的DNS请求提供负载均衡。

Mesos-DNS 安装

Mesos-DNS 可以装在Mesos集群的任意一台机器上,或者是在同一网络的一台专用机器上。为了实现HA,可以在多个master上分别部署mesos-dns 实例。

wget https://github.com/mesosphere/mesos-dns/releases/download/v0.6.0/mesos-dns-v0.6.0-linux-amd64
sudo mv mesos-dns-v0.6.0-linux-amd64 /usr/local/bin/
@jberkus
jberkus / Kubernetes-Shanghai-Cihinese.pdf
Last active May 7, 2020 09:00
Gist to hold PDF copies of the new contributor workshop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yevrah
yevrah / Upgrade vim
Last active September 25, 2023 05:11
Update to Vim8 on Centos 7
################################################################################
# Method 1: Install using rpm packages (credit to DarkMukke)
#
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step
# make sure to at least run `yum install sudo`
yum -y remove vim-minimal vim-common vim-enhanced
@ffledgling
ffledgling / k8s-create-deployment.go
Created July 12, 2017 11:37
kubernetes client-go example: Create a Deployment based on json
package main
import (
"encoding/json"
"log"
"os"
// We use pretty instead of the common go-spew or pretty-printing because,
// go-spew is vendored in client-go and causes problems
"github.com/kr/pretty"
@mattmc3
mattmc3 / tasks.json
Created April 6, 2017 00:41
VSCode tasks for Golang
// See http://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// ${workspaceRoot} the path of the folder opened in VS Code
// ${file} the current opened file
// ${fileBasename} the current opened file's basename
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "0.1.0",
@giwa
giwa / file0.txt
Last active December 6, 2023 07:36
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@jchia
jchia / bld-gcc-boost.sh
Created November 11, 2012 04:49
Build gcc 4.7.2 and boost 1.51 (all libraries) on CentOS 6, adapted from someone else's script
#!/bin/bash
#
# $Id: bld.sh,v 1.2 2012/09/22 16:04:19 jlinoff Exp jlinoff $
#
# Author: Joe Linoff
#
# This script downloads, builds and installs the gcc-4.7.2 compiler
# and boost 1.51. It takes handles the dependent packages like
# gmp-5.0.5, mpfr-3.1.1, ppl-1.0 and cloog-0.17.0.
#