Skip to content

Instantly share code, notes, and snippets.

View yifan-gu's full-sized avatar

Yifan Gu yifan-gu

  • Anchorage Digital
  • San Francisco
View GitHub Profile
@yifan-gu
yifan-gu / upgrade-1.6.6-notes.md
Last active July 5, 2017 23:58
Notes for Tectonic 1.6.6 upgrade

(Original issue: coreos/tectonic-installer#347)

When upgrading to Tectonic-1.6.6, we will make two additional changes to kube-scheduler and kube-controller-manager manifests besides bumping their image versions:

  • Change the pod anti-affinity from preferredDuringSchedulingIgnoredDuringExecution to requiredDuringSchedulingIgnoredDuringExecution.
  • Make the deployment replica counts = the number of master nodes.

These changes imply that if there is any master node goes down and never comes back during the upgrade, the upgrade won't complete because there's not enough nodes to land the pods.

@yifan-gu
yifan-gu / deployment-s3-backup.yaml
Created June 8, 2017 01:55
etcd backup manifests
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: etcd-operator-test
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
@yifan-gu
yifan-gu / sshclient_example.go
Created May 16, 2017 23:22
simple sshclient
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"strings"
"golang.org/x/crypto/ssh"
@yifan-gu
yifan-gu / nginxpodchecker.go
Created May 15, 2017 21:18
nginx pod checker
package main
import (
"fmt"
"os"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api"
@yifan-gu
yifan-gu / kube-etcd-0001.log
Created April 4, 2017 01:06
kube etcd logs
2017-04-04 00:35:48.181672 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_SERVICE_HOST=10.3.0.15
2017-04-04 00:35:48.182161 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_SERVICE_PORT_CLIENT=2379
2017-04-04 00:35:48.182165 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_PORT_2379_TCP_ADDR=10.3.0.15
2017-04-04 00:35:48.182170 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_SERVICE_PORT=2379
2017-04-04 00:35:48.182173 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_PORT=tcp://10.3.0.15:2379
2017-04-04 00:35:48.182176 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_PORT_2379_TCP_PORT=2379
2017-04-04 00:35:48.182180 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_PORT_2379_TCP_PROTO=tcp
2017-04-04 00:35:48.182185 W | pkg/flags: unrecognized environment variable ETCD_SERVICE_PORT_2379_TCP=tcp://10.3.0.15:2379
2017-04-04 00:35:48.182203 I | etcdmain: etcd Version: 3.1.0
2017-04-04 00:35:48.182206 I | etcdmain: Git SH
@yifan-gu
yifan-gu / etcd-operator.log
Created April 4, 2017 00:55
etcd operator logs
time="2017-04-04T00:29:57Z" level=info msg="etcd-operator Version: 0.2.4"
time="2017-04-04T00:29:57Z" level=info msg="Git SHA: 7be6965"
time="2017-04-04T00:29:57Z" level=info msg="Go Version: go1.7.5"
time="2017-04-04T00:29:57Z" level=info msg="Go OS/Arch: linux/amd64"
E0404 00:29:57.937511 5 election.go:226] error retrieving resource lock kube-system/etcd-operator: Get https://10.3.0.1:443/api/v1/namespaces/kube-system/endpoints/etcd-operator: dial tcp 10.3.0.1:443: getsockopt: connection refused
E0404 00:30:02.803406 5 election.go:226] error retrieving resource lock kube-system/etcd-operator: Get https://10.3.0.1:443/api/v1/namespaces/kube-system/endpoints/etcd-operator: dial tcp 10.3.0.1:443: getsockopt: connection refused
E0404 00:30:08.733081 5 election.go:226] error retrieving resource lock kube-system/etcd-operator: Get https://10.3.0.1:443/api/v1/namespaces/kube-system/endpoints/etcd-operator: dial tcp 10.3.0.1:443: getsockopt: connection refused
E0404 00:30:12.504978 5 ele
@yifan-gu
yifan-gu / testdeletedeployment.go
Created March 24, 2017 23:30
test deployement scaledown
package main
import (
"fmt"
"os"
"github.com/coreos-inc/operator-client/pkg/client"
)
// Before running the program, run: kubectl run foo --image=nginx --labels='app=foo'
@yifan-gu
yifan-gu / instruction.md
Created March 14, 2017 00:57
instruction for 1.5.2-tectonic.2 clusters to switch coreupdate channel

As we are changing the channel model in CoreUpdate Server since 1.5.3-tectonic.1 release, users on clusters with older version (1.5.2-tectonic.2) need to manually modify their channel operator’s config to switch to the new CoreUpdate channel.

This can be done by replacing channel: alpha with channel: tectonic-1.5 in the channel operator’s config.

For example:

kubectl replace -f -<<EOF
apiVersion: coreos.com/v1
appID: 6bc7b986-4654-4a0f-94b3-84ce6feb1db4
automaticUpdate: false
@yifan-gu
yifan-gu / example.md
Created March 1, 2017 02:29
check update

Initial state

kubectl get channeloperatorconfig default -o json -n tectonic-system
{
  "apiVersion": "coreos.com/v1",
  "kind": "ChannelOperatorConfig",
  "metadata":{
    "name": "default",
    "namespace": "tectonic-system"
  },
@yifan-gu
yifan-gu / examples.md
Last active February 21, 2017 21:19
AppVersion examples with taskStatuses and failureReason

Delete the kvo / tco deployment so they don't mess with the TPRs created below.

kubectl delete deployment tectonic-channel-operator -n tectonic-system
kubectl delete deployment kube-version-operator -n tectonic-system

Replace/create the TPR for kvo and tco

cat app-version-kubernetes.json