spf13/cobra is a great package if you want to write your own console app. Even Kubernetes console use cobra to develop it console app. Create simple CLI app example. Let’s use kubectl as simple example it support. kubectl get nodes kubectl create -f ...RESOURCE kubectl delete -f ...RESOURCE Create sub-command using Cobra Take those command as an example, there are some sub-command as follow: get create delete Here is how we add that sub-command to your app. (ex: kctl) cobra init in your repo. It will create /cmd and main.go. cobra add get to add sub-command get now, you can try kctl get to get prompt from the console which you already call this sub-command. Repeatedly for create and delete. You will see related help in kctl --help. Add nested-command using Cobra Cobra could use console mode to add sub-command, but you need to add nested command manually. ex: we...
心得: 這篇文章是講解到關於 git rebase 的部分,講著就提到一些 git 技巧.也提到該如何把不小心 commit 的檔案從 git 記錄內徹底刪除的方法. Rebase Manually auto-rebase Before start to rebase: git fetch origin Pull latest code and start rebase: (ex: rebase to master) git rebase origin/master Start rebase git rebase --continue … modify code. git add your_changed_code Force push because tree different: git push -f -u origin HEAD -u: for upstream sort term. -f: force (because you rebase your code history) Interactive rebasing Rebase with interactive git rebase -i (interactive) origin/develop It will entry Select your change and make as squash, pick. Check all commits. git log stat Reset git reset HEAD~ (rollback last change) git log --stat --decorate Here is detail example how to rebase from evan/test1 to develop git checkout -t origin/evan/test1 git log --stat --decorate git fetch origin git rebase -i origin/develop vim .gitignore git add -v .gitignore git rebase --continue git status git submodule update git log --stat...
A slide to summarized some features comparison about Mesos and Kubernetes.
這篇投影片整理了 mesos 與 Kubernetes 的一些比較. 內容有包含:
這兩年的發展
基本架構圖
整理最久的就是近兩年的版本功能發表的時間軸
希望能幫助一些人