Skip to content

Instantly share code, notes, and snippets.

View jianchen2580's full-sized avatar

Jian Chen jianchen2580

  • Cisco Systems
  • Melbourne
View GitHub Profile
# chef-server
https://www.digitalocean.com/community/tutorial_series/getting-started-managing-your-infrastructure-using-chef
# knife cookbook
## prism cookbook
## third party cookbooks
# chef workflow
## bootstrap a node
## attribute role/env/default/overrite
func main() {
ctx := context.Background()
// trap Ctrl+C and call cancel on the context
ctx, cancel := context.WithCancel(ctx)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
defer func() {
signal.Stop(c)
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: prometheus-deployment
name: prometheus
spec:
replicas: 1
template:

Kubernetes Installation with Vagrant & CoreOS

Vagrant和CoreOS部署多节点k8s集群.

Install Prerequisites

  • git

  • Vagrant

  • kubectl

zookeeper

Headless Service - zk-headless ConfigMap - zk-config PodDisruptionBudget - zk-budget StatefulSet - zk

watch the StatefulSet controller create

apiVersion: v1
kind: Service
metadata:
name: zk-headless
labels:
app: zk-headless
spec:
ports:
- port: 2888
name: server
If you are receiving an error that the private doesn't match the certificate or that a certificate that you installed to a site is not trusted, try one of these commands. If you are trying to verify that an SSL certificate is installed correctly, be sure to check out the SSL Checker.
Check an MD5 hash of the public key to ensure that it matches with what is in a CSR or private key
`
openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa -noout -modulus -in privateKey.key | openssl md5
openssl req -noout -modulus -in CSR.csr | openssl md5
`
Check an SSL connection. All the certificates (including Intermediates) should be displayed
openssl s_client -connect www.paypal.com:443
# Pod Hand-on
## Two-Container Pod
创建一个运行两个container的pod
```
kubectl create -f https://raw.githubusercontent.com/jianchen2580/k8s-example/master/pod/two-container-pod.yaml
```
查看Pod信息:

Pod Hand-on

Two-Container Pod

创建一个运行两个container的pod

kubectl create -f https://raw.githubusercontent.com/jianchen2580/k8s-example/master/pod/two-container-pod.yaml

查看Pod信息:

创建headless service

Zookeeper Stateful Set 需要创建一个headless的service来控制域名, 包括两个端口2888/3888,server/2888端口是为了follow与leader通信用,3888端口是为了leader选举

apiVersion: v1
kind: Service
metadata:
  name: zk-headless
  labels: