├── 2016年Kubernetes大事记
├── 2016 Kubernetes.html
├── 2016 Kubernetes_files
│ ├── 1896d5c89bbe5781c5514eaf2962418006f86ca3.app.js
│ ├── 2293f39cb69a4f157efdc6dffaafe2631720cf4b.soc-prod.css
│ ├── analytics.js
│ ├── b28b36b0eeacd2774a9d7c25c31a21ba089ceabc.libs.js
│ ├── css
│ ├── css(1)
│ ├── css(2)
│ ├── home-banner-world.png
│ ├── icon
│ ├── rocket.svg
│ └── summer-of-code-logo.svg
├── 2016K8s.tar.gz
├── 2016年Kubernetes大事记.numbers
└── 2016年Kubernetes大事记.xlsx
├── 5-days-of-Kubernetes
├── Advanced Scheduling in Kubernetes
│ └── README.md
├── Dynamic Provisioning and Storage Classes in Kubernetes
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── README.md
│ ├── cloud-storage-830x364.png
│ ├── cloud-storage.jpg
│ ├── gold.png
│ └── images.png
└── Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters
│ ├── C80JKqEXcAAezrH.jpg
│ ├── C80JKqEXcAAezrH.jpg-large
│ ├── README.md
│ ├── Scalability-canstockphoto19089920.jpeg
│ ├── chart 1.png
│ ├── chart.png
│ └── original.md
├── Articles
├── Add Golang plugin to Intelli J Idea CE.md
├── CRUD_vs_CQRS.md
├── Continuously_Integration.md
├── Deploy_Gitlab_CI.md
├── Ping.md
├── README.md
├── [Aug 10th] Memory Management.md
├── [Aug 12th] Http long & short connection
├── [Aug 8th] TCP and UDP MSS and MTU.md
├── [Aug 9th] Path MTU Discovery.md
├── intellij-go-resolve.jpg
├── ping1.png
└── ping2.png
├── CPL
├── a.out
├── aaa
├── aes-test.cpp
├── aes-test2.cpp
├── aes-test3.cpp
├── aes-test4.cpp
├── aes-test5.cpp
├── aes-test6.cpp
├── aes-test7.cpp
├── array-test.cpp
├── for.cpp
├── md5test.c
├── rsa-test1.cpp
├── rsa-test2.cpp
├── rsa-test3.cpp
├── rsa-test4.cpp
├── rsa.cpp
├── t
└── xor.cpp
├── Caasone
├── HistoryArticles
│ └── README.md
└── Kubernetes: Edge vs. Level
Triggered Logic
│ ├── README.md
│ └── image
│ ├── 1.png
│ ├── 10.png
│ ├── 11.png
│ ├── 12.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ ├── 9.png
│ ├── edge.png
│ └── level.png
├── CleanCode
├── CleanCode-1.md
└── pics
│ └── productivity_time.png
├── ContainerPro
├── README.md
├── resource.md
└── storage.md
├── DailyWork
├── December.md
├── Feburary.md
├── January.md
├── March.md
├── November.md
└── overview.md
├── DesignPattern
├── Chain-of-Responsibility
│ └── Chain-of-responsibility.md
├── Composite
│ └── composite.md
├── Demeter
│ └── demeter.md
├── Factory
│ └── factory.md
├── Singleton
│ ├── car.go
│ └── singleton.md
└── State
│ └── state.md
├── EnTechDoc
├── A Service Mesh for Kubernetes, Part V: Dogfood environments, ingress and edge routing
│ └── README.md
├── Achieving CI and CD With Kubernetes
│ ├── README.md
│ ├── achievingcicd-1.png
│ ├── achievingcicd-10.png
│ ├── achievingcicd-11.png
│ ├── achievingcicd-12.png
│ ├── achievingcicd-14.png
│ ├── achievingcicd-15.png
│ ├── achievingcicd-16.png
│ ├── achievingcicd-2.png
│ ├── achievingcicd-3.png
│ ├── achievingcicd-4.png
│ ├── achievingcicd-5.png
│ ├── achievingcicd-6.png
│ ├── achievingcicd-7.png
│ ├── achievingcicd-8.png
│ └── achievingcicd-9.png
├── How to Calculate Kubernetes Cost Savings
│ ├── README.md
│ ├── cost-reduction-projects1-e1371369693372.jpg
│ ├── cut-costs.jpg
│ └── luh.png
├── How to monitor nginx on kubernetes
│ └── README.md
├── Increasing Attacker Cost Using Immutable Infrastructure
│ ├── README.md
│ ├── Security-diagrams.png
│ ├── backinbiz.png
│ ├── hacked.png
│ └── welcome.png
├── Install Kubernetes 1.4.0
│ ├── Intallation.md
│ ├── README.md
│ ├── dash pod.png
│ ├── kubeadm init.png
│ ├── kubectl applay.png
│ ├── kubectl taint.png
│ ├── maxresdefault.jpg
│ ├── nodeport.png
│ ├── socks.png
│ └── wave.png
├── Kubernete 1.6 release
│ ├── README.md
│ └── itemeditorimage_58d95eefae65c.png
├── Kubernetes 1.4 release
│ └── README.md
├── Kubernetes 1.5 release
│ ├── FeatureBoard.md
│ └── t
├── Kubernetes – Stupid Human mistakes going to prod
│ └── README.md
├── Microscaling MicroBadger
│ └── README.md
├── Programmable Infrastructure in Production with Kubernetes
│ ├── 0-JZg9Fa9GYYTFbMNU.jpg
│ ├── 582399f13af732000b000001-Driving-devops.jpg
│ ├── Column_1_PROGRAMMABLE_INFRASTRUCTURE.jpg
│ ├── README.md
│ ├── architecture.png
│ └── new-architecture.png
├── Secure Your Kubernetes Clusters With RBAC
│ ├── 1.png
│ ├── Access_Control_EA.jpg
│ ├── Cluster Role.png
│ ├── ClusterRoleBinding.png
│ ├── RBAC.jpg
│ ├── README.md
│ ├── Role Binding.png
│ ├── RoleBinding2.png
│ ├── roles-primary.jpg
│ ├── secret.png
│ └── training.png
├── graceful-shutdown
│ └── README.md
├── k8s-how-we-made-k8s-insanely-easy-to-install
│ └── README.md
├── k8s-persistent-volumes
│ ├── README.md
│ └── k8s-pv.png
└── kubefed
│ └── README.md
├── FruitCandy
├── box1.md
├── box2.md
├── box3.md
├── box4.md
├── box5.md
├── box6.md
└── padora.md
├── Go-Chrome-Plugins
├── .idea
│ ├── Go-Chrome-Plugins.iml
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── libraries
│ │ └── GOPATH__Go_Chrome_Plugins_.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── workspace.xml
├── demo.go
├── demo.js
├── demo.js.map
├── manifest.json
└── popup.html
├── GolangDairy
├── BuildYourLog.md
├── InterfaceVsNil.md
└── NilisNotEmpty.md
├── How we Scaled Kubenretes to 60,000-Container Cluster and Where We're Going Next
└── README.md
├── IntroIdeas
├── '
├── 5_More_Reasons_To_Love_Kubernetes.md
├── Build-your-own-horizonal-pod-autoscaler-for-Kubernetes.md
├── Build_Modern_Bank_Backend.md
├── Clutered_RabbitMQ_On_Kubernetes.md
├── Fission_Serverless_Functions_For_Kubernetes.md
├── How_the_Go_programming_language_helps_Docker_and_the_container_ecosystem.md
├── Introducing_Container_Runtime_Interface_in_Kubernetes.md
├── Kubernetes-Namespaces-use-cases-and-insights.md
├── Kubernetes-Understanding-Resources.md
├── Kubernetes_1.5_preview.md
├── Principles_of_good_RESTful_API_Design.md
├── Run_Deep_Learning_with_PaddlePaddle_on_Kubernetes.md
├── Top_5_Reasons_to_Love-Kubernetes.md
├── Using_Deployment_objects_with_Kubernetes_1.2.md
├── all.md
├── pics
│ ├── 5_more.jpg
│ ├── How_the_Go_programming_language_helps_Docker_and_the_container_ecosystem.png
│ ├── baidu-research.png
│ ├── insights.jpg
│ ├── job_paddle.png
│ ├── k8s-custom-hpa-scaling-down.png
│ ├── k8s-custom-hpa-scaling-up.png
│ ├── namespace.png
│ ├── overview-cri.png
│ ├── paddle-model.png
│ ├── plan_to_use_go_in_the_future.png
│ ├── rest_api.jpg
│ ├── restful_api_1.png
│ ├── top-5.jpg
│ ├── top5borg.png
│ └── top5cube.png
├── rkt_and_kubernetes.md
└── serverless-faas-fingle.md
├── KubeCon
└── about
│ └── README.md
├── Kubernetes Hash碰撞问题解决
└── README.md
├── Kubernetes Resource Model
├── README.md
├── avaliable.png
├── capacity.png
├── defragment.png
├── fragment.png
├── pod-scheduler-node.png
└── rebalance.png
├── Lightning Talk - Micro-Services Lifecycle Management at Twitter by Micheal Benedict, Twitter
└── README.md
├── MTalking
├── 2
├── faas-1.md
├── fission-1.md
├── from-fsm-to-autotest.md
├── go-log-1.md
├── go-log-2.md
├── k8s-1.md
├── kube-events-2.md
├── kube-events-3.md
├── kube-events.md
├── kube-tmp
├── kubeadm-1.md
├── pics
│ ├── 3-tiers-web-application.png
│ ├── Kubelet-show.png
│ ├── curl-events-err.png
│ ├── curl-events-succ.png
│ ├── deployment-define.png
│ ├── docker-cli-docker-daemon.jpg
│ ├── docker-server.jpg
│ ├── events-define.png
│ ├── events-json.png
│ ├── events-restapi.png
│ ├── fissin-http.png
│ ├── fission-env.png
│ ├── fission-fission-all.png
│ ├── fission-function.png
│ ├── fission-http (2).png
│ ├── fission-http-seq.png
│ ├── fission-http.png
│ ├── fission-on-k8s.png
│ ├── fission-rest-api.png
│ ├── fix-intellij-cannot-resolve-references-bug.png
│ ├── golang.jpg
│ ├── goldeneye
│ ├── kube-events.jpg
│ ├── kube-events.png
│ ├── kubectl-describe-eventd-err01.png
│ ├── kubectl-describe-events-err03.png
│ ├── kubectl-events-succ.png
│ ├── kubectl-get-events.png
│ ├── mindmap.png
│ ├── mindmap2.png
│ ├── pod-define.png
│ ├── serverless-app.png
│ ├── speed-up-the-platform.jpg
│ ├── think.jpeg
│ ├── var-lib-docker-containers.png
│ ├── varlog.png
│ ├── varlog2.png
│ └── web-serverless.png
└── todolist.md
├── Monitoring kubernetes with prometheus
├── .DS_Store
├── README.md
├── appmetrics.png
├── arch.jpeg
├── architecture.svg
├── dashboard.png
├── datasource.png
├── grafana
│ ├── .DS_Store
│ ├── all-nodes_rev1.json
│ ├── deployment-metrics_rev1.json
│ ├── final-setup-final_rev1.json
│ ├── kubernetes-apps_rev1.json
│ ├── kubernetes-cluster-monitoring-via-prometheus_rev2.json
│ ├── kubernetes-pod-monitoring_rev1.json
│ ├── nodes_rev1.json
│ └── pod-metrics_rev2.json
├── grafanapod.png
├── import.png
├── k8scluster.png
├── k8sdeploymetrics.png
├── kubecluster.png
├── login.png
├── manifests-all.yaml
├── prom.tar
├── prometheus-ds.png
└── upload.png
├── MyCS100
├── Architecture
│ └── ComputerSystemsAProgrammersPerspective
│ │ └── src
│ │ └── code
│ │ ├── Chap10
│ │ └── main.c
│ │ ├── intro
│ │ ├── gcc-procedure
│ │ ├── hello
│ │ ├── hello.c
│ │ ├── hello.i
│ │ ├── hello.o
│ │ ├── hello.s
│ │ └── helloworld
│ │ └── testplace
│ │ ├── big-product
│ │ ├── big-product.c
│ │ ├── byte-sequence.c
│ │ ├── dec-hex.perl
│ │ └── hex-dec.perl
├── Database
│ ├── MySQL
│ │ ├── FAQ.md
│ │ ├── Notes
│ │ │ ├── Bit_Type.md
│ │ │ ├── Insert_bulk_data_to_InnoDB_tables.md
│ │ │ ├── Insert_on_duplicate_key_update.md
│ │ │ ├── Right_Join.md
│ │ │ └── Update_No_Effect.md
│ │ ├── ORM
│ │ │ ├── Overview.md
│ │ │ └── gorm
│ │ │ │ └── overview.md
│ │ └── Overview.md
│ └── Redis
│ │ └── Overview.md
├── Hardware
│ └── Overview.md
├── Network
│ ├── HTTP
│ │ ├── Authorization
│ │ │ └── overview.md
│ │ ├── Cache
│ │ │ └── overview.md
│ │ ├── Cookies
│ │ │ └── overview.md
│ │ ├── HTTPS
│ │ │ └── overview.md
│ │ ├── Overview.md
│ │ └── WebSocket
│ │ │ └── overview.md
│ └── Overview.md
├── OperatingSystems
│ ├── LinuxKernel
│ │ └── Understanding-Linux-Kernel
│ │ │ ├── Bootstrap.md
│ │ │ ├── OS-Basis.md
│ │ │ └── overview.md
│ └── Overview.md
├── Security
│ ├── Overview.md
│ ├── RBAC
│ │ ├── Role-Based-Access-Controls.md
│ │ └── pics
│ │ │ ├── 3-basic-rules-of-rbac.png
│ │ │ ├── formal-description-of-rbac.png
│ │ │ ├── multi-role-relationships.png
│ │ │ └── role-based.png
│ └── SQL
│ │ ├── overview.md
│ │ └── sql-inject.md
├── Serverless
│ ├── Overview.md
│ └── faas
│ │ ├── fission
│ │ ├── fission-nodeport.yaml
│ │ ├── fission.yaml
│ │ └── hello.js
│ │ ├── overview.md
│ │ └── papers
│ │ ├── Function-as-a-service-an-ad-hoc-approach-to-cloud-computing.md
│ │ └── Your-Server-as-a-Function.md
├── Storage
│ └── Ceph
│ │ └── Overview.md
├── Testing
│ ├── BDD
│ │ └── overview.md
│ └── Overview.md
└── Tools
│ └── VersionControlSystem
│ ├── Git
│ └── overview.md
│ ├── Overview.md
│ └── Svn
│ └── Overview.md
├── OpenFreeShare
├── Readme.md
└── a-brief-introduction-to-golang
│ ├── Readme.md
│ ├── article.md
│ └── demo
│ ├── advanced-http-server
│ ├── client.go
│ ├── proxy.go
│ ├── proxy1.go
│ ├── server.go
│ └── src.md
│ ├── rpc-cs
│ ├── rpc-client.go
│ ├── rpc-server.go
│ └── rpc.md
│ └── web
│ ├── main.go
│ └── main.md
├── Presentation
└── DockerOne
│ ├── README.md
│ └── images
│ ├── Kubernetes2.png
│ ├── agenda.png
│ ├── background.png
│ ├── challenge.png
│ ├── choice.png
│ ├── cicd.png
│ ├── cicdflow.png
│ ├── cloudnative.png
│ ├── efk.png
│ ├── infrastructuer.png
│ ├── kubernetes1.png
│ ├── pipeline.png
│ ├── qos.png
│ ├── theory.png
│ ├── yce.png
│ └── yceui.png
├── README.md
├── Reprint
└── Kubernetes 1.6.0 高可靠集群部署
│ ├── README.md
│ ├── deploy.png
│ └── table.png
├── Review
├── README.md
├── designpattern
│ └── README.md
├── docker
│ └── README.md
├── extensions
│ └── README.md
├── golang
│ └── README.md
├── kubernetes
│ └── README.md
├── mysql
│ └── README.md
├── redis
│ └── README.md
└── shell
│ └── README.md
├── Tips
└── Search images from gcr
│ └── README.md
├── index.rst
├── pics
├── addrepo.png
├── build.png
├── gitgoplugin.png
├── idealli j vim.png
├── ideapr.png
├── moduledepedent.png
├── modulenext.png
├── modulepath.png
├── modules.png
├── plugins.png
├── preference.png
├── projectstructure.png
└── searchgo.png
├── 中期答辩讲稿
└── README.md
├── 从Kubernetes的一个Bug说开去
├── Kubernetes_ShippingContainers.jpg
├── README.md
├── dp-rs-pod.png
├── error.png
├── kubectldescirbedps.png
├── kubectlgetdpsyce.png
├── revisionhistory.png
├── soucecode-error.png
├── sourcecode-adler.png
├── sourcecode-create.png
├── sourcecode-getNewRs.png
└── sourcecode-podtemplate.png
├── 使用prometheus-operator监控kubernetes集群
├── .DS_Store
├── README.md
└── images
│ ├── Deployment.png
│ ├── Nodes.png
│ ├── Pods.png
│ ├── StatefulSet.png
│ ├── etcd-by-prometheus.png
│ ├── etcd.png
│ ├── kubernetes-cluster-health.png
│ ├── kubernetes-metrics-with-prometheus.png
│ ├── kubernetes-monitoring-proposal.jpeg
│ ├── kubernetes-prometheus-architecture.jpeg
│ ├── operator-workflow.png
│ ├── prometheus-dashboard.png
│ ├── prometheus-etcd.png
│ ├── prometheus-graph.png
│ └── prometheus-targets.png
└── 聊聊持续发布
├── 6E33E5AB-CE62-4D52-BE14-28E59DC6D49C.png
└── README.md
/2016年Kubernetes大事记/2016 Kubernetes_files/css:
--------------------------------------------------------------------------------
1 | /*
2 | * See: https://www.google.com/fonts/license/productsans
3 | */
4 | /* cyrillic */
5 | @font-face {
6 | font-family: 'Product Sans';
7 | font-style: normal;
8 | font-weight: 400;
9 | src: local('Product Sans'), local('ProductSans-Regular'), url(https://fonts.gstatic.com/s/productsans/v9/HYvgU2fE2nRJvZ5JFAumwRdwxCXfZpKo5kWAx_74bHs.woff2) format('woff2');
10 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
11 | }
12 | /* greek */
13 | @font-face {
14 | font-family: 'Product Sans';
15 | font-style: normal;
16 | font-weight: 400;
17 | src: local('Product Sans'), local('ProductSans-Regular'), url(https://fonts.gstatic.com/s/productsans/v9/HYvgU2fE2nRJvZ5JFAumwfy1_HTwRwgtl1cPga3Fy3Y.woff2) format('woff2');
18 | unicode-range: U+0370-03FF;
19 | }
20 | /* latin-ext */
21 | @font-face {
22 | font-family: 'Product Sans';
23 | font-style: normal;
24 | font-weight: 400;
25 | src: local('Product Sans'), local('ProductSans-Regular'), url(https://fonts.gstatic.com/s/productsans/v9/HYvgU2fE2nRJvZ5JFAumwYjoYw3YTyktCCer_ilOlhE.woff2) format('woff2');
26 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
27 | }
28 | /* latin */
29 | @font-face {
30 | font-family: 'Product Sans';
31 | font-style: normal;
32 | font-weight: 400;
33 | src: local('Product Sans'), local('ProductSans-Regular'), url(https://fonts.gstatic.com/s/productsans/v9/HYvgU2fE2nRJvZ5JFAumwRampu5_7CjHW5spxoeN3Vs.woff2) format('woff2');
34 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
35 | }
36 |
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016 Kubernetes_files/home-banner-world.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/2016年Kubernetes大事记/2016 Kubernetes_files/home-banner-world.png
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016 Kubernetes_files/icon:
--------------------------------------------------------------------------------
1 | /* fallback */
2 | @font-face {
3 | font-family: 'Material Icons';
4 | font-style: normal;
5 | font-weight: 400;
6 | src: local('Material Icons'), local('MaterialIcons-Regular'), url(https://fonts.gstatic.com/s/materialicons/v20/2fcrYFNaTjcS6g4U3t-Y5UEw0lE80llgEseQY3FEmqw.woff2) format('woff2');
7 | }
8 |
9 | .material-icons {
10 | font-family: 'Material Icons';
11 | font-weight: normal;
12 | font-style: normal;
13 | font-size: 24px;
14 | line-height: 1;
15 | letter-spacing: normal;
16 | text-transform: none;
17 | display: inline-block;
18 | white-space: nowrap;
19 | word-wrap: normal;
20 | direction: ltr;
21 | -webkit-font-feature-settings: 'liga';
22 | -webkit-font-smoothing: antialiased;
23 | }
24 |
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016 Kubernetes_files/rocket.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016 Kubernetes_files/summer-of-code-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016K8s.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/2016年Kubernetes大事记/2016K8s.tar.gz
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016年Kubernetes大事记.numbers:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/2016年Kubernetes大事记/2016年Kubernetes大事记.numbers
--------------------------------------------------------------------------------
/2016年Kubernetes大事记/2016年Kubernetes大事记.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/2016年Kubernetes大事记/2016年Kubernetes大事记.xlsx
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/1.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/2.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/3.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/4.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/cloud-storage-830x364.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/cloud-storage-830x364.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/cloud-storage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/cloud-storage.jpg
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/gold.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/gold.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/images.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Dynamic Provisioning and Storage Classes in Kubernetes/images.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/C80JKqEXcAAezrH.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/C80JKqEXcAAezrH.jpg
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/C80JKqEXcAAezrH.jpg-large:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/C80JKqEXcAAezrH.jpg-large
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/Scalability-canstockphoto19089920.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/Scalability-canstockphoto19089920.jpeg
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/chart 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/chart 1.png
--------------------------------------------------------------------------------
/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/5-days-of-Kubernetes/Scalability updates in Kubernetes 1.6: 5,000 node and 150,000 pod clusters/chart.png
--------------------------------------------------------------------------------
/Articles/Add Golang plugin to Intelli J Idea CE.md:
--------------------------------------------------------------------------------
1 | ## 为Intelli J Idea CE配置Golang开发环境 (Mac)
2 |
3 | 需要安装:
4 |
5 | * Go SDK
6 | * Go Plugin
7 | * Vim Emulation
8 |
9 | ### 1. 为mac安装Go SDK
10 |
11 | 前往[Golang官网](https://golang.org/dl/)下载go1.7rc1.darwin-amd64.pkg,并安装。
12 |
13 |
14 | ### 2. 为Intelli J Idea CE安装Go语言插件
15 |
16 | 安装Go语言插件有三种方法:
17 |
18 | * 在线安装
19 |
20 | 打开Intelli J,然后:
21 |
22 | Preferences -> Plugins -> Browse Repositories
23 |
24 | 
25 |
26 | 
27 |
28 | 搜索关键字Go,并点击安装。
29 |
30 | 
31 |
32 | 如果下载安装速度太慢,可以添加仓库地址:点击 Manage Repositories ,然后点击 + 添加记录:下面两者中的一条:
33 |
34 | [https://plugins.jetbrains.com/plugins/alpha/5047](https://plugins.jetbrains.com/plugins/alpha/5047)
35 |
36 | [https://plugins.jetbrains.com/plugins/nightly/5047](https://plugins.jetbrains.com/plugins/nightly/5047)
37 |
38 | 
39 |
40 |
41 | * 官网下载已安装好的包
42 |
43 | 在刚才的页面Preferences -> Plugins里,可以看到一个选项Install plugin from disk,表示可以从本地选择插件包并进行安装。这里支持的包有两种.jar和.zip。
44 |
45 | 所以可以去Idealli J官网下载相应的插件包并导入。
46 |
47 | [Idealli J官网Golang插件下载地址](https://plugins.jetbrains.com/plugin/5047?pr=idea)
48 |
49 | 
50 |
51 | * 源码编译
52 |
53 | 首先需要下载好golang插件的源码,[地址](https://github.com/go-lang-plugin-org/go-lang-idea-plugin)
54 |
55 | 
56 |
57 | 解压后,打开Intelli J,并使用File --> Open打开该项目,并File --> Project Structure
58 |
59 | 
60 |
61 | 在这里先后设置JDK 和 IntelliJ Platform Plugin SDK,这里试验的JDK版本为1.8,在设置IntelliJ Platform Plugin SDK的时候可以重新设置名字为my-go-plugin-test
62 |
63 | 设置好后还需要在左侧的Modules这里简单设置,选择IntelliJ Platform Plugin,并在下一页设置里设置名称为my-go-plugin-test
64 |
65 | 
66 |
67 | 这里如果是导入已有的Module(即下载的这个包),在Build 里不会出现Prepare Plugin Module xxx For Deployment的选项,只有自己新建了Module才会
68 |
69 | 然后在Modules里设置Dependencies和Paths.
70 |
71 | 
72 |
73 | 
74 |
75 | 注意:必须启用插件Gradle,还可能需要一个org.idea.grammar?的包(这个包可以从官网下载)
76 |
77 | TODO: *这里有些问题*
78 |
79 | 设置结束就可以开始编译插件包了: Build --> Prepare Plugin Module "my-go-plugin-test" For Deployment
80 |
81 | 
82 |
83 | 待编译成功后,可以再从上面的Install plugin from disk进行添加,添加并Apply后要重启IntelliJ,
84 |
85 | TODO: *这里可以成功编译和生成插件jar包,但是导入以后并不能生效,应该还是插件配置有问题*
86 |
87 |
88 | ### 3. 为Intelli J Idea CE安装Vim模拟器
89 |
90 | 如果是喜欢使用Vim环境的同学,可以给Intelli J Idea CE配置Vim模拟器,然后就可以沉溺在“HJKL-上上下下左右左右”的快感中了。我们可以通过简单的在线安装方式完成:
91 |
92 | 
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Articles/CRUD_vs_CQRS.md:
--------------------------------------------------------------------------------
1 | CRUD
2 |
3 | CQRS
4 |
--------------------------------------------------------------------------------
/Articles/Continuously_Integration.md:
--------------------------------------------------------------------------------
1 | Continuous Integration
2 | ======================
3 | Martin Fowler said:
4 | > Practices of CI
5 | > 1. Maintain a Single Source Repository
6 | > 2. Automate the Build
7 | > 3. Make Your Build Self-Testing
8 | > 4. Everyone Commits To the Mainline Every Day
9 | > 5. Every Commit Should Build the Mainline on an Integration Machine
10 | > 6. Fix Broken Builds Immediately
11 | > 7. Keep the Build Fast
12 | > 8. Test in a Clone of the Production Environment
13 | > 9. Make it Easy for Anyone to Get the Latest Executable
14 | > 10. Everyone can see what's happening
15 | > 11. Automate Deployment
16 |
--------------------------------------------------------------------------------
/Articles/Deploy_Gitlab_CI.md:
--------------------------------------------------------------------------------
1 | Deploy Gitlab CI
2 | ================
3 |
4 | [linux-repository](https://docs.gitlab.com/runner/install/linux-repository.html)
5 | [using-docker-build](https://docs.gitlab.com/ce/ci/docker/using_docker_build.html)
6 |
7 |
8 | 1. install Gitlab runner
9 | 2. use shell executor
10 | 3. add ssh key to gitlab server
11 | 4. if the gitlab runner doesn't locate on the same host with gitlab server, maybe you need to proxy the request(e.g. using a docker nginx proxy)
12 | 5. write .gitlab-ci.yml
13 | 6. build
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Articles/Ping.md:
--------------------------------------------------------------------------------
1 | 8日早上,mac发现网络连接不通,具体表现为:微信QQ可用,Chrome打不开网页,ping不通远程服务器,提示:Ping: sendto: No buffer space available.
2 |
3 | 最终重启解决。网上给出的说法主要是网卡缓冲区满、Arp表满等。
4 |
5 | 通过netstat -m可以看到网卡缓冲区的使用情况:
6 |
7 | 结果1、2见下图
8 |
9 | 
10 | 
11 |
12 | 前一天晚上睡觉前,连了VPN测了程序。然后合上笔记本睡觉,早上起来就发现出现了这个问题。但是不知道原因。
13 | 是测试程序的RESTful 接口,通过GET方法带了很多参数造成的?还是VPN没关占用了资源?
14 |
15 |
--------------------------------------------------------------------------------
/Articles/README.md:
--------------------------------------------------------------------------------
1 | # TechTips
2 | Record some techtips.
3 |
--------------------------------------------------------------------------------
/Articles/[Aug 10th] Memory Management.md:
--------------------------------------------------------------------------------
1 | 1. Logical Address --> Linear Address --> Physical Address
2 |
3 | Segment Unit Page Unit
4 | MMU ( Memory Management Unit)
5 |
6 | 2. Segment and Page in memory
7 |
8 | 3. Page and Page frame.
9 |
10 | 4. Page fault. Demanding page. prepage.
11 |
12 | 5. 页面置换算法:LRU 最近最少使用
13 |
--------------------------------------------------------------------------------
/Articles/[Aug 12th] Http long & short connection:
--------------------------------------------------------------------------------
1 | 1. what
2 | 2. how
3 | 3. used for
4 | 4. realizaiton
5 | 5. references
6 |
--------------------------------------------------------------------------------
/Articles/[Aug 8th] TCP and UDP MSS and MTU.md:
--------------------------------------------------------------------------------
1 | #1#
2 |
3 | There are 2 concepts in TCP/IP protocol stack: MSS and MTU.
4 |
5 | To TCP, MTU(Max Transmission Unit) is the max protocol data unit that the layer can pass onwards. It is decided by the Standards(e.g. Ethernet) or Systems(e.g. P2P serial links).
6 |
7 | MSS(Max Segment Size) is max data segment which can be transmitted by it.
8 |
9 | In most cases, both sides will negotiate the MSS for better transport performance. MSS is always the same with MTU when realizing TCP protocol.
10 |
11 | It's value is 1460 after reducing the IP header for 20bytes and TCP header for 20bytes. The max MSS is the smaller one of both sides.
12 |
13 | MTU is different with minimum datagram size and also different with physically transmitted frame.
14 |
15 | Different transportation media has different MTU, e.g. IP -> 65535, Ethernet -> 1500, PPPoE -> 1492
16 |
17 | In some ideal way, MSS is the max data size which will not be divided in IP protocol.
18 |
19 | The size of IP package depends on MTU, the larger package will lead a hgiher transmit speed in theoratical condition. But in fact, larger MTU will cause greater delay and be more problematic. So PPPoE set MTU to 1492, Ethernet set MTU 1500 at the same time 576bytes in Internet.
20 |
21 | It is always not the same MTU on different on the link. IP allows fragmentation: divide datagram into pieces. This overcome the problem but lead to other issues at the meanwhile.
22 |
23 | #2#
24 |
25 | To UDP, the max length of the data package is 65535 which will be 65515 while 20 is reduced for the package header.
26 |
27 | Does UDP has max data size ?
28 |
29 | It's mac address(both source and destination) in datalink layer head.
30 | It's IP address in IP layer head.
31 | It's TCP header in Transportation layer.
32 |
33 | [UDP、TCP、IP最大传输数据](http://blog.csdn.net/qiaoliang328/article/details/7580787)
34 |
35 | [TCP协议中的MSS理解](http://blog.chinaunix.net/uid-20788636-id-2626119.html?/11207.html)
36 |
37 | [图解TCP/IP](http://)
38 |
--------------------------------------------------------------------------------
/Articles/[Aug 9th] Path MTU Discovery.md:
--------------------------------------------------------------------------------
1 | Path MTU Discovery is used for deciding MTU and avoiding IP fragmentation.
2 |
3 | The source host will send a packet with a flag bit DF(Don't Fragmentation) in its headers. The packet will be sent to the destination host only if the middle host whose MTU is smaller will drop it and send back an ICMP packet Fragmentation Needed with its MTU to the source host.
4 |
5 | Problems:
6 | Many network security devices block all ICMP messages for perceived security benefits.(Prevent hacker probing by blocking ICMP traffic.)
7 |
8 | [Path MTU Discovery](https://en.wikipedia.org/wiki/Path_MTU_Discovery)
9 |
--------------------------------------------------------------------------------
/Articles/intellij-go-resolve.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Articles/intellij-go-resolve.jpg
--------------------------------------------------------------------------------
/Articles/ping1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Articles/ping1.png
--------------------------------------------------------------------------------
/Articles/ping2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Articles/ping2.png
--------------------------------------------------------------------------------
/CPL/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/CPL/a.out
--------------------------------------------------------------------------------
/CPL/aaa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/CPL/aaa
--------------------------------------------------------------------------------
/CPL/aes-test.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | int main() {
9 | //char *msg = "01maxwell123456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
10 | //char *msg = "0123456789012345";
11 | //char *msg = "01234567890123456";
12 | char *msg = "01234567890123456";
13 | //char *msg = "01234567890123456789012345678901";
14 | //unsigned char InBuff[64], OutBuff[64];
15 | unsigned char InBuff[1], OutBuff[1];
16 | unsigned char *tmpBuff;
17 | int len_tmpBuff;
18 |
19 | if(strlen(msg) % 16 != 0) {
20 | len_tmpBuff = (strlen(msg) / 16 + 1) * 16;
21 | }else {
22 | len_tmpBuff = strlen(msg);
23 | }
24 | // len_tmpBuff = strlen(msg);
25 | len_tmpBuff = 128;
26 | tmpBuff = (unsigned char *)malloc(len_tmpBuff * sizeof(tmpBuff));
27 | memset(tmpBuff, '\0', len_tmpBuff);
28 |
29 | cout<<"strlen(msg): "<
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | int main() {
9 | char *inmsg = "01maxwell123456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
10 | //char *inmsg = "01234567890123456";
11 | unsigned char InBuff[17], OutBuff[17], MediaBuff[16];
12 | char *outmsg;
13 | int len_outmsg;
14 |
15 | len_outmsg = strlen(inmsg) + 1;
16 | outmsg = (char *)malloc(len_outmsg * sizeof(char));
17 | memset(outmsg, '\0', len_outmsg);
18 |
19 | cout<<"inmsg: "<
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | int main() {
9 | //char *inmsg = "01maxwell123456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
10 | char *inmsg = "01234567890123456";
11 | //char *inmsg = "abc";
12 | unsigned char InBuff[16], OutBuff[16], tmpBuff[17];
13 | char *outmsg;
14 | int len_outmsg;
15 |
16 | len_outmsg = strlen(inmsg) + 1;
17 | outmsg = (char *)malloc(len_outmsg * sizeof(char));
18 | memset(outmsg, '\0', len_outmsg);
19 |
20 | cout<<"inmsg: "<
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | int main() {
9 | //char *inmsg = "01maxwell123456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
10 | char *inmsg = "01234567890123456";
11 | //char *inmsg = "abc";
12 | unsigned char InBuff[16], OutBuff[16], tmpBuff[17];
13 | char *outmsg;
14 | int len_outmsg;
15 |
16 | len_outmsg = strlen(inmsg) + 1;
17 | outmsg = (char *)malloc(len_outmsg * sizeof(char));
18 | memset(outmsg, '\0', len_outmsg);
19 |
20 | cout<<"inmsg: "<
2 | #include
3 | #include
4 | #include
5 | int main(int argc, char **argv)
6 | {
7 | unsigned char buf[512];
8 | unsigned char buf2[512];
9 | unsigned char buf3[512];
10 | unsigned char aes_keybuf[32];
11 | memset(buf,1,sizeof(buf));
12 | memset(buf,0,sizeof(buf2));
13 | memset(buf,0,sizeof(buf3));
14 | memset(aes_keybuf,0,sizeof(aes_keybuf));
15 |
16 |
17 | AES_KEY aeskey;
18 | AES_set_encrypt_key(aes_keybuf,256,&aeskey);
19 | for(int i=0;i
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | int main() {
9 | char *inmsg = "01maxwell123456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
10 | //char *inmsg = "01234567890123456";
11 | unsigned char InBuff[16], OutBuff[16], tmpBuff[17];
12 | int i;
13 |
14 | int num1;
15 | if(strlen(inmsg) % 16 != 0) {
16 | num1 = (strlen(inmsg) / 16 + 1) * 16;
17 | }else {
18 | num1 = strlen(inmsg);
19 | }
20 |
21 | char *cipher;
22 | //int len_cipher = 32;
23 | int len_cipher = num1;
24 | cipher = (char *)malloc(len_cipher * sizeof(char));
25 | memset(cipher, '\0', len_cipher);
26 |
27 |
28 | unsigned char Seed[32];
29 | strcpy((char *)Seed, "AbCdEfGhIjKlMnOpQrStUvWxYz12345");
30 |
31 | AES_KEY AESEncryptKey, AESDecryptKey;
32 | AES_set_encrypt_key(Seed, 256, &AESEncryptKey);
33 | AES_set_decrypt_key(Seed, 256, &AESDecryptKey);
34 |
35 | for(i = 0; i < 4; i++) {
36 | memset((char *)InBuff, '\0', 16);
37 | memset((char *)OutBuff, '\0', 16);
38 | memcpy((char *)InBuff, inmsg + 15 * i, 15);
39 |
40 | AES_ecb_encrypt(InBuff, OutBuff, &AESEncryptKey, AES_ENCRYPT);
41 | memset((char *)InBuff, '\0', 16);
42 | memcpy(cipher + 16 * i, OutBuff, 16);
43 | //AES_ecb_encrypt((unsigned char *)cipher, InBuff, &AESDecryptKey, AES_DECRYPT);
44 | //cout<
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std;
7 |
8 | int main() {
9 | unsigned char InBuff[16], OutBuff[16];
10 | //char *msg1 = "01maxwell123456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
11 | char *msg1 = "mushroom uglymushroom love sheep strawberry";
12 | char *plain;
13 | int len_plain;
14 | len_plain = strlen(msg1);
15 | plain = (char *)malloc(len_plain * sizeof(char));
16 | memset(plain, '\0', len_plain);
17 |
18 | memcpy(plain, msg1, strlen(msg1));
19 |
20 | char *cipher;
21 | int len_cipher;
22 | len_cipher = (len_plain / 16 + 1) * 16;
23 | cipher = (char *)malloc(len_cipher * sizeof(char));
24 | memset(cipher, '\0', len_cipher);
25 |
26 | unsigned char Seed[32];
27 | strcpy((char *)Seed, "AbCdEfGhIjKlMnOpQrStUvWxYz12345");
28 |
29 | AES_KEY AESEncryptKey, AESDecryptKey;
30 | AES_set_encrypt_key(Seed, 256, &AESEncryptKey);
31 | AES_set_decrypt_key(Seed, 256, &AESDecryptKey);
32 |
33 |
34 | int i;
35 | int num1;
36 | num1 = len_plain / 16 + 1;
37 |
38 | for(i = 0; i < num1; i++) {
39 | memset((char *)InBuff, '\0', 16);
40 | memset((char *)OutBuff, '\0', 16);
41 |
42 | if (i == (num1 - 1)) {
43 | memcpy((char *)InBuff, plain + 16 * i, len_plain % 16);
44 | } else {
45 | memcpy((char *)InBuff, plain + 16 * i, 16);
46 | }
47 |
48 | AES_ecb_encrypt(InBuff, OutBuff, &AESEncryptKey, AES_ENCRYPT);
49 | memcpy(cipher + 16 * i, (char *)OutBuff, 16);
50 | }
51 |
52 | char plain2[100];
53 | memset(plain2, '\0', 100);
54 |
55 |
56 | for (i = 0; i < num1; i++) {
57 | memset((char *)InBuff, '\0', 16);
58 | memset((char *)OutBuff, '\0', 16);
59 |
60 | memcpy((char *)OutBuff, cipher + 16 * i, 16);
61 |
62 | AES_ecb_encrypt(OutBuff, InBuff, &AESDecryptKey, AES_DECRYPT);
63 | if(i == (num1 - 1)) {
64 | memcpy(plain2 + 16 * i, (char *)InBuff, len_plain % 16);
65 | }else {
66 | memcpy(plain2 + 16 * i, (char *)InBuff, 16);
67 | }
68 | }
69 |
70 | cout<
2 | using namespace std;
3 |
4 | int main()
5 | {
6 | int a[5] = {1, 2, 3, 4, 5};
7 | cout<
2 |
3 | using namespace std;
4 |
5 | int main() {
6 | int i;
7 | for (i = 0; i < 10; i++ ) {
8 | cout<
2 | #include
3 | #include
4 |
5 | int main( int argc, char **argv )
6 | {
7 | MD5_CTX ctx;
8 | unsigned char *data="123";
9 | unsigned char md[16];
10 | char *tmp = NULL;
11 | int i;
12 |
13 | MD5_Init(&ctx);
14 | MD5_Update(&ctx,data,strlen(data));
15 | MD5_Final(md,&ctx);
16 |
17 | tmp = (char *)malloc(35);
18 | memset(tmp, 0x00, 35);
19 | strcpy(tmp, "$1$");
20 |
21 | for( i=0; i<16; i++ ){
22 | sprintf(tmp + ( i * 2), "%02x", md[i]);
23 | }
24 | tmp[32] = 0;
25 |
26 | printf("%s\n",tmp);
27 | return 0;
28 | }
29 |
--------------------------------------------------------------------------------
/CPL/rsa-test1.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "openssl/rsa.h"
3 | #include
4 |
5 | using namespace std;
6 |
7 | int main()
8 | {
9 |
10 | RSA *ClientRsa = RSA_generate_key(512, RSA_F4, NULL, NULL);
11 |
12 | unsigned char PublicKey[512];
13 | unsigned char *PKey = PublicKey;
14 | int PublicKeyLen = i2d_RSAPublicKey(ClientRsa, &PKey);
15 |
16 | PKey = PublicKey;
17 | RSA *EncryptRsa = d2i_RSAPublicKey(NULL, (const unsigned char**)&PKey, PublicKeyLen);
18 |
19 | unsigned char InputBuff[64], OutputBuff[64];
20 | int plen = 0, clen = 0;
21 | strcpy((char *)InputBuff, "Hello Mushrom Hello Mushroom");
22 |
23 | cout<<"Source Message: "<
2 | #include "openssl/rsa.h"
3 | #include
4 |
5 | using namespace std;
6 |
7 | int main()
8 | {
9 |
10 | RSA *privateKey = RSA_generate_key(512, RSA_F4, NULL, NULL);
11 |
12 | unsigned char PublicKey[512];
13 | unsigned char *PKey = PublicKey;
14 | int PublicKeyLen = i2d_RSAPublicKey(privateKey, &PKey);
15 |
16 | PKey = PublicKey;
17 | RSA *publicKey = d2i_RSAPublicKey(NULL, (const unsigned char**)&PKey, PublicKeyLen);
18 |
19 | char *msg1 = "Hello Mushroom Hello Mushroom";
20 | int len_msg1;
21 | len_msg1 = strlen(msg1);
22 |
23 |
24 |
25 | unsigned char InputBuff[64], OutputBuff[64];
26 | int plen = 0, clen = 0;
27 | strcpy((char *)InputBuff, msg1);
28 |
29 | cout<<"Source Message: "<
2 | #include "openssl/rsa.h"
3 | #include
4 |
5 | using namespace std;
6 |
7 | int main()
8 | {
9 |
10 | RSA *privateKey = RSA_generate_key(512, RSA_F4, NULL, NULL);
11 |
12 | unsigned char PublicKey[512];
13 | unsigned char *PKey = PublicKey;
14 | int PublicKeyLen = i2d_RSAPublicKey(privateKey, &PKey);
15 |
16 | PKey = PublicKey;
17 | RSA *publicKey = d2i_RSAPublicKey(NULL, (const unsigned char**)&PKey, PublicKeyLen);
18 |
19 | //char *msg1 = "Hello Mushroom Hello Mushroom";
20 | char *msg1 = "Hello Mushroom Hello Sheep Hello uglyMushroom Hello Magic Hello Strawberry";
21 | int len_msg1;
22 | len_msg1 = strlen(msg1);
23 | cout<<"msg1 len: "<
2 | #include "openssl/rsa.h"
3 | #include
4 |
5 | using namespace std;
6 |
7 | int main()
8 | {
9 |
10 | RSA *ClientRsa = RSA_generate_key(512, RSA_F4, NULL, NULL);
11 |
12 | unsigned char PublicKey[512];
13 | unsigned char *PKey = PublicKey;
14 | int PublicKeyLen = i2d_RSAPublicKey(ClientRsa, &PKey);
15 |
16 | printf("PublicKeyBuff, Len=%d\n", PublicKeyLen);
17 | for(int i = 0; i < PublicKeyLen; i++) {
18 | printf("0x%02x, ", *(PublicKey + i));
19 | }
20 | printf("\n");
21 |
22 | PKey = PublicKey;
23 | RSA *EncryptRsa = d2i_RSAPublicKey(NULL, (const unsigned char**)&PKey, PublicKeyLen);
24 |
25 | unsigned char InputBuff[64], OutputBuff[64];
26 | strcpy((char *)InputBuff, "Hello Mushrom");
27 |
28 | cout<<"Source Message: "<
2 | #include
3 | using namespace std;
4 |
5 | int main()
6 | {
7 | char Opr1[] = "eccbc87e4b5ce2fe28308fd9f2a7baf3";
8 | char Opr2[] = "6cb81a0a2c93af812fc8799002c5fcdb";
9 | char Output[128];
10 |
11 | memset(Output, '\0', 128);
12 |
13 | for(int i = 0; i < strlen(Opr1); i++)
14 | {
15 | Output[i] = Opr1[i] ^ Opr2[i];
16 | }
17 |
18 | cout<<"result: "< 导读:前段时间看到Tim Hockin在Twitter上发表一篇文章《Kubernetes: Edge vs. Level Triggered Logic》,看完之后发现这篇文章对理解Kubernetes的核心控制逻辑很有必要,于是就分享给大家,希望有兴趣的朋友在留言中讨论。
5 |
6 | 关于Kubernetes为什么使用水平触发,原因如下:
7 |
8 | * 对于Kubernetes,状态比事件重要
9 |
10 | * 水平触发正好符合可以多次状态检查的特性
11 |
12 | * Client可以在任何时候检查/重复检查状态
13 |
14 | * 这也是Kubernetes的核心控制逻辑
15 |
16 |
17 | #### 背景知识
18 | -------------
19 |
20 | 熟悉Linux网络编程的朋友都知道epoll的两个事件机制:水平触发(LT)和边缘触发(ET)。 在展示Tim Hockin的演讲稿之前,我们先做些理论准备:什么是水平触发和边缘触发。
21 |
22 |
23 | ##### 水平触发
24 | ------------
25 |
26 | 
27 |
28 | > Level Trigger:
29 | > 1) The input signal is sampled when the clock signal is either HIGH or LOW.
30 | > 2) It is sensitive to Glitches.
31 | > Example: Latch
32 |
33 | 水平触发(Level Triggered):只要满足一定条件(或者说中断发生),会触发一个事件,只要事件未发生变化,系统就会一直提醒应用程序,直到事件处理完成为止。
34 |
35 | ##### 边缘触发
36 | ------------
37 |
38 | 
39 |
40 | > 1) The input signal is sampled at the RISING EDGE or FALLING EDGE of the clock signal.
41 | > 2) It is not-sensitive to Glitches.
42 | > Example: Flipflop.
43 |
44 | 边缘触发(Edge Triggered),当状态变化的时候,会触发一个事件,以后如果状态一直没有变化或没有重新要求系统给出通知,将不再通知应用程序。
45 |
46 |
47 | #### Kubernetes: Edge vs. Level Triggered
48 | -------------------------------
49 |
50 | 下面是Tim Hockin的演讲胶片:
51 |
52 | 
53 |
54 | 
55 |
56 | 
57 |
58 | 
59 |
60 | 
61 |
62 | 
63 |
64 | 
65 |
66 | 
67 |
68 | 
69 |
70 | 
71 |
72 | 
73 |
74 | 
75 |
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/1.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/10.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/11.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/12.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/2.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/3.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/4.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/5.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/6.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/7.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/8.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/9.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/edge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/edge.png
--------------------------------------------------------------------------------
/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/level.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Caasone/Kubernetes: Edge vs. Level
Triggered Logic/image/level.png
--------------------------------------------------------------------------------
/CleanCode/pics/productivity_time.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/CleanCode/pics/productivity_time.png
--------------------------------------------------------------------------------
/ContainerPro/README.md:
--------------------------------------------------------------------------------
1 | Container Professional
2 |
--------------------------------------------------------------------------------
/ContainerPro/resource.md:
--------------------------------------------------------------------------------
1 | rescource
2 | ==========
3 |
4 | [](https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md)
5 | [](https://access.redhat.com/documentation/en/openshift-enterprise/3.1/paged/cluster-administration/chapter-8-overcommitting)
6 |
--------------------------------------------------------------------------------
/ContainerPro/storage.md:
--------------------------------------------------------------------------------
1 | Docker Storage Study
2 | ----------
3 | keywords: Aufs(btrfs, devicemapper, vfs, overlayFS), Copy-on-Write, whiteout
4 |
5 | Storage operations:
6 | * New
7 | * Delete
8 | * Modify
9 | * Find
10 | * Diff
11 |
12 | More precisely, protoDriver interface:
13 | * String()
14 | * Create()
15 | * Remove()
16 | * Get()
17 | * Put()
18 | * Exists()
19 | * Status()
20 | * Cleanup()
21 |
22 | navieDiffDriver
23 |
24 | GraphDriver -> drivers list(driver name, driver init method)
25 |
26 | Creation of driver object:
27 | 1. inspect if environment variables DOCKER_DRIVER and variables DefaultDrivers reading from Docker Daemon -storage-driver configuration provide legal driver name
28 | 2. if they are null, GraphDriver will find a available driver in priority queue. available means this driver registry itself and its underlying realiaztion is supported by operating system.
29 | 3. if can not find one available, GraphDriver find the first drivers in all drivers registed. but it is just for future extensions, all 5 drivers must regist themselves.
30 |
31 |
--------------------------------------------------------------------------------
/DailyWork/December.md:
--------------------------------------------------------------------------------
1 | December
2 | ========
3 | 20161201
4 |
5 | [x] 修改确定新的navList,包含个人中心的修改、nodeport管理、顺序调整,准备更新SQL脚本,更新创建用户const
6 | [x] 创建数据中心时自动占用32080端口,更新里也是。
7 | [x] 完成个人中心修改密码的调试
8 | [x] 完成nodeport管理功能的文档编写及调试
9 | [ ] 校验及错误详情的文档编写及调试
10 |
11 | 20161202
12 |
13 | [x] 校验及错误详情的文档编写及调试
14 |
15 | 20161203
16 |
17 | [x] 公众号RESTful API Design文章整理
18 | [x] 校验及错误详情程序编写
19 |
20 | 20161205
21 |
22 | [x] 解决睿哥的问题1和4:1是不能挂载日志卷,2是datayp配额问题
23 | [x] 解决勇哥的问题:更新模板时生成的volumes json格式为map形式,正确的应该是数组形式。问题的原因是在导入模板的时候,缺了一行:$scope.param.deployment.spec.template.spec.volumes = [{}]; 这样在一个if语句的else里。这个if语句的含义就是如果导入的模板里有存储卷,则执行if里面的内容,否则如果没有导入模板,就执行else里的内容。缺少了的这行代码为初始化,如果没有它,就导致了保存的volumes的json变成了map。导致了最后的错误。这句话应该出现在所有涉及导入模板的地方,包括三处:appManage/deployment/controller.js,template/addTemplate/controller.js,walkthrougth/controller.js里
24 | [x] 应用发布的格式校验,但是请求响应时间变慢了很多(太多if语句)
25 |
26 | 20161206
27 |
28 | [x] 新的应用发布的格式校验,完成了objmeta的校验
29 | [x] 在b28为jinchao.ma创建只能看应用管理和集群拓扑的navList
30 | [x] 更新navList 172.21.1.27
31 | [ ] 其他校验的设计
32 |
33 | 20161207
34 |
35 | [x] 应用发布校验完毕
36 | [ ] 服务更新后台
37 |
38 | 20161208
39 |
40 | [x] 为k8s 1.5准备文章,研究新特性
41 |
42 | 20161209
43 |
44 | [x] 为更新组织配额时,如果该组织没有配额(比如原来手动创建的组织),会去创建相应的配额,否则是更新配额。
45 | [x] 提供更新服务的后台,目前仅支持修改端口(增加、删除、修改)
46 | [x] 搭建Gitlab ci,在m6 test上测试yce代码推送到打镜像成功.不知道什么test上gitlab runner访问的仓库地址是127.0.0.1,而服务在223上,所以启动了docker nginx 做了代理转发
47 |
48 | 20161212
49 |
50 | [x] 调研测试工具,没有找到合适快速上手的
51 | [x] 调研iris的插件使用方法,还在研究中
52 | [x] YCE需求总结、整理
53 | [x] 重新部署yce到master
54 |
55 | 20161214
56 |
57 | [x] 人肉测试检查bug,尤其是环境变量处
58 | [x] 为FindNewRs()和镜像管理处添加nil返回结果的处理,目前仅支持错误信息提示
59 | [x] 检查其他bug,维护特性和bug表,并提交处理
60 |
61 | 20161215
62 |
63 | [x] 检查、整理bug
64 | [x] 上线mingzong.liu的netpay应用
65 | [x] 上线m6的新yce
66 |
67 | 20161219
68 |
69 | [x] 编写测试用例(用户的主要操作流:从模板创建,5个用户故事,文档,uml和测试数据)
70 | [ ] 编写测试用例(用户的异常操作流)
71 | [x] 帮助dawei完成前端的gitlab-ci流
72 | [x] 帮助mingzong.liu更新3个应用,又将frontend-hessian停机(删除实例,服务保留)
73 |
74 | 20161220
75 |
76 | [x] 解决缓存的问题
77 | [x] 编写新的deployment列表文档和代码,添加了svcName显示
78 | [x] 测试172上的改bug版,并发布到m6
79 | [x] 翻译K8s CRI blog
80 |
81 | 20161221
82 |
83 | [x] 报销单
84 | [x] 审校K8s CRI blog译文
85 | [x] 帮mingzong.liu更新netpay-hessian和installment-hessian
86 | [x] OKR自评
87 | [x] 编写重启实例后台
88 | [x] 帮mingzong.liu再次更新installment-hessian
89 | [x] 帮mingzong.liu三次更新installment-hessian
90 |
91 | 20161222
92 |
93 | [x] 协助开发Feature-0022
94 | [ ] 调研testify, FSM
95 |
96 | 20161223
97 |
98 | [x] 开发Feature-0024
99 | [ ] 测试testify, 编写测试demo
100 |
101 | 20161226
102 |
103 | [x] 为mingzong.liu更新installment 3次
104 | [x] 整理测试自查列表并推广
105 | [x] 给后台每个ReadJSON添加对应的log.Error
106 | [x] 测试新版本的超卖
107 | [x] 修改apis.sh
108 |
109 | 20161227
110 |
111 | [x] 整理apis.sh结果
112 | [x] 为mingzong.liu更新installment
113 | [x] 整理APIv2
114 | [x] 测试
115 |
116 | 20161228
117 |
118 | [x] 为mingzong.liu更新installment 和 netpay: 3次
119 | [x] 为mingzong.liu上生产内测installment 和 netpay
120 | [x] 更新yce 0.6.2
121 |
122 |
123 | 20161229
124 |
125 | [x] 填表
126 | [x] 跟lu.hou交接CI/CD
127 | [x] 测试yce v0.6.2,编写Release Note
128 | [x] netpay电信和b28上production
129 | [x] 编写image sync agent
130 |
--------------------------------------------------------------------------------
/DailyWork/Feburary.md:
--------------------------------------------------------------------------------
1 | 20170204
2 |
3 | [x] 整理yce的新需求
4 | [x] 检查各个数据中心的yce版本差异: master(dev): 0.6.3, m6(qa): 0.6.3, dianxin(prod): 0.6.3, shijihulian-b28(prod): 0.6.3
5 | [x] 多数据中心逻辑检查
6 | [x] 为生产两个yce准备受限用户(分离了同步镜像)的SQL,在siAgent-normal/sql/only-restricted-user/下
7 |
8 | 20170206
9 |
10 | [x] 多数据中心逻辑检查:更新组织时为组织添加新的数据中心支持
11 | [x] 多数据中心逻辑检查:更改应用返回结果结构,JSON设计
12 | [x] 分配Microservice on K8s and Docker翻译
13 | [x] 讨论本期任务
14 |
15 | 20170207
16 |
17 | [x] 多数据中心逻辑检查:更改应用返回结果结构,代码修改
18 | [ ] 帮助上线frontend-netpay-hessian 到生产环境
19 | [x] golang sort包学习
20 |
21 | 20170208
22 |
23 | [x] 多数据中心逻辑检查:更改服务返回结果结构,代码修改
24 | [x] 多数据中心文档更新:应用列表及详情(包含服务)、服务列表及详情
25 |
26 | 20170209
27 |
28 | [x] 多数据中心逻辑检查:健康检查livenessprobe controller编写
29 | [x] 多数据中心逻辑检查:模板排序
30 | [x] 多数据中心逻辑检查:更新节点详情controller
31 | [x] 多数据中心逻辑检查:为deployment/service controller添加defaultSort()方法
32 |
33 | 20170210
34 |
35 | [x] 用户权限更新文档
36 | [x] 用户权限更新navList及代码
37 |
38 | 20170213
39 |
40 | [x] 用户权限user初始化user/init, user列表/user的controller 及 doc
41 | [x] 更新权限的设计
42 |
43 | 20170214
44 |
45 | [x] 新的权限设计文档和代码
46 | [x] 跟马睿安排golang
47 |
48 | 20170215
49 |
50 | [x] 服务列表bug排查,修复了pointer问题,更新了对多数据中心的支持
51 | [x] 应用列表同样的pointer问题修复
52 |
53 | 20170216
54 |
55 | [x] 多数据中心小bug修复,联调
56 | [x] ReleaseNote编写
57 | [x] master更新
58 |
59 | 20170217
60 |
61 | [x] 前后联调
62 | [x] ReleaseNote编写
63 | [x] master更新,QA,生产
64 |
65 | 20170220
66 |
67 | [x] 确定0.6.5的需求
68 | [x] 研究Watch()机制
69 |
70 | 20170221
71 |
72 | [x] 整理数据库ER图
73 | [x] 编写service健康检查,修改pod健康检查
74 | [x] 前后联调数据中心dcIdList导入模板时的bug
75 |
76 | 20170222
77 |
78 | [x] 调试昨天dcIdList的bug
79 | [x] Dell SDN Share about Big Switch
80 |
81 | 20170223
82 |
83 | [x] 联调及测试
84 | [x] QA, Prod
85 |
86 | 20170224
87 |
88 | [x] fix liveness bug
89 | [x] done new check logic
90 | [x] sync queue dedup
91 | [x] sort by name, deployment, template, service
92 | [x] fix oldRs bug with empty PodList
93 | [ ] errno check
94 |
95 | 20170227
96 |
97 | [x] errno check : 30%
98 | [x] watch + cache: 50%
99 |
100 | 20170228
101 |
102 | [x] datasource doc
103 | [x] datasource create, list controller
104 |
105 |
--------------------------------------------------------------------------------
/DailyWork/January.md:
--------------------------------------------------------------------------------
1 | 2
2 | 170103
3 |
4 | [x] 整理需求和bug完成情况
5 | [x] 帮mingzong.liu上线frontent-hessian到qa
6 | [x] 编写sync agent using websocket
7 |
8 | 20170104
9 |
10 | [x] qa培训
11 | [x] 训练营作业
12 | [x] 梳理项目
13 | [x] 继续编写sync agent using websocket
14 |
15 | 20170105
16 |
17 | [x] qa培训
18 | [x] sync agent编写
19 | [x] 为navList添加同步镜像,仅更新27
20 |
21 | 20170106
22 |
23 | [x] Websocket学习wuhao
24 | [x] 为navList添加operation,仅更新27
25 | [x] 按新的navList更新后台,
26 | [x] 更新usercontroller,create和update,
27 | [x] iris websocket返回粘连
28 |
29 | 20170109
30 |
31 | [x] 编写同步镜像agent
32 | [x] 前后联调
33 |
34 | 20170110
35 |
36 | [ ] 前后联调(bug,feature)
37 | [x] 多数据中心管理,手动创建组织,发现bug
38 | [ ] K8s major release
39 | [x] 帮mingzong.liu更新frontend QA,不需要手动build,直接更新镜像
40 | [ ] 研究iris websocket,继续解决粘连问题
41 |
42 | 20170111
43 |
44 | [x] 研究iris websocket,继续解决粘连问题
45 | [x] 雏鹰培训
46 | [x] 帮mingzong.liu上线frontend-installment-hessian到生产(兆维和b28)
47 | [x] rewrite siAgent using normal router
48 | [ ] 整理多数据中心问题
49 |
50 | 20170112
51 |
52 | [x] rewrite siAgent
53 |
54 | 20170113
55 |
56 | [x] rewrite siAgent using normal yce controller as proxy
57 |
58 | 20170116
59 |
60 | [x] 测试siAgent代码,前后联调
61 | [x] 准备golang分享
62 | 20170117
63 |
64 | [x] 前后联调
65 | [x] 准备golang分享
66 |
67 | 20170118
68 |
69 | [ ] 准备golang分享
70 |
71 | 20170119
72 |
73 | [x] yce讨论上期和下期功能
74 | [x] 更新master,分离admin和normal SQL
75 | [x] k8s 梳理
76 | [x] QA更新
77 |
78 | 20170120
79 |
80 | [ ] k8s梳理
81 | [ ] yce梳理
82 | [ ] 译文校对
83 |
84 |
--------------------------------------------------------------------------------
/DailyWork/March.md:
--------------------------------------------------------------------------------
1 | 20170301
2 |
3 | [x] template表重新设置索引
4 | [x] 讨论数据源文件原型
5 | [x] 数据源文件controller编写
6 |
7 | 20170302
8 |
9 | [x] 添加数据源文件-应用映射关系表
10 | [x] 更新发布应用controller
11 | [x] 利用cache更新应用list
12 |
13 | 20170303
14 |
15 | [x] 测试数据源文件相关controller和user story
16 |
17 | 20170306
18 |
19 | [x] 借助Cache刷新应用列表
20 |
--------------------------------------------------------------------------------
/DailyWork/November.md:
--------------------------------------------------------------------------------
1 | November
2 | =========
3 | 20161124
4 |
5 | [x] 利用placeholder修改nodeport的为批量插入, 但是会导致MySQL注入的风险
6 | [ ] 跟yong.li-1,hong.guo,ming.yan讨论容器云上线方法,发现了三个问题待讨论:
7 | [ ] 组织和用户的对应。是用户在组织上,还是组织在用户上?是否多对多
8 | [ ] 取消namespace创建时的limitrange,确定pod的resource是limits还是request及对应的值
9 | [ ] nodeport如何管理
10 | [x] 给rui.chen升级yce。具体来说:
11 | [x] 升级镜像
12 | [x] 安装TunnelBlick后登VPN更新mysql。yong.li-1的TunnelBlick不好使,重新下载了新版的。湖南的mysql里datacenter的host和port有重复,为了添加唯一约束,故将其Host和port均置为0。另外发现SQL脚本里没有给datacenter的name字段增加唯一约束,所以需要检查其他的机器是否已经添加了约束。
13 | [x] 修改了文档中一处错误,给deployment的pod template里添加metadata的labels字段
14 | [x] 尝试了GDB调试golang程序
15 | [x] 检查其他机器是否添加了datacenter表的name的唯一约束。均有,除了B28没权限检查。
16 | [ ] 给gitlab里保存的sql添加相应的sql语句
17 |
18 | 20161125
19 |
20 | [x] 利用placeholder修改nodeport的为批量插入和批量软删(update),需要用到mysql的insert on duplicate key update的batch
21 | [x] 研究每次前端更新后都需要刷新缓存的原因,但是问题没有能够复现。不确定是否解决。了解到了HTTP关于缓存控制的响应头和相关的状态码。
22 | [x] 学习了ElasticSearch的基本知识。它可以被看作是数据库。
23 |
24 | 20161128
25 |
26 | [x] 将github上最新的代码(批量插入/删除)迁回gitlab,并测试成功
27 | [ ] 整理MySQL注入的内容
28 | [x] 重写批量插入/删除的代码,解决MySQL注入的隐患
29 |
30 | 20161129
31 |
32 | [ ] 研究K8s的resource与limits
33 | [ ] 在master上通过ycetestplace/maxwell/current/tmpdeploy下的update.sh脚本生成镜像。每次需要从本地将frontent和backend的代码打包后传到master
34 | [x] 修改了新文档的目录指向
35 | [x] 修复bug,重新部署yong.li-1部署的世纪互联和电信
36 | [x] 整理表单的正则
37 |
38 | 20161130
39 |
40 | [x] 为test安装了Docker 1.11.2,编写了wiki,安装了go1.7.3,配置了img.reg.3g:15000的证书,导入了ubuntu-v3的基础镜像
41 | [x] 研究iris的中间件的使用
42 | [ ] 编写中间件,用来校验用户提交的JSON。有错误,正在调试
43 |
44 |
--------------------------------------------------------------------------------
/DailyWork/overview.md:
--------------------------------------------------------------------------------
1 | DailyWork
2 | =========
3 | In case of sometimes I couldn't figure out what I did or how does it works.
4 |
--------------------------------------------------------------------------------
/DesignPattern/Chain-of-Responsibility/Chain-of-responsibility.md:
--------------------------------------------------------------------------------
1 | 职责链模式
2 |
--------------------------------------------------------------------------------
/DesignPattern/Composite/composite.md:
--------------------------------------------------------------------------------
1 | 组合模式
2 |
--------------------------------------------------------------------------------
/DesignPattern/Demeter/demeter.md:
--------------------------------------------------------------------------------
1 | Law of Demeter
2 | --------------
3 |
--------------------------------------------------------------------------------
/DesignPattern/Factory/factory.md:
--------------------------------------------------------------------------------
1 | 工厂模式
2 |
--------------------------------------------------------------------------------
/DesignPattern/Singleton/car.go:
--------------------------------------------------------------------------------
1 | package main
2 | import (
3 | "fmt"
4 | "sync"
5 | "time"
6 | )
7 |
8 |
9 | type MyCar struct {
10 | Brand string
11 | Type string
12 | Price string
13 | }
14 |
15 |
16 | var carInstance *MyCar
17 | var once sync.Once
18 |
19 |
20 | func MyCarInstance() *MyCar{
21 | return carInstance
22 | }
23 |
24 | func NewCar() *MyCar {
25 | once.Do(func() {
26 | carInstance = &MyCar{Brand: "LandRover", Type: "RangeRover", Price: "$4,0000"}
27 | })
28 | return carInstance
29 | }
30 |
31 | func (m *MyCar)Run() {
32 | fmt.Println(m.Brand)
33 | delay := 100
34 | for {
35 | for _, r := range `-\|/` {
36 | fmt.Printf("\r%c", r)
37 | time.Sleep(time.Duration(delay) * time.Millisecond)
38 | }
39 | }
40 | }
41 |
42 | func (m *MyCar)Info() {
43 | fmt.Println(m.Brand)
44 | }
45 |
46 |
47 | func main() {
48 | /*
49 | benz := new(MyCar)
50 | benz.Brand = "Benz"
51 | benz.Type = "ML550"
52 | benz.Price = "$25,000"
53 | // benz.Run()
54 | benz.Info()
55 |
56 | toyota := new(MyCar)
57 | toyota.Brand = "Toyota"
58 | toyota.Type = "Prado"
59 | toyota.Price = "$5,000"
60 | // toyota.Run()
61 | toyota.Info()
62 | */
63 | // landrover := MyCarInstance()
64 | // landrover.Info()
65 |
66 |
67 | //aaa := MyCarInstance()
68 | //aaa.Info()
69 |
70 |
71 | which := NewCar()
72 | which.Info()
73 |
74 | what := NewCar()
75 | what.Info()
76 |
77 | aaa := MyCarInstance()
78 | aaa.Info()
79 | }
80 |
--------------------------------------------------------------------------------
/DesignPattern/Singleton/singleton.md:
--------------------------------------------------------------------------------
1 | ### 单例模式
2 | _______________________________
3 |
4 | ####什么是单例模式
5 |
6 | 单例模式,又称为单件模式,英文全称为Singleton Pattern。如果用一句话描述什么是单例模式,那么可以这样说:单例模式保证了某对象实例的全局唯一。在该类没有对象实例的时候,会构造一个新实例,以后每次调用构造函数的时候,将仅返回第一次创建的实例。
7 |
8 | 举个“栗子”:对于带有图形界面的操作系统,我曾经尝试过同时将两个鼠标连接上,原以为屏幕上会出现两个鼠标指针,但是没有,而是这两个鼠标都可以控制这个指针,同一时刻仅有一个生效。鼠标指针在图形界面上仅可以有一个,它将在操作系统第一次检测到鼠标接入的时候创建,后面不管接入多少个鼠标,也只能操作这一个指针对象。这样做的好处是显而易见的:避免了有些调皮捣蛋的“熊孩子”拿两个鼠标一个往左滑一个往右滑而把电脑折腾疯的尴尬。
9 |
10 | 上面的例子不够贴切,重新举例:例如在windows里,资源管理器(explorer.exe)和任务管理器只能开一个。又例如在iOS系统里,微信、QQ等应用APP都只允许开一个。不是这些软件设计成了单例模式,而是操作系统在启动的时候按照单例模式的方式获取了实例。
11 |
12 | 讲真,单例模式在实际的软件开发中有很多应用场景:线程池、缓存、对话框、处理偏好设置和注册表对象、日志对象、充当打印机、显卡等设备的驱动程序的对象等,如果构造出多个实例,可能会导致程序行为异常、资源过量使用、结果不一致等问题 。
13 |
14 | 当然,可以利用全局变量来解决这些问题,但全局变量是在程序开始时就创建好的,假如它很耗费资源,并且本次程序运行并没有用到它,那就造成了资源浪费。单例模式保证可以在需要时才创建对象。
15 |
16 | 以Java程序为例,公有类可以被多次实例化,或者不是公有类,同一个包内的类也可以实例化它多次。假设公有类里的构造方法声明为私有,如:
17 |
18 |
19 | ```
20 | public Car {
21 | private Car() {}
22 | }
23 |
24 | ```
25 |
26 | 它看起来有点奇怪:如果想要构造一个实例,必须使用这个私有的构造函数,但是使用这个私有方法又必须先有一个实例。这看起来很矛盾。那么如果是下面这样呢?
27 |
28 |
29 | ```
30 | public Car {
31 | private Car() {}
32 | public static Car getInstance() {
33 | return new Car();
34 | }
35 | }
36 |
37 | ```
38 |
39 | 这样要想构造一个实例,可以利用静态方法getInstance(),它会帮我们返回想要的新实例:```mybenz = Car.getInstance();```。下面是单例模式的经典实现:
40 |
41 | ```
42 | public Car {
43 | // the only instance
44 | private static Car uniqInstance
45 |
46 | private Car() {}
47 | public static Car getInstance() {
48 | if (uniqInstance == NULL ) {
49 | uniqInstance = new Car()
50 | }
51 | return uniqInstance
52 |
53 | }
54 | }
55 |
56 | ```
57 |
58 |
59 | 单例模式确保一个类只有一个实例,并提供一个全局的访问点,它几乎可以说是所有设计模式的类图中最简单的,它的类图上仅有一个类。
60 |
61 |
62 | ####进一步思考
63 | 假设有多线程调用了getInstance(),很可能是这样的场景,某一个getInstance()已经创建了实例,但未完成,另一个getInstance也去创建了实例,仍会造成多个实例的问题。
64 |
65 | 可以采用同步方法来解决这个问题,即将getInstance()利用synchronized进行修饰:
66 |
67 | ```
68 | public static synchronized Car getInstances(){}
69 |
70 | ```
71 |
72 | 这样就迫使每个线程在进入这个方法之前,要先等别的线程离开该方法。但这又引入了新的问题:只有在第一次执行该方法的时候需要同步,其他时候是不需要的。
73 |
74 | 有这样一些选择:
75 |
76 | 1. 如果getInstance()的性能对应用不是很关键,可以略过这点。
77 | 2. 如果应用程序总是创建并使用单例,可以使用“急切”创建实例,而不用延迟实例化的做法。实例会在静态初始化的时候创建,下面的代码还保证了线程安全。
78 |
79 | ```
80 | public class Car() {
81 | private static Car uniqInstance = new Car();
82 | private Car() {}
83 | public static Car getInstance() {
84 | return uniqInstance;
85 | }
86 | }
87 | ```
88 |
89 | 3. 利用“双重检查加锁”,首先检查实例是否创建,如果没有才去同步。
90 |
91 | ```
92 | public class Car() {
93 | private volatile *static Car uniqInstance;
94 | private Car() {}
95 |
96 | public static Car getInstance() {
97 | if (uniqInstance == NULL) {
98 | synchronized (Car.class) {
99 | if (uniqInstance == NULL) {
100 | uniqInstance = new Car();
101 | }
102 | }
103 | }
104 | return uniqInstance;
105 | }
106 | }
107 |
108 | ```
109 |
110 |
111 | ####golang与单例模式
112 |
113 | 在利用golang完成一个httpClient的设计的时候,需要用到单例模式,可以这样考虑:因为golang没有类的概念,但是可以给结构体指派方法,于是创建一个全局变量,标识将要创建的唯一实例,利用sync.Once的一次性,就可以实现单例模式:
114 |
115 | ```
116 | var carInstance *MyCar
117 | var once sync.Once
118 |
119 | func NewCar() *MyCar {
120 | once.Do(func() {
121 | carInstance = &MyCar{Brand: "LandRover", Type: "RangeRover", Price: "$4,0000"}
122 | })
123 | return carInstance
124 | }
125 |
126 |
127 | ```
128 |
129 |
130 |
131 | ####References:
132 |
133 | 1. "Head Fisrt 设计模式"
134 | 2. github.com/lth2015/
135 |
136 |
--------------------------------------------------------------------------------
/DesignPattern/State/state.md:
--------------------------------------------------------------------------------
1 | 状态模式
2 |
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-1.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-10.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-11.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-12.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-14.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-15.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-16.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-2.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-3.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-4.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-5.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-6.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-7.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-8.png
--------------------------------------------------------------------------------
/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Achieving CI and CD With Kubernetes /achievingcicd-9.png
--------------------------------------------------------------------------------
/EnTechDoc/How to Calculate Kubernetes Cost Savings/cost-reduction-projects1-e1371369693372.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/How to Calculate Kubernetes Cost Savings/cost-reduction-projects1-e1371369693372.jpg
--------------------------------------------------------------------------------
/EnTechDoc/How to Calculate Kubernetes Cost Savings/cut-costs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/How to Calculate Kubernetes Cost Savings/cut-costs.jpg
--------------------------------------------------------------------------------
/EnTechDoc/How to Calculate Kubernetes Cost Savings/luh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/How to Calculate Kubernetes Cost Savings/luh.png
--------------------------------------------------------------------------------
/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/Security-diagrams.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/Security-diagrams.png
--------------------------------------------------------------------------------
/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/backinbiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/backinbiz.png
--------------------------------------------------------------------------------
/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/hacked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/hacked.png
--------------------------------------------------------------------------------
/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/welcome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Increasing Attacker Cost Using Immutable Infrastructure/welcome.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/README.md:
--------------------------------------------------------------------------------
1 | Install Kubernete 1.4.0 on Ubuntu 16.04
2 | ===========================================================
3 |
4 | #### 1. Installing kubelet and kubeadm on your hosts
5 | -----------------------------------------------------------
6 |
7 | ```bash
8 | # curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
9 |
10 | # cat < /etc/apt/sources.list.d/kubernetes.list
11 | deb http://apt.kubernetes.io/ kubernetes-xenial main
12 | EOF
13 |
14 | # apt-get update
15 |
16 | # apt-get install -y docker.io kubelet kubeadm kubectl kubernetes-cni
17 | ```
18 |
19 | #### 2. Initializing your master
20 | -----------------------------------------------------------
21 |
22 | ```bash
23 | # kubeadm init
24 | ```
25 |
26 | ```bash
27 | # kubectl taint nodes --all dedicated-
28 | ```
29 |
30 | #### 3. Joining your nodes
31 | -----------------------------------------------------------
32 |
33 | ```bash
34 | # kubeadm join --token
35 | ```
36 |
37 | #### 4. Installing a pod network
38 | -----------------------------------------------------------
39 |
40 | ```bash
41 |
42 | # kubectl apply -f https://git.io/weave-kube
43 | ```
44 |
45 | #### 5. Installing add-ons
46 | -----------------------------------------------------------
47 |
48 | ##### 5.1 Install heapster
49 | -----------------------------------------------------------
50 |
51 | ```bash
52 | # git clone https://github.com/lth2015/heapster.git
53 |
54 | # cd heapster/deploy
55 |
56 | # ./kube.sh
57 | ```
58 |
59 |
60 | ##### 5.2 Install heapster
61 | -----------------------------------------------------------
62 |
63 | ```bash
64 | # kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml
65 | ```
66 |
67 | ##### 5.3 Watch the process of the Insatallation
68 | -----------------------------------------------------------
69 |
70 | ```bash
71 | # watch "kubectl get pods --namespace=kube-system"
72 | ```
73 |
74 | #### (Optional) Deploy a mircoservice demo
75 | -----------------------------------------------------------
76 |
77 | ```bash
78 | # git clone https://github.com/microservices-demo/microservices-demo
79 |
80 | # kubectl apply -f microservices-demo/deploy/kubernetes/manifests
81 | ```
82 |
83 |
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/dash pod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/dash pod.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/kubeadm init.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/kubeadm init.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/kubectl applay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/kubectl applay.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/kubectl taint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/kubectl taint.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/maxresdefault.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/maxresdefault.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/nodeport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/nodeport.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/socks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/socks.png
--------------------------------------------------------------------------------
/EnTechDoc/Install Kubernetes 1.4.0/wave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Install Kubernetes 1.4.0/wave.png
--------------------------------------------------------------------------------
/EnTechDoc/Kubernete 1.6 release/README.md:
--------------------------------------------------------------------------------
1 | 写在升级Kubernetes到1.6之前
2 | ==================================
3 |
4 | > 简介:
5 | > 最近我们的团队正在制定升级生产环境*Kubernetes*集群的计划,今天*Kubernetes*官方正式发布了ReleaseNote,重点强调了一些注意事项。希望对同样有升级*Kubernetes 1.6*计划的朋友有所帮助。
6 |
7 |
8 | ### ETCD集群备份
9 | ------------------------
10 |
11 | 在更新到1.6之前,强烈建议您备份ETCD集群中的数据。请查阅您正在使用的安装工具(*kargo*, *kops*, *kube-up*, *kube-aws*, *kubeadm*)以获得具体建议。
12 |
13 | *Kubernetes 1.6*鼓励使用*ETCD 3.0*,从*ECTD 2.0*切换到*ETCD 3.0*涉及不同的存储引擎之间的数据的完全迁移。在从*ETCD 2.0*-->*ETCD 3.0*迁移期间,您必须停止*API Server*,防止向*ETCD*集群中写入数据。*HA*的方案目前无法使用官方的*Kubernetes*工具进行迁移。
14 |
15 | 如果使用*ETCD 3.0*,*Kubernetes 1.6*也默认采用*protobuf*编码。这种变化是不可逆的。如果要回滚,**您必须使用*protobuf*/*ETCD 3.0*切换之前的数据进行备份还原,并且自备份以来的数据更改都会丢失**。由于*Kubernetes 1.5*不支持*protobuf*编码,如果升级到*protobuf*后回滚到*1.5*版本那么,您仍需从切换之前的备份中恢复,同样,自转换*protobuf*之后的任何数据更改都将丢失。转换到*protobuf*后,您应该在验证*Kubernetes*集群能够正确工作之后再投入生产使用。
16 |
17 |
18 | 备份是一个很好的预防措施,特别是在升级的过程中。此次升级过程有多个已知的问题,唯一的应对方法就是从备份中还原。
19 |
20 |
21 |
22 | #### *1.6*的主要更新和发布主题
23 | ------------------------
24 |
25 | * 通过使用*ETCD 3.0*, *Kubernetes*集群现在默认支持5000个节点。
26 |
27 | * 基于角色的访问控制(*RBAC*)升级到*Beta*版,并为控制平面、节点、控制器等组件定义了默认的安全角色。
28 |
29 | * *kubeadm*的集群引导工具升级到了*Beta*版,亮点:所有的通信都通过TLS进行。
30 |
31 | * 授权(*Authorzation*)插件可以有*kubeadm*安装,包括了新的*RBAC*默认的设置。
32 |
33 | * 引导令牌系统现在允许令牌的管理和过期
34 |
35 | * *kubefed*联邦引导工具现在也升级到了*Beta*版。
36 |
37 | * 现在*Kubernetes*与容器运行时的交互通过*CRI*接口进行,这使*kubelet*与*container runtime*集成更加容易。*Docker*仍然是通过*Docker-CRI*(*Beta*版)。
38 |
39 | * 多种调度相关的特性已经升级到*Beta*版:
40 |
41 | * 您现在可以同时使用多种调度器。
42 |
43 | * *Node*和*Pod*现在支持亲和性和反亲和性。
44 |
45 | * 高级的调度可以使用污点(*taint*)和耐受(*toleration*)特性。
46 |
47 | * 当一个节点有问题时,您可以指定(每个*Pod*)*Pod*在这个节点上的停留时间。
48 |
49 | * 多种存储相关的特性升级到了*GA*版:
50 |
51 | * *StorageClass*预先安装并在*Azuer*, *AWS*, *GCE*, *OpenStack*和*vSphere*上设置为默认值。
52 |
53 | * 可配置*Dynamic Provisioning*和*StorageClass*。
54 |
55 | * 现在可以通过滚动升级来更新*DaemonSet*。
56 |
57 |
58 | #### 更新细节
59 | ------------------------
60 |
61 | 请参考《容器时代》关于*Kubernetes 1.6*新特性的详细介绍。
62 |
--------------------------------------------------------------------------------
/EnTechDoc/Kubernete 1.6 release/itemeditorimage_58d95eefae65c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Kubernete 1.6 release/itemeditorimage_58d95eefae65c.png
--------------------------------------------------------------------------------
/EnTechDoc/Kubernetes 1.5 release/t:
--------------------------------------------------------------------------------
1 |
2 |
3 | Alpha
4 | Alpha
5 | Alpha
6 | Alpha
7 | Alpha
8 | Alpha
9 | Alpha
10 | Alpha
11 | Alpha
12 | Alpha
13 | Alpha
14 | Alpha
15 | Beta
16 | Beta
17 | Beta
18 | Beta
19 | Beta
20 | Beta
21 | Beta
22 | Beta
23 | Beta
24 | Stable
25 | Stable
26 | Stable
27 | Stable
28 | Stable
29 |
--------------------------------------------------------------------------------
/EnTechDoc/Kubernetes – Stupid Human mistakes going to prod/README.md:
--------------------------------------------------------------------------------
1 | Kubernetes——在生产过程中容器犯的愚蠢的人为错误
2 | ====================================================
3 |
4 | ### 作者
5 | ----------------------------------------------------
6 |
7 | Where DevOps, Tech and Life collide………..@devoperandi
8 |
9 | http://www.devoperandi.com/kubernetes-stupid-human-mistakes-going-to-prod/
10 |
11 | #### 正文
12 | ----------------------------------------------------
13 |
14 | 正如任何新的平台、应用或者服务,学习什么是不该做的机会是永远存在的,当他被以正确的方式使用,很多人将为此收益。因此,事不宜迟,这里我们列举了在生产过程使用kubernetes的一些建议
15 |
16 | * 灾难恢复测试应该有计划的被执行
17 |
18 | * 不要让版本发生真正快速的、次要的改变
19 |
20 | * 不要让任何人做
21 |
22 | * Kube-DNS资源是重要且必要的
23 |
24 | * 要充分沟通
25 |
26 | * ETCD……最好不要管他
27 |
28 | * init 0 不是一个"重启"服务的好命令
29 |
30 | 我想你会认识到这些所有的问题的原因最后都定位在人。我们正在等待最大的灾难发生,正如我们所说的,
31 |
32 |
33 |
--------------------------------------------------------------------------------
/EnTechDoc/Microscaling MicroBadger/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Microscaling MicroBadger/README.md
--------------------------------------------------------------------------------
/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/0-JZg9Fa9GYYTFbMNU.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/0-JZg9Fa9GYYTFbMNU.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/582399f13af732000b000001-Driving-devops.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/582399f13af732000b000001-Driving-devops.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/Column_1_PROGRAMMABLE_INFRASTRUCTURE.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/Column_1_PROGRAMMABLE_INFRASTRUCTURE.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/README.md:
--------------------------------------------------------------------------------
1 | 在生产环境中使用Kubernetes部署可编程的基础设施
2 | ======================================================
3 | 原文链接:[Programmable Infrastructure in Production with Kubernetes](https://medium.com/@anne_e_currie/programmable-infrastructure-in-production-with-kubernetes-5d236cceb91d#.5y13rq124)
4 |
5 | 
6 |
7 |
8 | > 这周我们聊聊自动化的与可编程的基础设施并且列举一个真实的例子。我们将继续使用*Mircobadger*服务,通过我们自己定义的调度器实现部分自动化。我们调度程序的代码是开源的,可以从[https://github.com/microscaling/microscaling](https://github.com/microscaling/microscaling)上获取。它可以使用*Kubernetes*的*Deployment API*来扩展。
9 |
10 | ### *Microbadger*做什么
11 | ------------------
12 |
13 | *Microbadger*是个*SaaS*服务,可以让您浏览*Docker Hub*上的任何公共镜像的元数据。您提供镜像的名称,我们会从*Docker Hub*获取数据,整理并显示出来。
14 |
15 | ### *Microbadger*如何工作
16 | ------------------
17 |
18 | 想象一下,用户请求一个尚未缓存的新镜像,有很多我们需要获取和显示的数据。虽然*Docker Hub*在大多数请求时都很快的返回,但某些时候却需要很长时间,尤其是进行获取镜像深度信息(*Inspect*)的时候,比如获取下载镜像的大小和向工程师展示镜像的分层信息。
19 |
20 | 我们决定尽快显示内容以保持客户的使用体验,只要涉及缓慢的过程,我们可以通过分开数据请求和处理来加速这个过程。
21 |
22 | 所有的内容都展示在下图的橘色框内:
23 |
24 | 
25 |
26 | * 容器化,无状态化,并在*Kubernetes*或*AWS*集群中编排
27 |
28 | * 一个*AWS*服务SQS,用户队列服务
29 |
30 | 它主要由三个部分组成:
31 |
32 | * *API*服务(*Go*)处理来自网络的*API*请求,并提供缓存的内容,或者在检查队列上删除新数据的请求。*Web*客户端轮询*API*直到请求完全完成。
33 |
34 | * 一个单线程执行*Inspector*服务(*Go*),轮询*Inspection*队列获取新的任务,从*Docker Hub*请求快速数据。它处理和缓存响应,并且还会把较慢数据的请求放在*Size*队列上。
35 |
36 | * 一个单线程执行*Size*服务(*Go*),轮询*Size*队列获取新的任务和请求,从*Docker Hub*请求较慢的数据,处理和缓存请求。
37 |
38 | 每个*Go*程序都是单线程的,我们通过运行更多的*Pod*来弹性扩展,每个Pod中只包含一个容器。*Size*服务和*Inspector*服务共享物理的基础设施,它们都运行在相同的*AWS*的基础设施和节点上。
39 |
40 | 起初,我们在两个*AWS T2*实例上运行10个*Inspector*的*Pod*和10个*Size*的*Pod*,虽然容易,但有些乏味,过度的配置超出了大多数时间处理峰值的需求。我们可以不可以使用一个可编程的基础设施,来帮我们节省一些成本?
41 |
42 | ### *Microbadger*主要特性
43 | ------------------
44 |
45 | * *API*服务至关重要,所以要能过快速的弹性扩展
46 |
47 | * *Size*服务也是至关重要的。我们通过使用云队列服务来处理,这是非常昂贵的。*Size*队列服务用于保存状态,使*Kubernetes*集群无状态,这让应用更容易配置。
48 |
49 | * *Inspector*服务对于新的镜像是迫切需要的,这对于我们宝贵的新用户是至关重要的。
50 |
51 | *Size*服务不是那么紧急——如果它一段时间不可用,*Microbadger*将不会很好,但是仍然可以正常工作。
52 |
53 | ### 理想的可编程基础设施
54 | ------------------
55 |
56 | 
57 |
58 | 这个相当标准的架构非常适合一可编程的方式进行优化和演进。为此,*Microbadger*使用我们为*Kubernetes*自定义的调度器,它需要三个输入:
59 |
60 | * 需求度量,在这种情况下,我们使用了两个队列的长度
61 |
62 | * 高优先级服务(容器标识符),用于*Inspector*服务
63 |
64 | * 低优先级服务(容器标识符),用于*Size*服务
65 |
66 |
67 | 自定义的调度器只需创建*Inspector*服务的容器,直到满足主要的需求指标(*Inspector*未备份)。通过杀死*Size*服务的容器(记住他们共享相同的机器),从而释放空间。当*Inspector*队列长度下降是,自定义调度程序将关闭部分*Inspector*服务,并启动足够的*Size*服务的容器以保持*Size*服务恢复正常进行。
68 |
69 | 这种可编程的基础设施有几个很好的特性:
70 |
71 | * 它确保我们仅运行最少数量的服务,这将我们的昂贵的成本:SQS轮询操作较少了大约70%。
72 |
73 | * 它减少了我们大量使用的资源总量,这有可能在以后多租户集群中减少我们的账单。
74 |
75 | ### 背后的哲学
76 | ------------------
77 |
78 | 节省成本是好的,但是我们感兴趣的是理念的转变。在单一的应用中,所有这些组件都将在一个巨大的服务内部,这可能会在内部完成所有这些自定义的调度(监视内部队列和启动/停止线程)。我们需要将一个庞大的单体应用,拆分成微服务的应用。
79 |
80 |
81 | 我们将服务拆成微服务的原因:
82 |
83 | * 更加容易部署和管理,可以持续交付的小组件 + *API* + 小团队 + 减少冲突,这些可以与*Kubernetes*的滚动部署天然的结合。
84 |
85 | * 劳动分工,专业的人员提供专业的服务,可以提高第三方服务的质量和效率(例如:*SQS*服务)
86 |
87 | 然而,*Mircoservices*的缺点是失去了可以构建成一个整体的、无所不知的内部视图和控制,这通常意味着过度供应。现在,自定义的调度器和编排器,我们杜绝了过度供应的可能。
88 |
89 | *Mircoservices*可以是一个非常好的架构,使用我们自定义的调度器来获取资源,而无需重构我们的应用,这是非常好的!
90 |
--------------------------------------------------------------------------------
/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/architecture.png
--------------------------------------------------------------------------------
/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/new-architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Programmable Infrastructure in Production with Kubernetes/new-architecture.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/1.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/Access_Control_EA.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/Access_Control_EA.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/Cluster Role.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/Cluster Role.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/ClusterRoleBinding.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/ClusterRoleBinding.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/RBAC.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/RBAC.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/Role Binding.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/Role Binding.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/RoleBinding2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/RoleBinding2.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/roles-primary.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/roles-primary.jpg
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/secret.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/secret.png
--------------------------------------------------------------------------------
/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/training.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/Secure Your Kubernetes Clusters With RBAC/training.png
--------------------------------------------------------------------------------
/EnTechDoc/k8s-how-we-made-k8s-insanely-easy-to-install/README.md:
--------------------------------------------------------------------------------
1 | 我们是如何让K8s“巨易”安装的
2 | ----------
3 | 编者注:本文来自 Weaveworks的Head of Developer Experience——[Luke Marsden](https://twitter.com/lmarsden)。文中讲述了[SIG-Cluster-lifecycle](https://github.com/kubernetes/community/blob/master/sig-cluster-lifecycle/README.md)在一款可以简化Kubernetes安装的工具`kubeadm`上最近的工作。
4 |
5 | 我们之前收到用户的反馈说Kubernetes的安装非常困难,同时我们希望人们能够专注于编写优质的分布式应用而不用被基础设施所困扰。所以SIG-Cluster-lifecycle](https://github.com/kubernetes/community/blob/master/sig-cluster-lifecycle/README.md)近来一直在`kubeadm`上努力,`kubeadm`可以让Kubernetes的安装变得惊人的简单。
6 |
7 | 下列是Kubernetes集群安装的几个步骤,我们决定从第二步开始:
8 |
9 | 1. 准备(Provisioning):准备一些机器
10 | 2. 启动(Bootstrapping):在它们上面安装Kubernetes并且配置证书
11 | 3. 附件(Add-ons):安装必需的集群附件,如DNS和监控服务,Pod网络等。
12 |
13 | 我们早就预料到用户有各种各样准备机器的方式。
14 |
15 | 他们准备的机器可能来自不同的云服务商、私有云、裸金属甚至树莓派,并且通常有他们自己偏爱的自动化部署工具:Terraform、CloudFormation、Chef、Puppet、Ansible甚至用来启动裸金属的PXE等等。所以我们做了一个重要的决定:*kubeadmin 不准备机器(kubeadm would not provision machines)*。唯一的要求是它假设用户拥有一些[运行了Linux的机器](http://kubernetes.io/docs/getting-started-guides/kubeadm/#prerequisites)。
16 |
17 | 另外一个重要的限制是我们不想构建又一个“按部就班部署Kubernetes”的外部工具。因为现在已经有许多这样的外部工具了,而我们的目标定得更高。我们选择让Kubernetes核心自身变得更容易安装。幸运的是它的基础早就开始打了。
18 |
19 | 我们意识到如果让Kubernetes变得“巨易”手动安装,用户显然会知道怎样借助于其他工具来自动化安装。
20 |
21 | 所以执行[kubeadm](http://kubernetes.io/docs/getting-started-guides/kubeadm/)吧。它不需要任何基础设施依赖,也满足了上面的需求,易于使用,并且是易于自动化的。目前它是alpha版,工作方式如下:
22 |
23 | * 为你的Linux发行版安装Docker和官方的Kubernetes包
24 | * 选择一个机器作为master节点,运行`kubeadm init`
25 | * 它设置了控制面板,并且输出一条命令:`kubeadm join [...]`,包含了一个安全令牌。
26 | * 在每个选为从节点的机器上,运行上一步得到的`kubeadm join [...]`命令。
27 | * 最后安装一个pod网络,[Weave Net](https://github.com/weaveworks/weave-kube)是一个很好的起点。只需`kubectl apply -f https://git.io/weave-kube`即可安装。
28 |
29 | 快!你现在拥有了Kubernetes集群
30 |
31 |
32 | 可以看下面的视频,[QQ视频](), [Youtube](https://youtu.be/b_fOIELGMDY)
33 |
34 | 跟着[kubeadm getting started guid](http://kubernetes.io/docs/getting-started-guides/kubeadm/)来亲自尝试吧,并且在Github上给我们[反馈](https://github.com/kubernetes/kubernetes/issues/new),并@kubernetes/sig-cluster-lifecycle!
35 |
36 | 最后,我想要衷心感谢SIG-cluster-lifecycle的成员们,离开他们这些都无法实现。这里我只点到一小部分:
37 | * [Joe Beda](https://twitter.com/jbeda)让我们关注于给予用户方便
38 | * [Mike Danese](https://twitter.com/errordeveloper)在谷歌是一位传奇技术领导,并且总是知道发生了什么。Mike也不知疲倦地进行Code Review。
39 | * [Ilya Dmitrichenko](https://twitter.com/errordeveloper)是我在Weaveworks的同事,写了大部分kubeadm的代码,并且乐意帮助别人进行贡献。
40 | * [Lucas Kaldstrom](https://twitter.com/kubernetesonarm)来自芬兰,是组里最年轻的贡献者,并且在他学校数学考试的前夜仍然在合并PR。
41 | * [Brandon Philips](https://twitter.com/brandonphilips)和他在CoreOS的团队领导了TLS启动的开发,这是我们少不了的关键组件。
42 | * [Devan Goodwin](https://twitter.com/dgood)来自红帽,构建了Joe所想的JWS服务发现,整理了我们的RPM包。
43 | * [Paulo Pires](https://twitter.com/el_ppires)来自葡萄牙,支持我们外部的etcd,并且负责了其他很多零碎工作。
44 | * 以及许多其他的贡献者。
45 |
46 | 这真的是和这群可爱的人们共同完成的一项跨公司、跨时区的伟大成就。在SIG-cluster-lifecycle里还有很多要做的事情,如果你对这些挑战感兴趣,那么加入SIG吧,我们在期待跟你一同奋斗。
47 |
48 | 原文作者:[Luke Marsden](https://twitter.com/lmarsden),Head of Developer Experience at [Weaveworks](https://twitter.com/weaveworks).
49 | 原文链接:[How we made kubernetes easy to install](http://blog.kubernetes.io/2016/09/how-we-made-kubernetes-easy-to-install.html)
50 |
--------------------------------------------------------------------------------
/EnTechDoc/k8s-persistent-volumes/k8s-pv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/EnTechDoc/k8s-persistent-volumes/k8s-pv.png
--------------------------------------------------------------------------------
/EnTechDoc/kubefed/README.md:
--------------------------------------------------------------------------------
1 | Kubernetes 1.5新特性| 使用kubefed快速部署Kubernetes联邦
2 | ==========================================================
3 |
4 | Kubernetes 1.5包括一个名为*kubefed*的新命令行工具,来帮助您管理联邦。 *kubefed*帮助您部署一个新的Kubernetes联邦的控制面板,通过控制面板可以向现有联邦添加或删除集群。
5 |
6 | 本文主要介绍如何通过*kubefed*命令来管理联邦。
7 |
8 | 注意:kubefed是kubernetes1.5的新特性,还是alpha版。
9 |
10 | #### 1. 先决条件
11 | ---------------------
12 |
13 | 本文假设您有一个正在运行的Kubernetes集群。
14 |
15 | #### 2. 获取kubefed
16 | ---------------------
17 |
18 | 从[官网首页](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md)下载Kubernetes1.5或以上的Client压缩包(tar.gz)。将压缩包里的二进制文件解压到¥PATH下的某个目录中,并对这些二进制文件设置可执行权限。
19 |
20 | ```bash
21 | curl -O https://storage.googleapis.com/kubernetes-release/release/v1.5.0/kubernetes-client-linux-amd64.tar.gz
22 |
23 | tar -xzvf kubernetes-client-linux-amd64.tar.gz
24 |
25 | sudo cp kubernetes/client/bin/kubefed /usr/local/bin
26 |
27 | sudo chmod +x /usr/local/bin/kubefed
28 |
29 | sudo cp kubernetes/client/bin/kubectl /usr/local/bin
30 |
31 | sudo chmod +x /usr/local/bin/kubectl
32 | ```
33 |
34 | #### 3. 选择一个主机集群
35 | ------------------------------
36 |
37 | 您需要一个Kubernetes集群作为主要集群,主要集群联邦的控制面板。确保您在本地kubeconfig种具有与主要集群对应的kubeconfig条目。您可以通过运行一下命令来验证您是否具有所需的kubeconfig条目:
38 |
39 | ```bash
40 | kubectl config get-context
41 | ```
42 |
43 | 输出应包含与主要集群对应的条目,类似于以下内容:
44 |
45 | ```bash
46 | CURRENT NAME CLUSTER AUTHINFO NAMESPACE
47 | gke_myproject_asia-east1-b_gce-asia-east1 gke_myproject_asia-east1-b_gce-asia-east1 gke_myproject_asia-east1-b_gce-asia-east1
48 |
49 | ```
50 |
--------------------------------------------------------------------------------
/FruitCandy/box1.md:
--------------------------------------------------------------------------------
1 | 1. DCOS
2 | 2. Kubernetes ConfigMap
3 | 3. MySQL list
4 | 4. MySQL PrimaryKey/ForeignKey
5 | 5. Transfer Layer Security(TLS)
6 | 6. Entity-Relationship Graph(ER Graph)
7 | 7. Soft Route
8 | 8. Remote Procedure Call(RPC)
9 | 9. Object Oriented Programming(OOP)
10 | 10. Object Relation Mapping(ORM)
11 | 11. 在向git push代码的时候遇到一个奇怪的现象:仓库A可以成功上传,仓库B总是提示443 time out,原因不明,后来将remote origin 改为git@github.com:maxwell92/xxx.git的方式就神奇地好了。
12 | 12. golang处理json的时候有三个要注意的: 1. omitempty,2. `json:*""`*号处不能有空格 3.json对象指针
13 | 13. 在git push之后继续修改本地代码,结果发现改错了,需要回滚本地至上个版本,可以使用git reset命令,例如git reset --hard XXXXX,XXXX为某次提交的校验值。当然不建议强行回滚,还是采用温柔点的git reset HEAD^或git reset XXXX会比较好
14 | 14. url-rewrite, session管理
15 | 15. assert断言,从语言层面、数学层面的理解
16 |
--------------------------------------------------------------------------------
/FruitCandy/box2.md:
--------------------------------------------------------------------------------
1 | 1. 包、帧、段、数据报、消息:
2 | 包:全能
3 | 帧:数据链路层中包的单位
4 | 段:TCP数据流中的消息
5 | 数据报:IP和UDP等网络层以上的分层中包的单位
6 | 消息:应用协议中的数据单位
7 |
8 | 2. Concurrency is not Parallelism. 并发不等同于并行。并发是结构上的概念,是某一很短的时间段上同时dealing with两件事情。并行是从一个时间点上进行衡量,该时刻同时Doing两件事情。
9 | 这两个概念的差别非常微妙,从计算机的角度来讲,单核系统不存在并行,并发。而多核系统可以并发,也可以并行。
10 | 并行可以以一下两种模式来实现:
11 |
12 | A.
13 | Blocks --> worker1 --> Factory
14 |
15 | Blocks --> worker2 --> Factory
16 |
17 | Blocks --> worker3 --> Factory
18 |
19 | B.
20 | Blocks --> worker1 --> Transfer --> worker2 -- Transfer --> worker3 --> Factory
21 |
22 |
23 | 3. Stripslashes用于处理url或uri中的斜线。在kataras/iris里有个StaticWeb(request_url_path, system_directory, stripslashes_level)方法,它的第三个参数就是用来设置Stripslashes的等级,。示意如下:
24 |
25 | 0: "/foo/bar" --> "/foo/bar"
26 |
27 | 1: "/foo/bar" --> "/bar"
28 |
29 | 2: "/foo/bar" --> ""
30 |
31 | 4. session, Web Storage, SessionStorage, LocalStorage, cookies
32 |
33 |
34 | 5. 10个性能测试工具
35 | * uptime
36 | * dmesg | tail
37 | * vmstat 1
38 | * mpstat -P ALL 1
39 | * pidstat 1
40 | * iostat -xz 1
41 | * free -m
42 | * sar -n DEV 1
43 | * sar -n TCP, ETCP 1
44 | * top
45 |
46 | mpstat pidstat 需要安装sysstat [](http://mp.weixin.qq.com/s?__biz=MzAwNjY4NTQ4MA==&mid=400797122&idx=1&sn=b73ba049be8699eab97d58792a68676d&scene=23&srcid=0804fUgBWj9NmVEeiL3EKJUg#rd)
47 |
--------------------------------------------------------------------------------
/FruitCandy/box3.md:
--------------------------------------------------------------------------------
1 | MVC
2 |
3 | MVVC
4 |
5 | DOM
6 |
7 | MySQL的INSERT ON DUPLICATE KEY UPDATE命令,用于具有唯一索引的键或主键上,如果该记录存在,则更新其某一字段;若不存在,则新增一条记录。
8 |
9 | CQRS vs CRUD
10 |
11 | awk 在打印输出的时候,如果用了,间隔,可能也会转换为空格
12 |
13 | 或许可以通过github的版本控制思路,整一个音乐歌单版本管理。
14 |
15 | 1. goroutine在获取runtime.Caller()的时候的开销,有没有上下文切换?或者说goroutine调度是否存在上下文切换?从CPU角度来看,执行的指令不一样是有切换的,但上下文不是进程级概念的么?同一个进程里的goroutine上下文怎么区分?另外PC寄存器里的值也是有多个吧?最后goroutine是否有挂起状态?需要去源码里确认一下goroutine的几个状态。
16 |
17 |
18 | 2. grep -o '字符串' file |wc -l
19 | awk -v RS="@#$j" '{print gsub(/字符串/,"&")}' file
20 | awk '{s+=gsub(/字符串/,"&")}END{print s}' file
21 |
--------------------------------------------------------------------------------
/FruitCandy/box4.md:
--------------------------------------------------------------------------------
1 | How to write smooth Makefile?
2 | ------------
3 |
4 | chrome VPN plugins lead to cann't access to localhost ?
5 |
6 | ssh login without password: server need public key(from client) to encrypt one random string sent to client, if it could be decrypted by client private key, it is authenticated.
7 |
8 | In normal way, server public keys are saved in client .ssh/known_hosts, client public keys are saved in server .ssh/authorized_keys.
9 |
10 | In MySQL 5.7 version, function JSON_EXTRACT() is supported, [MySQL Doc](http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#operator_json-column-path). Usage: SELECT dcIdList, JSON_EXTRACT(dcIdList, "$.dcIdList[0]") FROM organization;
11 |
12 | How to make global unique ID:
13 | 1: database based
14 | * MySQL(5.6) AUTO_INCREMENT
15 | * Postgres(REL 9.6 Stable) SEQUENCE
16 | * Oracle SEQUENCE
17 | * Flickr Ticket Servers, supporting sharding
18 |
19 | 2: Distributed Cluster ..
20 | * Strong Consistency, Zookeeper (Paxos Protocol)
21 | * Evetually Consistency, Consul (Gossip Protocol)
22 |
23 | Raft Protocol ,etc.
24 |
25 | 3: Flake: Twitter Snowflake, MongoDB ObjectId
26 | 12-bytes MongoDB ObjectId 16777216 Id
27 |
28 | [source](http://mp.weixin.qq.com/s?__biz=MzA5Nzc4OTA1Mw==&mid=2659598286&idx=1&sn=3172172ccea316b0ed83429ae718b54d&chksm=8be9eadcbc9e63caa10d708274b4fa34ceffa416ef4527e10e6b7a1a2d2f32cf8592d65bf728#rd)
29 |
--------------------------------------------------------------------------------
/FruitCandy/box5.md:
--------------------------------------------------------------------------------
1 | [How Baidu rewrite using Golang](http://mp.weixin.qq.com/s?__biz=MzA5Nzc4OTA1Mw==&mid=2659598270&idx=1&sn=3e05f03e1a3c45a40bc8eed46566af9a&chksm=8be9eaacbc9e63ba4f6531a939bbff96e4b4a5781b78ae23a5b58fe9d8c4df148c68fbb67f57#rd)
2 |
3 | JSON_SET and JSON_EXTRACT are used when dealing with JSON columns in MySQL.
4 | use case:
5 | 1. SELECT JSON_EXTRACT(navList, "$.list[6].className") FROM user WHERE id=2;
6 | 2. UPDATE user SET navList = JSON_SET(navList, '$.list[5].className', "fa-child") WHERE id=10;
7 |
8 | Overlay Network is some kind of virtual network built on the existing underlay network such as IP network for some particular applications.
9 |
10 | I found some extra words when I do kubectl cluster-info | cut -d " " -f6 | head -1 | cut -d "/" -f3 | cut -d ":" -f2
11 | like:
12 | 8080^[[0m
13 | so What is ^[[0m ?
14 | It is ANSI color. Like we always could change font color in PS/2 in shell config files. like /etc/profile, etc.
15 |
16 | GO build compiler will check packages in GOPATH index1 location, then index2.
17 | like:
18 | GOPATH:/usr/local/go:/mworks
19 | compiler will first find packages in /usr/local/go, then mworks
20 |
--------------------------------------------------------------------------------
/FruitCandy/box6.md:
--------------------------------------------------------------------------------
1 | time.Now().Format("2006-01-02 15:04:05")) refering to American time format: Jan, 2nd, 3am, 4m, 5s, 2006 (1,2,3,4,5,6)
2 |
--------------------------------------------------------------------------------
/FruitCandy/padora.md:
--------------------------------------------------------------------------------
1 | ./index.html: ui-view class "main"
2 | |
3 | ./views/main/login.html: ng-click(): "login()"
4 | |
5 | ./scripts/pages/main/controller.js: $scope.jump -> $state.go('main.appManage')
6 | |
7 | ./scripts/pages/appManage/router.js: views/appManage/appManage.html
8 |
9 | ./views/pages/main/main.js: L97 - L110
10 |
11 | ./scripts/pages/main/main.js: L51: $scope.navList = nav.list
12 |
13 |
14 |
15 |
16 | ./scripts/pages/walkthrogh/controller.js: $state.go('main.topology')
17 |
18 |
19 | ----------------------------------------------------------------------
20 |
21 |
22 | ./index.html ui-view class "main"
23 | ./scripts/pages/main/controller.js: L65: $state.go('login')
24 | ./views/main/topology.html
25 |
26 |
27 | ------------------------------------------------------------------------------------
28 |
29 | delete appManage.....
30 | common/service.js
31 | common/controller.js
32 |
33 | --------------------------------------------------
34 |
35 | Add namespace choose list
36 | both backend
37 |
38 | mv html in index.html back to topology.html, accomplishing ng-bind
39 |
40 | ---------------------------------------------------------------------
41 |
42 | padora:
43 |
44 | 1. get all namespace list from k8s api then return back to frontend (default is default)
45 | 2. frontend request with selected namespace
46 | 3. return topology relations to frontend
47 |
48 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/.idea/Go-Chrome-Plugins.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/.idea/libraries/GOPATH__Go_Chrome_Plugins_.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/demo.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/fabioberger/chrome"
5 | "honnef.co/go/js/dom"
6 | "strconv"
7 | )
8 |
9 | func main() {
10 | c := chrome.NewChrome()
11 |
12 | tabDetails := chrome.Object{
13 | "active": false,
14 | }
15 | /*
16 | c.Tabs.Create(tabDetails, func(tab chrome.Tab) {
17 | notification := "Tab with id: " + strconv.Itoa(tab.Id) + " created!"
18 | dom.GetWindow().Document().GetElementByID("notification").SetInnerHTML(notification)
19 | })
20 | */
21 |
22 | c.Tabs.Create(tabDetails, func(tab chrome.Tab) {
23 | notification := "Tab: " + strconv.Itoa(tab.Id) + " Hello World!"
24 | dom.GetWindow().Document().GetElementByID("notification").SetInnerHTML(notification)
25 | })
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 |
4 | "name": "My Chrome Extension",
5 | "description": "This is a chrome extension written in Go",
6 | "version": "1.0",
7 |
8 | "browser_action": {
9 | "default_popup": "popup.html"
10 | },
11 | "permissions": [
12 | "tabs"
13 | ]
14 | }
--------------------------------------------------------------------------------
/Go-Chrome-Plugins/popup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/GolangDairy/BuildYourLog.md:
--------------------------------------------------------------------------------
1 | 日志对于任何一个系统来说都是非常重要的一环,除了记录运行过程和状态以外,更重要的是记录一些系统出错、崩溃的成因,以便开发、运维人员寻找问题。
2 |
3 | 本系列将按照Go语言的日志包、Docker的日志实现、Kubernetes的日志实现、如何打造自己的日志框架进行学习和思考。
4 |
5 | Go语言的日志包分析之一
6 |
7 |
8 | Golang源码的日志目录结构是这样的:
9 |
10 | -log
11 | |-syslog
12 | | |-syslog.go
13 | | |-syslog_test.go
14 | | |-syslog_unix.go
15 | |-log.go
16 | |-log_test.go
17 |
18 | 其中包含了两个包,一个是syslog系统日志包,另一个是log包。
19 |
20 | 首先来看log包。
21 |
22 | Go语言提供了日志包log,里面定义了一个类型Logger以及它的格式化输出方法。同时还有一个预定义的“标准”Logger,可以通过辅助函数Print[f|ln],Fatal[f|ln]和Panic[f|ln]来使用要比手动创建Logger简便。
23 |
24 | 在导入了相关的包后,首先定义了一些常量,它们是确定日志输出前缀的标记:
25 |
26 | ```golang
27 | const (
28 | Ldate = 1 << iota //当前时区的日期,格式是:2009/01/23
29 | Ltime //当前时区的时间,格式是:01:23:23
30 | Lmicriseconds //微秒解析
31 | Llongfile //全文件名和行号
32 | Lshortfile //当前文件名和行号,会覆盖Llongfile
33 | LUTC //使用UTC而非当前时区
34 | LstdFlags = Ldate | Ltime //标准Logger的初始值
35 | )
36 |
37 | ```
38 |
39 | 这里这些值除了Ldate和LstdFlags显式赋值,其它的并没有赋值,那么它们的值如何呢?经过测试,发现它们的值分别为1、2、4、8、16、32和3。
40 |
41 | 通过二进制位来进行标记的方法已经很常见。在这里是通过itoa来实现的
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/GolangDairy/InterfaceVsNil.md:
--------------------------------------------------------------------------------
1 | interface vs nil
2 |
3 | interface{} has two member, it equals to nil only when both members is nil.
4 |
5 | unsafe.Pointer()
6 |
7 | [](https://groups.google.com/forum/#!topic/golang-nuts/wnH302gBa4I/discussion)
8 | >This is a common source of confusion. The basic answer is to never store something in an interface if you don't expect the methods to be called on it. The language may allow it, but that violates the semantics of the interface. To expound, a nil value should usually not be stored in an interface unless it is of a type that has explicitly handled that case in its pointer-valued methods and has no value-receiver methods.
9 |
--------------------------------------------------------------------------------
/GolangDairy/NilisNotEmpty.md:
--------------------------------------------------------------------------------
1 | Nil是指针类型的零值,而非空,它仍然占内存空间
2 |
3 |
--------------------------------------------------------------------------------
/How we Scaled Kubenretes to 60,000-Container Cluster and Where We're Going Next/README.md:
--------------------------------------------------------------------------------
1 | How we Scaled Kubenretes to 60,000-Container Cluster and Where We're Going Next
2 | ===============================================
3 |
4 | 正文:
5 | --------------
6 | 大家好,我是Marek Grabowski,一名来自谷歌的软件工程,我致力于Kubernetes可的扩展性研究。首先,我先举一个简单的例子,向大家展示可扩展性(Scalability)用来做什么。在过去的几年中,我们支持的Kubernetes集群规模从几百个节点增加到2000个节点,更重要的是,我想让大家都明白,当我们谈论Kubernetes集群时它究竟意味着什么。这些工作大部分由我们谷歌同事,来自redhat、coreos等公司的朋友,还有来自社区的小伙伴们一起完成。and it was like oversold by seek scalability as first mentioned as the keynote。
7 |
8 |
9 |
10 | 解掉一部分视频
11 |
12 | 在2015年的冬天,我们第一发现了Kubernetes的
13 |
--------------------------------------------------------------------------------
/IntroIdeas/':
--------------------------------------------------------------------------------
1 | Kubernetes 1.5
2 | ==============
3 |
4 | ###主要更新:
5 |
6 | * 联邦(Federation)现已支持
7 | * Daemonsets
8 | * Deployments
9 | * ConfigMaps
10 | * 简化集群部署
11 | * 提升`kubeadm`
12 | * 新命令`kubefed`
13 | * Master节点高可用(HA)
14 | * 节点鲁棒性
15 | * 支持Windows Server Container
16 | * 容器运行时接口(CRI)实现
17 | * `kubelet`API支持认证和授权
18 |
19 | ###新特性:
20 |
21 | * 应用
22 | * [Stable]当ReplicaSets不能创建Pods时,它们会通过API报告失败的底层原因。
23 | * [Stable]`kubectl apply`现可通过`--prune`参数删除不再需要的资源
24 | * [Beta]无法通过滚动升级到新版本的Deployments现可通过API说明它们已被阻塞。
25 | * [Beta]StatefulSets允许要求持久化的支持持久化或单实例存储的创建和管理。
26 | * [Beta]为了提供安全保障,集群不会强行删除未响应节点上的Pods,用户通过CLI强行删除Pods会收到警告。
27 | * 认证
28 | * [Alpha]打磨了基于角色的访问控制alpha版API,包含默认的一组集群角色
29 | * [beta]添加了对于Kubelet API认证/授权机制。
30 | * AWS
31 | * [Stable]角色应该出现在`kubectl get nodes`的结果里。
32 | * 集群生命周期
33 | * [Alpha]提升了`kubeadm`二进制包的交互和可用性,新建一个运行的集群变得更加容易了。
34 | * 集群运维
35 | * [Alpha]在GCE上使用kube-up/kube-down脚本添加了创建/移除集群w/高可用(复制)的主节点。
36 | * 联邦
37 | * [Beta]支持联邦ConfigMaps。
38 | * [Alpha]支持Alpha的联邦Daemonsets。
39 | * [Alpha]支持Alpha的联邦Deployments。
40 | * [Alpha]集群联邦添加对于删除选项.孤儿依赖(DeleteOptions.OrphanDependents)的支持,
41 | * [Alpha]引入`kubefed`命令,简化联邦控制台的部署以及集群注册/注销体验。[文档]()
42 | * 网络
43 | * [Stable]服务可以通过DNS名被其他服务引用,而不是只在pods里。
44 | * [Beta]为NodePort类型和LoadBalancer保留源IP的选项。
45 | * 节点
46 | * [Alpha]添加了保留对宿主用户命名空间的访问,当容器运行时里用户命名空间重映射被启用的时候。
47 | * [Alpha]引入了v1alpha1版本的CRI(容器运行时接口) API允许可插拔的容器运行时,一个实验用的docker-CRI集成已经就绪,等待测试和反馈。
48 | * [Alpha]Kubelet基于QoS层在每个Pod的CGroup层级里启动容器
49 | * [Beta]Kubelet集成了memcg提示消息API,来检测硬超过阈值。
50 | * [Beta]引入了Beta版的容器化节点一致性测试 gcr.io/google_containers/node-test:0.2,用户来验证node设置。
51 | * 调度
52 | * [Alpha]添加了对于审计不透明的整个资源。
53 | * [Beta]PodDisruptionBudget被升级为Beta版,可以用来安全地drain节点,鉴于应用的SLOs
54 | * UI
55 | * [Stable]Dashboard UI现在显示面向用户的对象及它们的资源使用情况。
56 | * Windows
57 | * [Alpha]添加了对Windows Server 2016节点和调度Windows Server Container的支持。
58 |
59 |
60 | ### 显著改变
61 | * 节点控制器不在从apiServer强行删除pods了
62 | * 对于有状态的应用StatefulSet(先前为PetSet)而言,这个改动意味着创建替换的Pods被阻塞,直到旧的Pods确实没有在运行了(意味着kubelet从分区返回,Node对象的删除,云服务商里实例的删除,或强行从apiServer中删除了Pod)。这通过保证不可达的Pod不会被推测为已死帮助阻止了集群应用“脑裂”的场景,除非一些“包围”操作提供了上述之一的情况。
63 | * 对于其他已有的除StatefulSet外的控制器,这对于控制器替换Pods没有影响,因为控制器不会重用Pods命名(使用生成的名字generate-name)
64 | * 用户编写的控制器会重用Pod对象的名字,所以需要考虑这个变化。
65 | * 允许匿名API服务器的访问,通过授权组系统设置认证的用户
66 | * kube-apiserver添加了--anonymous-auth 参数,默认为true。当它启用时,访问安全端口的请求不会被其他配置的认证方法所拒绝,这些请求被当做匿名请求,并且用户名为`system:anonymous`,组织为`system:unauthenticated`。
67 | * 认证的用户被设为`system:authenticated`组。
68 | * 注意:匿名访问默认启用。如果你只依赖认证来授权访问,选择一个授权模式而不是AlwaysAllow,或者将`--anonymous-auth`设为`false`。
69 |
70 | ### 升级须知
71 | * batch/v2alpha1.ScheduledJob被重命名为batch/v2alpha1.CronJob。
72 | * PetSet被重命名为StatefulSet。如果你现在有PetSets,你要在升级为StatefulSets前后进行一些额外的迁移操作,
73 | * 如果你从v1.4.x升级你的集群联邦组件,请更新你的`federation-apiserver`和`federation-controller-manager`证明为新版本。
74 | * 废弃的kubelet --configure-cbr0参数被移除。经典的网络模式也是。如果你依赖于此模式,请调研其他的网络插件`kubenet`或`cni`是否满足需求。
75 | * 新的client-go结构,根据kubernetes/client-go为版本策略。
76 | * 废弃的kube-scheduler --bind-pods-qps和--bind-pods burst参数被移除,替换--kube-api-qps和--kube-api-burst代替。
77 | * 如果你需要使用1.4的特性:PodDisruptionBudget(例如创建了PodDisruptionBudget对象),然后在从1.4升级为1.5之前,你一定要删除所有的PodDisruptionBudget对象(policy/v1alpha1/PodDisruptionBudget)。升级之后不可能删除这些对象。它们的存在也会妨碍你使用1.5里Beta版的PodDisruptionBudget特性(policy/v1beta1/PodDisruptionBudget)。如果你已经进行了升级,那么你需要降级到1.4来删除这些policy/v1alpha1/PodDisruptionBudget对象。
78 |
79 |
--------------------------------------------------------------------------------
/IntroIdeas/Fission_Serverless_Functions_For_Kubernetes.md:
--------------------------------------------------------------------------------
1 | Fission: Severless Functions for Kubernetes
2 | --------------------------------------------
3 |
4 |
5 |
6 | https://github.com/fission/fission/blob/master/README.md
7 | http://fission.io/
8 | https://fissionio.slack.com/messages/general/
9 |
--------------------------------------------------------------------------------
/IntroIdeas/How_the_Go_programming_language_helps_Docker_and_the_container_ecosystem.md:
--------------------------------------------------------------------------------
1 | Go语言是如何帮助Docker容器生态圈的?
2 | ----------
3 | 为了编写Docker,开发者选择了Google推出的新编程语言——Go语言。在Docker虚拟化技术需要快速响应的前提下,更为传统的选择可能是C语言这样的底层语言。
4 |
5 | 使用Go语言是一个明智的决定,它使得Docker团队与他们的首选操作系统——Linux的工作变得简单和有效。
6 |
7 | 更重要的是,Go语言给用户带来了将Docker机制并入自己环境中的捷径。Go语言被特别设计为支持分布式系统上的快速开发,它允许云计算环境上的开发者和系统管理员可以快速地开发程序和系统工具,而无需担心太多关于例如依赖管理、或并发编程的问题。
8 |
9 | 对于开发者,Go提供了将小段代码打包的功能,在编程的时候可以直接引用这些包,同时,这些包还可以被其他应用所重用。
10 |
11 | Go不仅帮助了开发,也简化了部署。因为一个Go程序一旦被编译,一般情况下它便不再需要额外的库。一个大型标准核心库为程序员提供了大多数场景下所需要的功能。
12 |
13 | 这意味着一个管理员可以开发一个Go程序,并把它拷贝到任何安装了Go语言环境的远程服务器上,而且不用担心程序是否需要一些这台服务器所没有的库。
14 |
15 | 借助于Docker,这个过程会变得更简单。在Docker Hub上该语言有[一个特殊的版本](https://blog.golang.org/docker),它可以在编译过程中把任何应用打包为Docker镜像,这样它就可以被立即部署了。开发者甚至可以[在容器里面构建他们的应用](https://hub.docker.com/_/golang/)。他们甚至不需要在本地宿主机上安装Go环境。
16 |
17 | 利用Docker提供的Go语言API库,使用它跟Docker容器进行交互、管理Docker容器也跟在Docker里面安装和运行Go程序一样简单。
18 |
19 | ### 用户的选择
20 | Go语言项目于2009年启动,并且在2012年生产就绪。接着它就被全球开发者所拥护,特别是在中国,Go语言被大量使用(尽管对于是否如数据显示那么大的分歧存在争论)。
21 |
22 | 事实上有令人吃惊的大型企业,它们不是最快的接受者,而是已经接受了Go语言,包括:Chevron、Verizon、Disney、Walmart、Comcast、General Electric,甚至Microsoft、IBM也使用Go来搭建物联网安全库和连接大量Docker容器的网络软件。
23 |
24 | 许多网络公司也接受了Go语言。不只是Google,Facebook和Amazon也在使用Go。
25 |
26 | 当然,Google的Google App Engine将Go语言运行时作为它众多服务中的一个,而其它的云服务商,例如Amazon Web Services也在支持Go语言。
27 |
28 | 据最新统计,Github上有超过86,600个基于Go语言的软件项目,而且这只是开源的公开项目,毫无疑问,许多私有的、专利的软件项目也使用了Go语言进行开发。这不只是关于什么样的公司会使用Go语言——许多开发者回答说他们近期准备使用Go语言。
29 |
30 | 2015年的StackOverflow开发者调查报告显示,有19%的DevOps开发者说他们将来计划使用Go语言,代表着从当前10%的Go语言用户的增长。整体上,8%的开发者计划在明年使用Go语言。
31 |
32 | 除了Docker之外,包括Kubernetes容器管理软件和Hashicorp的Nomad集群管理软件等其它的容器支持软件也由Go语言进行开发。
33 |
34 | 过些年就会很容易看到Go语言成为容器生态系统的核心语言。Docker和Go语言之间有着这样的协调:如果有人看到Docker项目里一个需要修补的bug,或者希望以某种方式提升软件,他们会使用Go语言,并由此加入了全球Go语言程序员的联盟。
35 |
36 | 
37 |
38 | ### 新旧孰好
39 | 对Go语言的喜爱有一部分来自它将过去的静态类型编程语言的最佳实践和新的常用来搭建web应用的动态类型语言进行了整合。
40 |
41 | Go语言是被那些可以成为“超级用户”的老手程序员创造的:Robert Griesemer,他曾在V8 Javascript引擎和Google File System上工作;Rob Pike, Unix和UTF-8字符编码格式;Ken Thompson, Unix和C的共同创造者。在2007年之前,他们都曾在Google工作,并且都被现存语言的限制所烦恼。那时的语言不能很好地适应系统编程,所以他们开始设计Go语言以直接解决这个问题。
42 |
43 | 传统的静态类型语言,例如Java、C++,提供了对于数据类型更严格的控制,这使得它们更安全、更快。在它们加强了规则的同时,也变得更难使用了。
44 |
45 | 这样的结果是许多面向web的创业公司在过去的十年里都开始转向例如Ruby或Javascript等的一种新的动态类型语言,这些语言它们并不是强数据类型。
46 |
47 | 与此同时,动态类型语言可以简化程序员的工作,这里减少的工作增加了测试和调试的代价。如果数据类型没有从一开始就被加强,尤其是对于大型程序,调试开始变得让人头疼。另外由动态语言编写的程序部分要比使用静态语言编写的统一部分更慢,特别是面向大量负载的时候。
48 |
49 | Go语言之美在于它结合了动态语言提供的开发便利和静态语言的严格和速度。
50 |
51 | 所以Go程序比那些由动态语言编写的程序运行更快,而且在云环境里它可以被直接转化为云上运行web应用的公司的月度使用账单。
52 |
53 | 有一家名为Iron.io的咨询公司学到了上面这些。它给它们的客户搭建了消息系统,之后产品化叫做IronWorker。IronWorker的第一版是用Ruby写的,后来发现它不容易被扩韩。于是使用Go语言重写这个程序,所以Iron.io将它们所需的[虚拟服务器从30台减少到了2台](http://www.iron.io/blog/2013/03/how-we-went-from-30-servers-to-2-go.html)。
54 |
55 | 另外,Go适合于分布式计算,它有许多支持并发的内建特征和在多处理器上运行程序的能力。它可以执行许多低级的系统调用,使得有能力来与操作系统进行直接的交互,从而加速了运行时间。
56 |
57 | Go同样被设计为程序员友好,所以程序员可以通过简单的一行命令查看文档,或者进行测试。
58 |
59 | 简言之,Docker不会找到比Go更好的合作伙伴了。
60 |
61 | 原文作者:[Joab Jackson](http://thenewstack.io/author/joab/),New Stack主编。
62 | 原文链接:[How the Go programming language helps docker and the container ecosystem](http://thenewstack.io/ebookseries/)
63 |
64 | ### 译者说
65 | Go语言随着Docker等技术的火热也在持续升温,正如文中所说,Docker、Kubernetes社区的活跃和Go语言的社区的活跃密不可分。同时,借助于Docker和Kubernetes的开放API,使用Go语言编写程序管理容器变得轻而易举。除此之外,Go语言还有很多优秀的开源项目,具体可以参见[Awesome-go](https://github.com/avelino/awesome-go),拥有15,010颗星的该项目下面汇集了众多各个方向的Go语言项目。Go语言作为一门年轻的语言,有它出彩的地方,同时也免不了还有很多瑕疵。译者认为语言之争没有终点,每种语言都如同一门兵器,面对不同的“战役”、面对不同的“敌人”,应该使出不同的“兵器”。编程语言各有所长,我们不应以使用了某种语言而感到优越,正确的姿势是应该通过编程改善了生活、提高了效率、做了有意义的事情而使我们感到骄傲。
66 |
--------------------------------------------------------------------------------
/IntroIdeas/Kubernetes-Understanding-Resources.md:
--------------------------------------------------------------------------------
1 | Kubernetes Understanding Resources
2 | ---------------------------------
3 | Ben Visser
4 |
5 |
6 |
7 | [原文链接](http://www.noqcks.io/note/kubernetes-resources-limits/)
8 | [原文作者](http://www.noqcks.io/about/)
9 |
--------------------------------------------------------------------------------
/IntroIdeas/Using_Deployment_objects_with_Kubernetes_1.2.md:
--------------------------------------------------------------------------------
1 | Uesr
2 |
--------------------------------------------------------------------------------
/IntroIdeas/pics/5_more.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/5_more.jpg
--------------------------------------------------------------------------------
/IntroIdeas/pics/How_the_Go_programming_language_helps_Docker_and_the_container_ecosystem.png:
--------------------------------------------------------------------------------
1 | Docker
2 |
--------------------------------------------------------------------------------
/IntroIdeas/pics/baidu-research.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/baidu-research.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/insights.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/insights.jpg
--------------------------------------------------------------------------------
/IntroIdeas/pics/job_paddle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/job_paddle.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/k8s-custom-hpa-scaling-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/k8s-custom-hpa-scaling-down.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/k8s-custom-hpa-scaling-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/k8s-custom-hpa-scaling-up.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/namespace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/namespace.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/overview-cri.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/overview-cri.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/paddle-model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/paddle-model.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/plan_to_use_go_in_the_future.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/plan_to_use_go_in_the_future.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/rest_api.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/rest_api.jpg
--------------------------------------------------------------------------------
/IntroIdeas/pics/restful_api_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/restful_api_1.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/top-5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/top-5.jpg
--------------------------------------------------------------------------------
/IntroIdeas/pics/top5borg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/top5borg.png
--------------------------------------------------------------------------------
/IntroIdeas/pics/top5cube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/IntroIdeas/pics/top5cube.png
--------------------------------------------------------------------------------
/IntroIdeas/rkt_and_kubernetes.md:
--------------------------------------------------------------------------------
1 | What Kubernetes users should know about the rkt container engine
2 | =================================================================
3 |
4 | [](https://coreos.com/blog/rkt-and-kubernetes.html)
5 |
--------------------------------------------------------------------------------
/IntroIdeas/serverless-faas-fingle.md:
--------------------------------------------------------------------------------
1 | 结合Twitter的Finagle,论文整faas与serverless
2 |
--------------------------------------------------------------------------------
/KubeCon/about/README.md:
--------------------------------------------------------------------------------
1 | KubeCon视频系列简介
2 | ================================
3 |
4 | ### How We Scaled Kubernetes to 2000 Nodes Clusters
5 | -----------------------
6 |
7 | 主讲人是来自Google的Marek Grabowski,分享的主要内容有:
8 |
9 | 1. 99%的ApiServer的请求都在1秒内结束
10 |
11 | 2. 99%的pod调度、创建在5秒内完成
12 |
13 | 3. 解决了反复go struct 到 json序列化和反序列化的问题,能支持100个节点,这是v1.0
14 |
15 | 4. 优化过程:
16 | * v1.1: 使用go的反射机制、对象与版本抽离的方式,代码生成器(转换类型)等手段,能支持到250个节点
17 | * v1.2: 减少watcher的数量,引入cacher,如果不是非要取得实时的数据,尽量都走cacher,能支持1000个节点
18 | * v1.3: 使用protocol buffer二进制协议代替内部的json协议,能支持2000个节点
19 | * 计划在1.5版本将etcd 从2.0版本迁移到3.0版本,预计能够支持5000
20 | * 未来Scheduler筛选的过程考虑使用map-reduce加速调度过程
21 |
22 | ### A Cloud Native State of the Union
23 | ------------------------
24 |
25 | 主讲人是来自Linux Foundation的Dan Kohn,分享的主要内容有:
26 |
27 | 1. 云计算的发展历史以及CloudNative的发展概况
28 |
29 | 2. 容器技术在资源隔离、开源、扩展性、敏捷和可维护性以及效率和资源利用率方面的影响
30 |
31 | 3. CNCF在会议召开、奖励机制、文档编写以及市场合作方面提供的服务
32 |
33 | 4. CloudNative包含的公司、项目的技术栈和全景图
34 |
35 | 5. CNCF在认证培训方面的工作以及KubeCon 2017的安排
36 |
37 | ### Logging for Containers:
38 | ------------------------
39 |
40 | 主讲人是来自TreasureData的Eduardo Silva,分享的主要内容有:
41 |
42 | 1. 日志采集的三大意义:监控、排错和统计分析
43 |
44 | 2. 容器和微服务场景下日志处理遇到的挑战
45 |
46 | 3. 分布式日志4种聚合模式
47 |
48 | 4. 轻量级日志聚合器fluentbit的介绍及示例
49 |
50 |
51 | LightningTalk: Micro-Services Lifecycle Management at Twitter
52 | ------------------------
53 |
54 | 主讲人是来自Twitter的Micheal Benedict,分享的主要内容有:
55 |
56 | 1. 单体应用的问题,为什么要向微服务转换
57 |
58 | 2. Twitter的前端路由设计
59 |
60 | 3. 微服务管理的要点:
61 | * 清晰的服务隔离,管理权转换
62 | * 稳定性,容错
63 | * 可扩展性
64 | * 开发人员的生产率
65 | * 团队管理
66 | * 元数据管理
67 | * 标识管理
68 | * 资源管理
69 | * 计费管理
70 |
71 | 4. 介绍Twitter的服务生命周期管理——Kite系统
72 |
--------------------------------------------------------------------------------
/Kubernetes Hash碰撞问题解决/README.md:
--------------------------------------------------------------------------------
1 | Kubernetes Hash碰撞问题解决
2 | =================================
3 |
4 | #### 缘起
5 | -----------
6 |
7 | 在生产环境中使用*Kubernetes Deployment*进行滚动升级时,经常会出现升级失败的情况。具体的原因是由于在滚动升级的过程中,*Deployment Controller*会使用*Adler32*算法计算*Deployemt.Template*的*Hash*值,这个*Hash*值和*Deployment*的名称共同组成了新的*ReplicaSet*的名称。但是由于滚动升级中,我们只是对*PodTemplate*部分*Containers[0].image*即镜像名称进行了修改,例如从*img.reg.3g:15000/yce-alpha:201703151133*修改成*img.reg.3g:15000/yce-alpha:201703251023*,由于内容变化不大,所以经常会出现创建新*ReplicaSet*失败的情况,随着向*Kubernetes*集群迁移的应用越来越多,这种状况出现的越来越频繁。
8 |
9 |
10 | #### 解决方法:修改Hash算法
11 | -----------
12 |
13 | 社区中关于这个问题也有很多讨论[#issue 29735](https://github.com/kubernetes/kubernetes/issues/29735),大家提出了各种各样的解决办法,由于不能破坏产生新的*ReplicaSet*操作的幂等性,所以不能改变ReplicaSet的名称产生的方式。为了减少Hash碰撞,只能在Hash算法上下功夫。
14 |
15 | 在理论上,任何Hash算法都存在碰撞。
16 |
17 | 注:我们在文章[《从Kubernetes的一个Bug说开去》]()中详细描述了*Kubernetes Deployment*滚动升级出现Hash碰撞的定位过程。
18 |
--------------------------------------------------------------------------------
/Kubernetes Resource Model/avaliable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Kubernetes Resource Model/avaliable.png
--------------------------------------------------------------------------------
/Kubernetes Resource Model/capacity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Kubernetes Resource Model/capacity.png
--------------------------------------------------------------------------------
/Kubernetes Resource Model/defragment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Kubernetes Resource Model/defragment.png
--------------------------------------------------------------------------------
/Kubernetes Resource Model/fragment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Kubernetes Resource Model/fragment.png
--------------------------------------------------------------------------------
/Kubernetes Resource Model/pod-scheduler-node.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Kubernetes Resource Model/pod-scheduler-node.png
--------------------------------------------------------------------------------
/Kubernetes Resource Model/rebalance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Kubernetes Resource Model/rebalance.png
--------------------------------------------------------------------------------
/MTalking/from-fsm-to-autotest.md:
--------------------------------------------------------------------------------
1 | From FSM to AutoTest
2 | ===================
3 | 从有限状态机到自动化测试
4 |
--------------------------------------------------------------------------------
/MTalking/k8s-1.md:
--------------------------------------------------------------------------------
1 | 0.16版本
2 |
3 | 在功能上既保证了容器集群的高效运维和编排,又提供了恰到好处的平台层服务。
4 |
5 | SwarmKit, Mesos+Marathon, Kubernetes
6 |
7 | K8s脱胎于Borg,“代表了Google过去十余年设计、构建和管理大规模容器集群的经验”。
8 |
9 | 设计哲学之一是:维护应用容器集群一直处于用户所期望的状态。
10 |
11 | Pod 分组管理容器 -> 进程分组
12 |
13 | 设计理念围绕Pod这个可以视作单个容器的“容器组”展开。
14 |
15 | 相比Mesos + Marathon,Kubernetes原生提供了“容器组”、“跨主机网络”、“负载均衡”等内容。
16 |
17 |
18 | Frequently Questions:
19 |
20 | 1. Stack Overflow.
21 |
22 | 2. Docker/K8s Storage, how to deal with stateful app?
23 |
24 | 3. Docker/K8s Network model, how to deal with cross-host communication?
25 |
26 | 4. Application Lifecycle Management.
27 |
28 | 5. Comparison with SwarmKit, Mesos/Marathon.
29 |
30 | 6. RESTFul API and Microservices.
31 |
32 | 7. One-Node Kube. Minikube. Or ??
33 |
34 | 8. Official Use case example.
35 |
--------------------------------------------------------------------------------
/MTalking/kube-tmp:
--------------------------------------------------------------------------------
1 | EventsSink
2 | EventCompress
3 | Event ETCD
4 | https://github.com/kubernetes/kubernetes/blob/master/docs/design/event_compression.md
5 | Source kubelet pkg/cmd/kubelet/app
6 | /Users/yp-tc-m-7019/mworks/yce-backend/src/k8s.io/kubernetes/cmd/kubelet/app/server.go
7 |
8 | Conclusion
9 |
10 | kubernetes/pkg/watch/mux.go
11 |
12 | Event 跟 etcd的list-watch机制下的event不一样
13 |
14 |
15 |
16 |
17 |
18 |
19 | 另一方面,这些输出的
20 |
21 |
22 |
23 | #### 明修栈道暗度陈仓
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | ControllerManager:
34 | * leaderelection: 谁当选?谁下台?
35 |
36 | NodeController-ControllerManager:
37 | * controller_utils: 记录Node事件(停止和删除节点上所有Pod、注册或移除Node等)和Node状态变化事件(CIDR不可用或分配失败、Node不可用等)
38 |
39 | DeploymentController-ControllerManager:
40 | * deployment_controller:回滚和扩容的事件
41 |
42 | JobController-ControllerManager:
43 | * jobcontroller:ScheduleJob事件
44 |
45 | HorizontalController-ControllerManager:
46 | * horizontal(podautoscaler): Pod自动水平扩容成功或失败事件
47 |
48 | ReplicationController-ControllerManager:
49 | * replication_controller:同上
50 | * replica_set: 关联到ReadPodControl结构,记录Pod创建成功或失败、删除成功或失败等事件
51 |
52 | ServiceController:
53 | * servicecontroller(servicecontroller): 创建云上LoadBalancer成功、更新或失败等事件
54 |
55 | Kubelet:
56 | * config(config):过滤校验失败的pod
57 |
58 | Kubelet:
59 | * helpers(container):记录内部容器的事件
60 |
61 | Kubelet:
62 | * docker_manager(dockertools):容器生命周期的各个事件
63 |
64 | Kubelet:
65 | * image_gc_manager: 查看磁盘空间是否足够,或释放空间失败等事件
66 |
67 | Kubelet:
68 | * kubelet:ClusterDNS丢失、无法为Pod挂载卷、不支持带宽整形等
69 |
70 | Kubelet:
71 | * oom_watcher(kubelet): 通过cAdvisor报告系统内存不足等事件
72 |
73 | Kubelet:
74 | * pod_worker(kubelet):同步Pod失败等
75 |
76 | * prober(kubelet):检测容器不健康等
77 |
78 | Kubelet:
79 | * rkt: rkt容器生命周期各个事件
80 |
81 | Kubelet:
82 | * image_manager
83 |
84 | * kubelet_runtime_manager:
85 |
86 |
87 | * eviction_manager
88 | * controller(persistentvolume):
89 | * petset
90 | * disruption
91 | * daemoncontroller
92 |
93 |
94 |
--------------------------------------------------------------------------------
/MTalking/pics/3-tiers-web-application.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/3-tiers-web-application.png
--------------------------------------------------------------------------------
/MTalking/pics/Kubelet-show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/Kubelet-show.png
--------------------------------------------------------------------------------
/MTalking/pics/curl-events-err.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/curl-events-err.png
--------------------------------------------------------------------------------
/MTalking/pics/curl-events-succ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/curl-events-succ.png
--------------------------------------------------------------------------------
/MTalking/pics/deployment-define.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/deployment-define.png
--------------------------------------------------------------------------------
/MTalking/pics/docker-cli-docker-daemon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/docker-cli-docker-daemon.jpg
--------------------------------------------------------------------------------
/MTalking/pics/docker-server.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/docker-server.jpg
--------------------------------------------------------------------------------
/MTalking/pics/events-define.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/events-define.png
--------------------------------------------------------------------------------
/MTalking/pics/events-json.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/events-json.png
--------------------------------------------------------------------------------
/MTalking/pics/events-restapi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/events-restapi.png
--------------------------------------------------------------------------------
/MTalking/pics/fissin-http.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fissin-http.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-env.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-fission-all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-fission-all.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-function.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-function.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-http (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-http (2).png
--------------------------------------------------------------------------------
/MTalking/pics/fission-http-seq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-http-seq.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-http.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-http.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-on-k8s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-on-k8s.png
--------------------------------------------------------------------------------
/MTalking/pics/fission-rest-api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fission-rest-api.png
--------------------------------------------------------------------------------
/MTalking/pics/fix-intellij-cannot-resolve-references-bug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/fix-intellij-cannot-resolve-references-bug.png
--------------------------------------------------------------------------------
/MTalking/pics/golang.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/golang.jpg
--------------------------------------------------------------------------------
/MTalking/pics/goldeneye:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/goldeneye
--------------------------------------------------------------------------------
/MTalking/pics/kube-events.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/kube-events.jpg
--------------------------------------------------------------------------------
/MTalking/pics/kube-events.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/kube-events.png
--------------------------------------------------------------------------------
/MTalking/pics/kubectl-describe-eventd-err01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/kubectl-describe-eventd-err01.png
--------------------------------------------------------------------------------
/MTalking/pics/kubectl-describe-events-err03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/kubectl-describe-events-err03.png
--------------------------------------------------------------------------------
/MTalking/pics/kubectl-events-succ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/kubectl-events-succ.png
--------------------------------------------------------------------------------
/MTalking/pics/kubectl-get-events.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/kubectl-get-events.png
--------------------------------------------------------------------------------
/MTalking/pics/mindmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/mindmap.png
--------------------------------------------------------------------------------
/MTalking/pics/mindmap2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/mindmap2.png
--------------------------------------------------------------------------------
/MTalking/pics/pod-define.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/pod-define.png
--------------------------------------------------------------------------------
/MTalking/pics/serverless-app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/serverless-app.png
--------------------------------------------------------------------------------
/MTalking/pics/speed-up-the-platform.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/speed-up-the-platform.jpg
--------------------------------------------------------------------------------
/MTalking/pics/think.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/think.jpeg
--------------------------------------------------------------------------------
/MTalking/pics/var-lib-docker-containers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/var-lib-docker-containers.png
--------------------------------------------------------------------------------
/MTalking/pics/varlog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/varlog.png
--------------------------------------------------------------------------------
/MTalking/pics/varlog2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/varlog2.png
--------------------------------------------------------------------------------
/MTalking/pics/web-serverless.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MTalking/pics/web-serverless.png
--------------------------------------------------------------------------------
/MTalking/todolist.md:
--------------------------------------------------------------------------------
1 | 已解决:
2 |
3 | [x] 贯穿发布流水线,减少沟通成本
4 | [x] 秒级的上线、回滚、升级、滚动升级
5 | [x] 秒级扩容、缩容,用户无感知的弹性计算
6 | [x] 支持用户自定义的自动按需扩容
7 | [x] 快速回滚、滚动升级让发布过程可控、可预期
8 |
9 | 未解决:
10 |
11 | [ ] 联合发布
12 | [ ] 依赖关系、发布顺序
13 | [ ] 自定义发布、便捷发布(可视化)
14 |
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/.DS_Store
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/appmetrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/appmetrics.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/arch.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/arch.jpeg
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/dashboard.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/datasource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/datasource.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/grafana/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/grafana/.DS_Store
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/grafanapod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/grafanapod.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/import.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/import.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/k8scluster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/k8scluster.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/k8sdeploymetrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/k8sdeploymetrics.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/kubecluster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/kubecluster.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/login.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/prom.tar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/prom.tar
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/prometheus-ds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/prometheus-ds.png
--------------------------------------------------------------------------------
/Monitoring kubernetes with prometheus/upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Monitoring kubernetes with prometheus/upload.png
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/Chap10/main.c:
--------------------------------------------------------------------------------
1 | //#include "csapp.h"
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | int main() {
8 | int fd1, fd2;
9 |
10 | fd1 = open("foo.txt", O_RDONLY, 0);
11 | close(fd1);
12 | fd2 = open("baz.txt", O_RDONLY, 0);
13 | printf("fd2: %d\n", fd2);
14 | exit(0);
15 | }
16 |
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/hello:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/hello
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/hello.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main() {
4 | printf("Hello, World\n");
5 | }
6 |
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/hello.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/hello.o
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/hello.s:
--------------------------------------------------------------------------------
1 | .file "hello.c"
2 | .section .rodata
3 | .LC0:
4 | .string "Hello, Workd"
5 | .text
6 | .globl main
7 | .type main, @function
8 | main:
9 | .LFB0:
10 | .cfi_startproc
11 | pushq %rbp
12 | .cfi_def_cfa_offset 16
13 | .cfi_offset 6, -16
14 | movq %rsp, %rbp
15 | .cfi_def_cfa_register 6
16 | movl $.LC0, %edi
17 | call puts
18 | popq %rbp
19 | .cfi_def_cfa 7, 8
20 | ret
21 | .cfi_endproc
22 | .LFE0:
23 | .size main, .-main
24 | .ident "GCC: (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4"
25 | .section .note.GNU-stack,"",@progbits
26 |
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/helloworld:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/intro/helloworld
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/testplace/big-product:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/testplace/big-product
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/testplace/big-product.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main() {
4 | int a = 200;
5 | int b = 300;
6 | int c = 400;
7 | int d = 500;
8 |
9 | int product;
10 | product = a * b * c *d;
11 | printf("%d\n", product);
12 | }
13 |
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/testplace/byte-sequence.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | typedef unsigned char *byte_pointer;
4 |
5 | void show_bytes(byte_pointer start, int len) {
6 | printf("start: %p\nlen: %d\n", start, len);
7 | int i;
8 | for ( i = 0; i < len; i ++) {
9 | printf(" %.2x", start[i]);
10 | }
11 | printf("\n");
12 | }
13 |
14 | void show_int(int x) {
15 | show_bytes((byte_pointer) &x, sizeof(int));
16 | }
17 |
18 | void show_float(float x) {
19 | show_bytes((byte_pointer) &x, sizeof(float));
20 | }
21 |
22 | void show_pointer(void *x) {
23 | show_bytes((byte_pointer) &x, sizeof(void *));
24 | }
25 |
26 | int main() {
27 | int val = 1024;
28 | int ival = val;
29 | float fval = (float) ival;
30 | int *pval = &ival;
31 | printf("%p\n", &val);
32 | show_int(ival);
33 | show_float(fval);
34 | show_pointer(pval);
35 | }
36 |
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/testplace/dec-hex.perl:
--------------------------------------------------------------------------------
1 | #! /usr/bin/perl
2 | # Convert list of decimal numbers into hex
3 |
4 | for ($i = 0; $i < @ARGV; $i++) {
5 | printf("%d\t= 0x%x\n", $ARGV[$i], $ARGV[$i]);
6 | }
7 |
--------------------------------------------------------------------------------
/MyCS100/Architecture/ComputerSystemsAProgrammersPerspective/src/code/testplace/hex-dec.perl:
--------------------------------------------------------------------------------
1 | #! /usr/bin/perl
2 | # Convert list of hex numbers into decimal
3 |
4 | for ($i = 0; $i < @ARGV; $i++) {
5 | $val = hex($ARGV[$i]);
6 | printf("0x%x = %d\n", $val, $val);
7 | }
8 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/FAQ.md:
--------------------------------------------------------------------------------
1 | FAQ
2 | ===========
3 | 1. What is preload in MySQL?
4 |
5 | 2. What is sharding ?
6 |
7 | 3. What is join ?
8 |
9 | 4. What is associate ?
10 |
11 | 5. What is scope ?
12 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/Notes/Bit_Type.md:
--------------------------------------------------------------------------------
1 | Bit Type
2 | =======
3 |
4 | [bit-type](http://dev.mysql.com/doc/refman/5.7/en/bit-type.html)
5 | [bit-value-literals](http://dev.mysql.com/doc/refman/5.7/en/bit-value-literals.html)
6 |
7 | CREATE TABLE t(b BIT(8) ;
8 | ALTER TABLE t ADD COLUMN name VARCHAR(255) NOT NULL ;
9 | INSERT t VALUES(b'01001100', "mushroom");
10 | *SELECT * FROM t;*
11 | *L | mushroom*
12 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/Notes/Insert_on_duplicate_key_update.md:
--------------------------------------------------------------------------------
1 | [insert on duplicate](http://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html)
2 |
3 | INSERT INTO user(id, name, age) VALUES ("10000", "Jay", 30), ("10001", "Jen", 32) ON DUPLICATE KEY UPDATE age=100;
4 | or
5 | INSERT INTO user(id, name, age) VALUES ("10000", "Jay", 30), ("10001", "Jen", 32) ON DUPLICATE KEY UPDATE age=VALUES(age);
6 |
7 | ### Insert:
8 |
9 |
10 | ### Update:
11 |
12 | through INSERT ON DUPLICATE KEY UPDATE
13 |
14 | [](http://dba.stackexchange.com/questions/28282/whats-the-most-efficient-way-to-batch-update-queries-in-mysql)
15 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/Notes/Right_Join.md:
--------------------------------------------------------------------------------
1 | SELECT user.name, organization.name FROM user RIGHT JOIN organization ON user.orgId=organization.id;
2 | SELECT user.name, organization.name FROM user RIGHT JOIN organization ON user.orgId=organization.id WHERE organiztion.name="dev";
3 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/Notes/Update_No_Effect.md:
--------------------------------------------------------------------------------
1 | Update a table if the specific row doesn't exist, it will be okay.
2 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/ORM/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | =========
3 | ORM, refering to Object Relationship Management.
4 |
5 | We could get a list of popular ORM for golang from [awesome-go git repository](https://github.com/avelino/awesome-go#orm):
6 |
7 | * [beego orm](https://github.com/astaxie/beego/tree/master/orm)
8 | * [go store](https://github.com/gosuri/go-store)
9 | * [gomodel](https://github.com/cosiner/gomodel)
10 | * [gorm](https://github.com/jinzhu/gorm)
11 | * [gorp](https://github.com/go-gorp/gorp)
12 | * [QBS](https://github.com/coocood/qbs)
13 | * [reform](https://github.com/go-reform/reform)
14 | * [SQLBoiler](https://github.com/vattle/sqlboiler)
15 | * [Storm](https://github.com/asdine/storm)
16 | * [upper.io/db](https://github.com/upper/db)
17 | * [xorm](https://github.com/go-xorm/xorm)
18 | * [Zoom](https://github.com/albrow/zoom)
19 |
20 | Comparison:
21 |
22 | |Project|Stars|frequency|comment|
23 | |:-------:|:-----:|:---------:|:-------:|
24 | |beego orm|8756|A|
25 | |go store |75| | for Redis|
26 | |gomodel |50|
27 | |gorm |4589| B|
28 | |gorp |2260|C|
29 | |QBS |426|
30 | |reform |434|
31 | |SQLBoiler|325|
32 | |Storm |278|
33 | |upper.io/db|535|
34 | |xorm |1503|B|
35 | |zoom |144|
36 |
--------------------------------------------------------------------------------
/MyCS100/Database/MySQL/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ==========
3 | Let's talk about MySQL.
4 |
5 | It is often that we don't actually delete rows in the database table, but we do Soft Delete.
6 |
--------------------------------------------------------------------------------
/MyCS100/Database/Redis/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ==========
3 | Let's talk about Redis.
4 |
--------------------------------------------------------------------------------
/MyCS100/Hardware/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ============
3 |
4 | This part we will talk about computer hardware which is the basis of every computing.
5 |
--------------------------------------------------------------------------------
/MyCS100/Network/HTTP/Authorization/overview.md:
--------------------------------------------------------------------------------
1 | Authorization
2 | =============
3 | * HTTP Basic Auth
4 | * OAuth
5 |
--------------------------------------------------------------------------------
/MyCS100/Network/HTTP/Cache/overview.md:
--------------------------------------------------------------------------------
1 | Cache
2 | ========
3 | ### 背景
4 | 前端HTML更新后,必须手动刷新才能更新页面
5 |
6 | 解决方法:
7 | * 浏览器设置不缓存
8 | * 前端html代码添加xxx标记
9 | * 后端server返回一些控制头,比如Cache-Control: no-cache, mush-revalidate, max-age=0, no-store等
10 |
11 | 其他信息
12 | 多次刷新是cache-control:max-age=0
13 | 返回http code为304 Not Modified
14 | 请求的时候会发送If-Modified-Since的时间,服务器收到后与本地文件进行比较,如果不匹配,说明文件有改动。否则返回304.
15 |
16 | ### 参考
17 | * [](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)
18 | * [](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=zh-cn)
19 | * [](http://www.alloyteam.com/2012/03/web-cache-2-browser-cache/)
20 | * [](http://www.procata.com/cachetest/tests/pragma/fail.php)
21 |
--------------------------------------------------------------------------------
/MyCS100/Network/HTTP/Cookies/overview.md:
--------------------------------------------------------------------------------
1 | Cookies
2 | =========
3 | ### 背景
4 |
5 | 背景有二:
6 | 1. potatoHelper需要了解Cookies的基本原理,然后用来编写相应的golang程序。
7 | 2. YCE需要做一些会话管理,也应当补充相应的Cookies知识。
8 |
9 | ### Cookies的目标
10 | Cookies,不管它是小饼干或者什么你能叫得出名字的东西,它很有用。Cookies的主要目标是管理服务器和客户端之间的状态,这个状态就是Cookies。
11 |
12 | 所谓状态,尤其是现在常说的微服务里,通常建议采用无状态的服务,这个状态本质上是描述系统的某种状态的数据。
13 |
14 | ### Cookies相关的标准
15 |
16 | Cookies并没有被编入标准化的HTTP/1.1的RFC2616中,而网景公司于1994年前后设计并制定了相关规格标准,除此之外还有RFC2109, RFC2965以及RFC6265。但目前最常见的Cookies并不是属于任何一个RFC,是基于网景公司的业界事实标准进行的扩展(严格来说,cookie0是网景扩展,cookie1是RFC2965,但没有cookie0应用广泛)。
17 |
18 | Cookies的工作机制是用户识别及状态管理。网站为了管理用户,会在用户访问时将一些数据写入用户计算机内,用户随后访问网站可以获取到这些Cookies。
19 |
20 | 因为浏览器端负责存放了数据,因此称为“客户端侧状态”。这个Cookie规范的正式名称为HTTP状态管理机制(HTTP management mechanism)。
21 |
22 | ### Cookies的首部和方法
23 |
24 | Cookies的首部字段:
25 |
26 | |首部字段名|说明|首部类型|
27 | |:--------:|:--:|:------:|
28 | |Set-Cookie|开始状态管理所使用的Cookie信息|响应首部|
29 | |Cookie|服务器接收到的Cookie信息|请求首部|
30 |
31 | 具体来说,Set-Cookie字段的属性:
32 |
33 | |属性|说明|
34 | |:--:|:--:|
35 | |NAME=VALUE|Cookie的键和值|
36 | |expires=DATE|过期时间(默认为浏览器关闭),格式为DD-Mon-YY HH:MM:SS GMT|
37 | |domain=域名|Cookie作用的域名,只有这个域才能看到这个Cookie|
38 | |path=PATH|路径(将服务器上的文件目录作为Cookie的适用对象),比域更细的绑定|
39 | |Secure|仅在HTTPS时发送|
40 | |HttpOnly|使得Cookie不能被Javascript脚本访问|
41 |
42 |
43 | 需要注意的是:
44 |
45 | * Cookies一旦发送给客户端,服务器端是无法直接删除的,只能将其覆盖。
46 | * domain属性可做到跟结尾匹配一致。所以除了针对具体指定的多个域名发送Cookie之外,不指定domain属性显得更安全。
47 | * HttpOnly用于防止跨站脚本攻击(Cross-site-scripting, XSS)对Cookie信息的窃取。但该特性并非是为了防止XSS而开发的。
48 | * 除了Set-Cookie外,还有个Set-Cookie2
49 |
50 | cookie1的Set-Cookie2的部分首部:
51 | |属性|说明|
52 | |:--:|:--:|
53 | |Discard|如果提供了这个属性,就会在客户端程序终止时,指示客户端放弃这个Cookie。|
54 | |Max-Age|用于设置cookie的生存期。单位为秒,如果为0表示立即丢弃|
55 | |Port|同Domain,Path,用于提供更精确的绑定|
56 |
57 |
58 | 用户在调用Cookie时,由于可以校验Cookie的有效期、发送方的域、路径、协议等信息,因此正规发布的Cookie是不会被其他Web站点攻击或泄露。
59 |
60 | Cookie的存在也影响了缓存,大多数缓存和浏览器都不允许对任何cookie的内容进行缓存。
61 |
62 | ### Cookies的类型
63 |
64 | 会话Cookie和持久Cookie。
65 |
66 | * 会话Cookie会用来保存用户本次访问时的一些偏好等,用户退出后失效。
67 | * 持久Cookie会用来保存用户周期性访问站点的配置文件、用户名等,用户退出后仍有效。
68 |
69 | 它们的唯一区别就是过期时间。如果设置了Discard参数或没有设置Expires或Max-age参数来说明扩展时间,那么这个cookie就是一个会话cookie。
70 |
71 | ### Cookies的工作原理
72 | 用户首次访问网站时,网站对用户一无所知,然后给用户贴上一些标记,这些标记就是Cookie,通过Set-Cookie或Set-Cookie2来确定。用户的浏览器收到这些Cookie后会保存到自身的数据库中,以便用户再次访问该网站时读取使用。
73 |
74 | 多数浏览器会将Cookie写到本地的一个文件里。往往也称之为“Cookie罐”。
75 |
76 | 浏览器在发送Cookie的时候不会将全部Cookie发往各个网站,除了隐私问题外,A网站的cookie对B网站是无效的,另外就是实际传输的数据量要大于Cookie里看见的。
77 |
78 | ### Cookie与缓存
79 |
80 | * 文档的所有者最好说明文档是否是可以缓存的,如果无法缓存,要标识出来。
81 | * 设置了Set-Cookie首部之外的文档是可缓存的,就使用Cache-Control: no-cache="Set-Cookie"。和为可缓存的文档使用Cache-Control: public。
82 | * 缓存Set-Cookie首部是要小心。
83 | * 小心处理带有Cookie首部的请求。一定要将私有内容标识为不可缓存的。
84 |
85 | ### 拓展
86 |
87 | 往往我们会在浏览某个技术网站时,看到旁边的小窗内有某购物网站的小广告,上面刚好是我们之前搜索过的推荐。广告商除了可以根据IP来返回推荐外,还可以利用Cookie来实现。广告商通过和这些站点进行合作,将广告内容作为一个持久Cookie。当用户访问到这些站点时,由于是同一个域(同一家广告商),与Referer首部结合,所以会将用户的历史累计数据进行分析后完成推荐。当然现代很多浏览器都可以允许用户保护隐私,限制第三方Cookie的使用。
88 |
89 | 胖URL是嵌入了状态的URL。
90 |
91 | ### 遗留问题
92 |
93 | * 缓存Cookie时的一些细节
94 | * Amazon.com是如何通过会话cookie来跟踪用户的
95 |
96 | ### 参考资料
97 | 1. 图解HTTP,【日】上野 宣 著。于均良 译。人民邮电出版社
98 | 2. HTTP权威指南,【美】David Gourley 等著。陈涓, 赵振平 译。人民邮电出版社。
99 |
100 |
101 |
--------------------------------------------------------------------------------
/MyCS100/Network/HTTP/HTTPS/overview.md:
--------------------------------------------------------------------------------
1 | HTTPS
2 | ========
3 | * self-signed certification, nginx, https
4 | * white list, https
5 |
--------------------------------------------------------------------------------
/MyCS100/Network/HTTP/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ===========
3 | The Web development no matter frontend or backend, it's all based on HTTP, the most reason who makes our daily life so colorful.
4 |
5 | [RFC2616](https://www.w3.org/Protocols/rfc2616/rfc2616.html)
6 |
--------------------------------------------------------------------------------
/MyCS100/Network/HTTP/WebSocket/overview.md:
--------------------------------------------------------------------------------
1 | WebSocket
2 | ==========
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MyCS100/Network/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ==========
3 |
4 | This part we will dig into networks.
5 |
--------------------------------------------------------------------------------
/MyCS100/OperatingSystems/LinuxKernel/Understanding-Linux-Kernel/Bootstrap.md:
--------------------------------------------------------------------------------
1 | Bootstrap--系统启动
2 | =================
3 | 计算机系统启动的过程,从上电,到自检,到引导操作系统至完成,实现了对计算机控制权的转移的过程。
4 |
5 | 启动的过程完成了三件事:
6 | * 加载*部分*操作系统代码到内存
7 | * 初始化内核数据结构(只有静态吧?)
8 | * 控制权的转移
9 |
10 |
11 | ### BIOS时代
12 | RAM是随机读写存储器,常称为主存或内存。它的特点是造价较昂贵且空间略小,读写速度快但是断电后数据即丢失。书上说“加电的那一刻RAM芯片里包含的是随机数据”。这里有个问题,断电后RAM不是数据丢失了?数据是清零了还是变成了无法预测的数据?为什么在加电的时候数据会是随机的?
13 |
14 | 开始启动之后,会给CPU的一个引脚加电置RESET信号,它会初始化CPU的寄存器,比如CS和EIP。CS和EIP寄存器分别是什么?
15 |
16 | 接着会将物理地址为0xfffffff0处的程序装入ROM(即平常所说的BIOS程序),然后完成硬件设备的初始化。这是什么存储器的物理地址?为什么是这个地址?
17 |
18 | 实模式下执行完BIOS,然后到保护模式,为各个硬件设备提供设备驱动程序。实模式的地址为基址+偏移的形式。所以CPU在寻址的时候就不需要GDT、LDT和页表将逻辑地址(虚地址)转换为物理地址了。
19 |
20 | BIOS做了四件事情:
21 | * 测试计算机的硬件(加电自检:Power-On Self Test),建立几个表来描述硬件设备。
22 | * 初始化硬件设备。这个操作阶段可以保证IRQ线和I/O端口不冲突。那么会有什么冲突?
23 | * 搜索一个操作系统来启动。找软盘、硬盘、CD-ROM的第一个扇区(存放分区表)。
24 | * 将第一个扇区的内容拷贝到RAM中从0x00007c00开始的位置,并执行刚才装载的代码。为什么是这个地址?
25 |
26 | ### 引导装入程序(boot loader)
27 | 它是BIOS用来将内核映像装载到RAM中需要用到的一个程序。硬盘的第一个扇区称为主引导记录(Master Boot Record,MBR)。该扇区中包括分区表和一个小程序。这个小程序被用来装载操作系统所在分区的第一个扇区。
28 |
29 | 常见的Boot Loader有LILO(LInux LOader)和GRUB(GRand Unified Bootloader)。GRUB更为先进,它可以识别多个分区中的操作系统,还可以从文件中读入部分操作系统。
30 |
31 |
--------------------------------------------------------------------------------
/MyCS100/OperatingSystems/LinuxKernel/Understanding-Linux-Kernel/OS-Basis.md:
--------------------------------------------------------------------------------
1 | Linux操作系统基本知识
2 | =====================
3 | 脱离了架构谈操作系统有点耍流氓。
4 |
--------------------------------------------------------------------------------
/MyCS100/OperatingSystems/LinuxKernel/Understanding-Linux-Kernel/overview.md:
--------------------------------------------------------------------------------
1 | Understanding the Linux Kernel(ULK,深入理解Linux内核)
2 | ======================================================
3 |
4 | 四个问题:
5 | 1. 进程(第3、4、5、7、19、20章)--\__第9章----\
6 | 2. 内存管理(第2、8、15、17章) ---/ --------第10、11章
7 | 3. 文件系统(第12、16、18章) ----------------/
8 | 4. 其他(第1、6、13、14章、附录1、2)
9 |
10 |
11 |
--------------------------------------------------------------------------------
/MyCS100/OperatingSystems/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ===========
3 |
4 | This part we will talk about operating systems.
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MyCS100/Security/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | =========
3 |
4 | Security is the most often topic in the long run.
5 |
--------------------------------------------------------------------------------
/MyCS100/Security/RBAC/Role-Based-Access-Controls.md:
--------------------------------------------------------------------------------
1 | Role Based Access Controls
2 | ---------------------------
3 | —David F, D.Richard
4 | -NIST
5 |
6 | ### Abstract
7 |
8 | 在当时,具有多层安全级别的军队采用的是MAC(Mandatory Access Control)访问控制策略,政府和一般企业采用的是比较随意的DAC(Discretionary Access Control)。这篇论文提出对于一般的商业和政府组织使用DAC是没有根据的,同时也不够恰当,因此提出了RBAC模型。
9 |
10 | ### Introduction
11 | 由TCSEC: Trusted Computer Security Evaluatation Criteria提出了计算机安全标准,目的是防止对机密文件未授权的访问。主要提出了前面所说的DAC和MAC。
12 |
13 |
14 | ### Aspects of Security Policies
15 |
16 | 对可信数据(Confidentiality)和完整性(Integrity)的顾虑
17 |
18 | DAC is an access control mechanism that permits system users to allow / disallow other users access to objects under their control: A means of restricting access to objects based on identity of subjects and / or groups which they belong.
19 |
20 | 很多时候对于数据的权限取决于员工的角色而不是这些数据的归属。
21 |
22 | RBAC policy bases access control decisions on the functions a user is allowed to perform within an organization.
23 |
24 | RBAC本质上是一种MAC,但又不同于TCSEC的多级MAC,它更专注于对功能(function)和信息的访问,而不是只严格限制对信息的访问。
25 |
26 | Who can perform what act of what information
27 |
28 | Roles are group oriented. Each role has a associated set of individual members.
29 |
30 | 
31 |
32 | ### Formal description of RBAC
33 | 
34 | 
35 |
36 | ### Centrally Administering Security Using RBAC
37 |
38 | 
39 |
40 |
41 | ### The Least Privilege Principle
42 |
43 | ### Seperation of Duties
44 | Static policy: checking only roles for users
45 | Dynamic policy: use both role and UserID in checking access to transactions
46 |
47 | ### Summary and Conclusion
48 |
--------------------------------------------------------------------------------
/MyCS100/Security/RBAC/pics/3-basic-rules-of-rbac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Security/RBAC/pics/3-basic-rules-of-rbac.png
--------------------------------------------------------------------------------
/MyCS100/Security/RBAC/pics/formal-description-of-rbac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Security/RBAC/pics/formal-description-of-rbac.png
--------------------------------------------------------------------------------
/MyCS100/Security/RBAC/pics/multi-role-relationships.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Security/RBAC/pics/multi-role-relationships.png
--------------------------------------------------------------------------------
/MyCS100/Security/RBAC/pics/role-based.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/MyCS100/Security/RBAC/pics/role-based.png
--------------------------------------------------------------------------------
/MyCS100/Security/SQL/overview.md:
--------------------------------------------------------------------------------
1 | SQL
2 | =======
3 | SQL is easy to be cracked.
4 |
--------------------------------------------------------------------------------
/MyCS100/Security/SQL/sql-inject.md:
--------------------------------------------------------------------------------
1 | SQL注入
2 | =======
3 |
4 | ### MySQL注入
5 | 如果你将用户输入的原始数据直接插入数据库,假设用户输入的不是所要求的字符串,而是一句SQL,那么这就造成了极大的安全隐患,即MySQL注入。它会在你不知不觉的情况下完成对数据库的操作。
6 |
7 | #### 一个例子
8 | ```MySQL&PHP
9 | // a good user's name
10 | $name = "Jimmy";
11 | $query = "SELECT * FROM users WHERE username = '$name'";
12 | SELECT * FROM users WHERE username = "Jimmy";
13 |
14 | // user input that uses SQL Injecttion
15 | $name_bad = "'OR 1'";
16 |
17 | // our MySQL query builder is not a very safe one
18 | $query_bad = "SELECT * FROM users WHERE username = '$name_bad'";
19 |
20 | // display what the query will look like, with injection:
21 | SELECT * FROM users WHERE username = "OR 1";
22 | ```
23 |
24 | 好的SQL当然没什么问题。坏的这个query_bad会让查询变得跟我们的预期不一致。
25 |
26 | 它们可能会使用一对单引号来结束我们SQL查询中的字符串,然后带上一个恒成立的OR 1。这样,SQL中的WHERE就失去了它的作用。
27 |
28 | 上面的还算好的,攻击者通过此方法获取大量的信息。更为糟糕的是,攻击者可以通过DELETE来清空这张表:
29 |
30 | ```MySQL&PHP
31 | $name_evil = "'; DELETE FROM customers WHERE 1 or username ='";
32 | // our MySQL query builder really should check for injection
33 | $query_evil = "SELECT * FROM users WHERE username = '$name_evil'";
34 |
35 | // the new evil injection query would include a DELETE statement
36 | SELECT * FROM users WHERE username = ''; DELETE FROM users WHERE 1 or username=''
37 | ```
38 |
39 | ### 如何防止
40 | 在PHP里,应用函数*mysql_real_escape_string来防止这些攻击。它会将SQL语句中可能存在的注入攻击剔除掉,然后重新生成SQL语句。基本上,它将带来问题的单引号'替换为转义单引号\'。
41 |
42 | 前面的SQL语句将会转换为:
43 |
44 | SELECT * FROM users WHERE name = '\' OR 1 '\';
45 | SELECT * FROM users WHERE name = '\'; DELETE FROM users WHERE 1 or name = \'';
46 |
47 | 在golang中,通过[]interface{}类型的变量vals,将每个DOM的成员通过append(vals, u.name, u.age),然后拼接VALUES(?),执行stmt.Exec(vals...)的变参来实现bulk。
48 |
49 |
50 | 在写代码里SQL语句的时候需要预编译(?形式),需要使用占位符。如果采用字符串拼接的话,例如故意输入某些值使得一个查询语句变成如下的形式,就完成了一次SQL注入:
51 | ```SQL
52 | SELECT id,name,status FROM users WHERE age > 20 OR 1=1;
53 | ```
54 | 在这种情况下,该语句一直成立,就会一直执行最终造成某些损害。
55 |
56 |
57 | ### 参考
58 | [Mysql php sql injection](http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php)
59 | [Build web application with golang](https://astaxie.gitbooks.io/build-web-application-with-golang/content/zh/09.4.html)
60 |
61 | Single Quote and Double Quote's Difference
62 | How golang prevent sql inject using prepare and query?
63 | How could we prevent sql inject while making sql batch ?
64 |
65 | * 增加对用户输入值的校验,利用正则工具等
66 | * 将特殊字符转义
67 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/Overview.md:
--------------------------------------------------------------------------------
1 | Serverless
2 | ===========
3 |
4 | Serverless may be the future.
5 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/faas/fission/fission-nodeport.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: router
5 | namespace: fission
6 | labels:
7 | svc: router
8 | spec:
9 | type: NodePort
10 | ports:
11 | - port: 80
12 | targetPort: 8888
13 | nodePort: 31314
14 | selector:
15 | svc: router
16 |
17 | ---
18 | apiVersion: v1
19 | kind: Service
20 | metadata:
21 | name: controller
22 | namespace: fission
23 | labels:
24 | svc: controller
25 | spec:
26 | type: NodePort
27 | ports:
28 | - port: 80
29 | targetPort: 8888
30 | nodePort: 31313
31 | selector:
32 | svc: controller
33 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/faas/fission/fission.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Namespace
3 | metadata:
4 | name: fission
5 | labels:
6 | name: fission
7 |
8 | ---
9 | apiVersion: v1
10 | kind: Namespace
11 | metadata:
12 | name: fission-function
13 | labels:
14 | name: fission-function
15 |
16 | ---
17 | apiVersion: extensions/v1beta1
18 | kind: Deployment
19 | metadata:
20 | name: controller
21 | namespace: fission
22 | spec:
23 | replicas: 1
24 | template:
25 | metadata:
26 | labels:
27 | svc: controller
28 | spec:
29 | containers:
30 | - name: controller
31 | image: fission/fission-bundle:alpha
32 | command: ["/fission-bundle"]
33 | args: ["--controllerPort", "8888", "--filepath", "/filestore"]
34 |
35 | ---
36 | apiVersion: extensions/v1beta1
37 | kind: Deployment
38 | metadata:
39 | name: router
40 | namespace: fission
41 | spec:
42 | replicas: 1
43 | template:
44 | metadata:
45 | labels:
46 | svc: router
47 | spec:
48 | containers:
49 | - name: router
50 | image: fission/fission-bundle:alpha
51 | command: ["/fission-bundle"]
52 | args: ["--routerPort", "8888"]
53 |
54 | ---
55 | apiVersion: v1
56 | kind: Service
57 | metadata:
58 | name: poolmgr
59 | namespace: fission
60 | labels:
61 | svc: poolmgr
62 | spec:
63 | ports:
64 | - port: 80
65 | targetPort: 8888
66 | selector:
67 | svc: poolmgr
68 |
69 | ---
70 | apiVersion: extensions/v1beta1
71 | kind: Deployment
72 | metadata:
73 | name: poolmgr
74 | namespace: fission
75 | spec:
76 | replicas: 1
77 | template:
78 | metadata:
79 | labels:
80 | svc: poolmgr
81 | spec:
82 | containers:
83 | - name: poolmgr
84 | image: fission/fission-bundle:alpha
85 | command: ["/fission-bundle"]
86 | args: ["--poolmgrPort", "8888"]
87 |
88 | ---
89 | apiVersion: v1
90 | kind: Service
91 | metadata:
92 | name: etcd
93 | namespace: fission
94 | labels:
95 | svc: etcd
96 | spec:
97 | ports:
98 | - port: 2379
99 | targetPort: 2379
100 | selector:
101 | svc: etcd
102 |
103 | ---
104 | apiVersion: extensions/v1beta1
105 | kind: Deployment
106 | metadata:
107 | name: etcd
108 | namespace: fission
109 | spec:
110 | replicas: 1
111 | template:
112 | metadata:
113 | labels:
114 | svc: etcd
115 | spec:
116 | containers:
117 | - name: etcd
118 | image: quay.io/coreos/etcd
119 | env:
120 | - name: ETCD_LISTEN_CLIENT_URLS
121 | value: http://0.0.0.0:2379
122 | - name: ETCD_ADVERTISE_CLIENT_URLS
123 | value: http://etcd:2379
124 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/faas/fission/hello.js:
--------------------------------------------------------------------------------
1 | module.exports = function(context, callback) { callback(200, "Hello, world!
2 | "); }
3 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/faas/overview.md:
--------------------------------------------------------------------------------
1 | faas
2 | =========
3 | FaaS refers to Functions as a Service
4 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/faas/papers/Function-as-a-service-an-ad-hoc-approach-to-cloud-computing.md:
--------------------------------------------------------------------------------
1 | 函数即服务,云计算的点对点方式
2 | ===============================
3 |
4 | ### 摘要
5 | 传统应用更适用于客户端-服务器模型。当这是无价值的服务,疑问这样的形式和研究在传统模型上云计算的使用很重要。
6 |
7 | 这篇论文里,我们定义了Function as a Service。更接近于分布式系统模型而不是客户端服务器模型。在这个形式下,云和解释型语言有更直接的关系,允许软件通过API利用云的计算资源。我们定义了一个模型,对于云认证,允许开发者不仅可以维持对它们的应用与云的交互的控制,还加强用户来选择它们的云提供商,和它们定义云的交互而不用担心开发者。
8 |
9 | ### 结论
10 | 我们相信这个模型展现了标准云计算模型的对立面,允许设备和云之间的新的交互。它启用了点对点的方法,本地执行可选,依靠请求创建多个设备的共享状态。它也让用户可以更容易控制他们的云的交互,启动基于云的开元项目和允许软件来操作在开发者注意力之上的东西。
11 |
12 | 文中没有评价性能。只是展现了FaaS的基本概念,通过解释型语言可展现的,比如Python,它允许通过标准云计算模型会比较困难的交互。它也展现了在这种工作流下不同的应用操作,对应于传统的云,展现的这些就是清晰的优点。
13 |
--------------------------------------------------------------------------------
/MyCS100/Serverless/faas/papers/Your-Server-as-a-Function.md:
--------------------------------------------------------------------------------
1 | 函数是你的服务器
2 | ================
3 |
4 | ### 摘要
5 | 在大规模设置里搭建服务器软件,系统表现出来高度的并发和环境变化。这是一个挑战。效率、安全和鲁棒性是首要的目标。与传统的模块化、重用和灵活性冲突。
6 |
7 | 提出了三种抽象,联合展现了一个强大的编程模型:构建安全、模块化、和高效的服务器程序:解耦的futures被应用到关联并发、异步操作;services和filters是特定的函数,被用来组合模块为复杂的服务器程序。
8 |
9 | 最后,我们讨论了在Twitter的服务基础设施中使用这些抽象和技术的经历。
10 |
11 |
12 | ### 结论
13 | 通过futures,services和filters构建服务器程序。通过future是我们的基础抽象,用来表达并发、异步操作的关系。services和filters用来构建服务器和客户端,他们是对称的,就像模块化风格。
14 |
15 | 结合在一起,这些抽象构建了一个直交的基本概念。通过它,我们可以在我们期望的环境里构建服务器软件。挑选一个少量的、深思熟虑的抽象来构成这样的基本概念非常合算。除了简化我们的软件和让它更容易理解外,服务被一件一件地拼起来,通过组合其他更小的部分。鼓励开发者在流水线上拼装他们的应用。这导致对小的、直交的、可重用组件结合起来使用的急切渴望。这是一种软件工具的方法来创建服务器软件。还有,无可变性的强调,导致代码很容易理解,和清晰化的模块边界。
16 |
17 | 最后,因为由futures,services和filters所提供的高级抽象,程序语义被从执行技术中解放:一个由RPC系统实现的隔离的运行时-Finagle,允许开发者专注于他们的应用。隔离运行时让代码与执行策略松绑,这样还加强了模块化。
18 |
--------------------------------------------------------------------------------
/MyCS100/Storage/Ceph/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ==========
3 | This part is all about distributed storage system: Ceph.
4 |
--------------------------------------------------------------------------------
/MyCS100/Testing/BDD/overview.md:
--------------------------------------------------------------------------------
1 | Behavior Driven Development
2 | ==========================
3 | [BDD](http://www.cnblogs.com/coderzh/archive/2009/07/26/1531633.html)
4 |
--------------------------------------------------------------------------------
/MyCS100/Testing/Overview.md:
--------------------------------------------------------------------------------
1 | Overview
2 | ========
3 | TDD
4 | BDD
5 |
--------------------------------------------------------------------------------
/MyCS100/Tools/VersionControlSystem/Git/overview.md:
--------------------------------------------------------------------------------
1 | Git
2 | =======
3 | Git and Github, Gitlab
4 |
--------------------------------------------------------------------------------
/MyCS100/Tools/VersionControlSystem/Overview.md:
--------------------------------------------------------------------------------
1 | VersionControlSystem
2 | ====================
3 | We will like to use one of the VCS tools to help with organizing our code and docs like:
4 | * SVN
5 | * Git
6 | * etc
7 |
--------------------------------------------------------------------------------
/MyCS100/Tools/VersionControlSystem/Svn/Overview.md:
--------------------------------------------------------------------------------
1 | Svn
2 | =======
3 |
--------------------------------------------------------------------------------
/OpenFreeShare/Readme.md:
--------------------------------------------------------------------------------
1 | OFS, refering to Open Free Share.
2 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/Readme.md:
--------------------------------------------------------------------------------
1 | A brief introduction to golang in a beginner's perspective
2 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/article.md:
--------------------------------------------------------------------------------
1 | A brief introduction to golang -- a beginners perspective
2 | ----------------------------------------
3 |
4 | Outline:
5 | * Overview
6 | * Golang Web Programming
7 | * Golang System Programming
8 | * Pros & Cons
9 |
10 | ### Overview
11 | 2007年的时候,三巨头Robert Griesemer,Rob Pike,Ken Thompson有了创造一门新语言的idea,[为了什么目的?]。这三位都是神一般的存在,名声如雷贯耳的Ken Thompson,他是google员工,是Unix、C的作者之一,就连我们现在用的utf-8编码也是他打造的。
12 |
13 | 在这三位的带领下,Golang在2009年正式开源,在2012年发布了1.0版本。去年的8月份更新了1.7版本,我们的容器云就是用1.7的版本写的。最近有消息表示golang的1.8版本提供了对动态链接库的支持,这个版本也即将发布。
14 |
15 | Golang一开源就吸引了很多开发者的青睐。到目前在Github上,已有超过700名贡献者提交了30,000次代码,收到23,000颗星的同时,还有3,000次fork。这无不标识着golang的火热。另一方面今年来由Golang编写Docker、Etcd以及Kubernetes等容器技术、分布式系统的热潮也为golang吸引了众多的粉丝。
16 |
17 | ### Golang Web Programming
18 | Golang标准库里提供的net包,支持基于IP层、TCP/UDP层以及更高层(HTTP、FTP、SMTP)的网络操作。比如定义了客户端和服务端之间请求和相应的传输标准的HTTP是互联网上应用最为广泛的一种网络协议,通过net/http包我们可以很轻松地使用GET请求和POST请求交互数据。
19 |
20 | 下面是一个最简单的Web Server的例子
21 |
22 |
23 | 下面实现了一个HTTP客户端和服务器端
24 |
25 |
26 | 网络包方面的第三方包邮Gorilla/Mux,beego、iris。iris是比较轻量的web server引擎,它自己号称是地球上最快的web server。容器云就是在它的基础上搭建的。
27 |
28 | 同时,golang标准库也提供了对rpc的支持,下面是一个rpc客户端和服务器端的例子
29 |
30 | ### Golang system programming
31 | Golang标准库里自带了os、syscall等包,里面实现了很多和操作系统相关的类型及方法。比如Docker容器,就利用了golang亲近底层的特性,通过多个系统调用,创建了相应的namespace和cgroups等,最终提供容器环境。我们可以用少于100行的golang代码表示一个简单的容器:
32 |
33 | 从某些角度来说Golang并不是一门系统语言,因为它具有垃圾回收机制。但它也可以被看作是一门系统语言,因为它可以用来开发一些非核心工具,比如应用容器等,比如Docker和Etcd都使用Golang进行了开发。
34 |
35 | 有人认为golang满足下面五个特点,因而可以认为是系统级语言:
36 | * open source, google
37 | * fast、simple、safe
38 | * concurrent,modern
39 | * good cross-platform support
40 | * rapid development and growing community
41 |
42 | Golang可以用来写一些底层的内容,比如编译器甚至内核?Golang可以和C语言混合使用。上到用户友好的命令行接口,下到底层巨大的分布式系统。Golang都能一展身手。
43 |
44 | 对Docker有点了解的话都知道Docker是基于Linux 的Namespace和CGroups机制来实现的。Docker本身也是由Golang编写的。那么我们可以试着自己写一个简化的容器。应用golang,在100行代码以内,我们就可以实现这个目标。
45 |
46 | 在以前Linux有一个叫chroot的命令/系统调用,它可以修改根目录,将用户“囚禁”到某一个目录下。用户在这个目录下看到的根/实际上在外面并不是根目录,而且不能访问外面的内容。
47 |
48 | Demo
49 |
50 | ### Pros & Cons
51 | #### Golang Features
52 | 跨平台(Linux、Windows、MacOS等)
53 | 具有动态特征的静态语言
54 | 适合高并发和大量I/O操作的服务器开发
55 |
56 | #### Golang tools / IDE
57 | 我们使用的主要是
58 |
59 | #### Golang vs Java / Python
60 | TIOBE排名
61 | 这些都是别人总结的一些:
62 | vsJava:
63 | Common:
64 | * C family(imperative, braces)
65 | * Stataically typed
66 | * Garbage collected
67 | * Memory safe(nil references, runtime bounds)
68 | * Variables are always intialized(zero/nil/false)
69 | * Methods
70 | * Interfaces
71 | * Type assertions(instanceof)
72 | * Reflection
73 |
74 | Differences:
75 | * Compile, no VM
76 | * Statically linked binaries
77 | * Control over memory layout
78 | * Function values and lexical closures
79 | * Built-in strings(UTF-8)
80 | * Built-in generic maps and arrays/slices
81 | * Built-in concurrency
82 |
83 | No
84 | * Classes
85 | * Constructors
86 | * Inheritance
87 | * final
88 | * Exceptions
89 | * Annotations
90 | * User-defined generics
91 |
92 | #### Cloud Native
93 | 12 Factors app
94 |
95 |
96 |
97 | #### Reference
98 | [](http://letzgro.net/blog/9-reasons-to-choose-golang-for-your-next-web-application/)
99 | [](https://www.quora.com/Is-Go-a-systems-programming-language)
100 | [](http://coolshell.cn/articles/17010.html)
101 | [](https://talks.golang.org/2015/go-for-java-programmers.slide#14)
102 | [](https://talks.golang.org/2016/applicative.slide#13)
103 | [](https://talks.golang.org/2015/simplicity-is-complicated.slide#11)
104 | [](http://www.dockerinfo.net/4123.html)
105 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/advanced-http-server/client.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "io/ioutil"
6 | "log"
7 | "net/http"
8 | )
9 |
10 | func main() {
11 | resp, err := http.Get("http://localhost:8081")
12 | if err != nil {
13 | log.Println(err)
14 | }
15 | defer resp.Body.Close()
16 |
17 | body, err1 := ioutil.ReadAll(resp.Body)
18 | if err1 != nil {
19 | log.Println(err)
20 | }
21 |
22 | fmt.Printf("%s", string(body))
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/advanced-http-server/proxy.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "io/ioutil"
6 | "log"
7 | "net/http"
8 | )
9 |
10 | var host string
11 | var port string
12 |
13 | func Get(w http.ResponseWriter, r *http.Request) {
14 | url := "http://" + host + ":" + port
15 | resp, err := http.Get(url)
16 | if err != nil {
17 | log.Println(err)
18 | return
19 | }
20 |
21 | body, _ := ioutil.ReadAll(resp.Body)
22 | defer resp.Body.Close()
23 |
24 | fmt.Fprintf(w, "%s", string(body))
25 |
26 | }
27 |
28 | func Post(w http.ResponseWriter, r *http.Request) {
29 |
30 | }
31 |
32 | func Unknown(w http.ResponseWriter, r *http.Request) {
33 |
34 | }
35 |
36 | func main() {
37 |
38 | host = "localhost"
39 | port = "8080"
40 |
41 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
42 | switch r.Method {
43 | case "GET":
44 | Get(w, r)
45 | case "POST":
46 | Post(w, r)
47 | default:
48 | Unknown(w, r)
49 | }
50 | })
51 | log.Println("proxy listening :8081")
52 | http.ListenAndServe(":8081", nil)
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/advanced-http-server/proxy1.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | "net/http"
6 | "net/http/httputil"
7 | "net/url"
8 | )
9 |
10 | type handle struct {
11 | host string
12 | port string
13 | }
14 |
15 | func (h handle) ServeHTTP(w http.ResponseWriter, r *http.Request) {
16 | remote, err := url.Parse("http://" + h.host + ":" + h.port)
17 | if err != nil {
18 | log.Println(err)
19 | return
20 | }
21 |
22 | proxy := httputil.NewSingleHostReverseProxy(remote)
23 | proxy.ServeHTTP(w, r)
24 | }
25 |
26 | func main() {
27 | h := &handle{host: "localhost", port: "8080"}
28 | log.Println("proxy listening :8081")
29 | http.ListenAndServe(":8081", h)
30 | }
31 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/advanced-http-server/server.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "net/http"
7 | )
8 |
9 | func main() {
10 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
11 | fmt.Fprintf(w, "Hello World!\n")
12 | })
13 |
14 | log.Println("Server Listening :8080")
15 | http.ListenAndServe(":8080", nil)
16 | }
17 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/advanced-http-server/src.md:
--------------------------------------------------------------------------------
1 | ```golang
2 | resp, err := http.Get("http://localhost:8081")
3 | if err != nil {
4 | log.Println(err)
5 | }
6 | defer resp.Body.Close()
7 |
8 | body, err1 := ioutil.ReadAll(resp.Body)
9 | if err1 != nil {
10 | log.Println(err)
11 | }
12 |
13 | fmt.Printf("%s", string(body))
14 |
15 | ```
16 | ```golang
17 | remote, err := url.Parse("http://" + h.host + ":" + h.port)
18 | if err != nil {
19 | log.Println(err)
20 | return
21 | }
22 |
23 | proxy := httputil.NewSingleHostReverseProxy(remote)
24 | proxy.ServeHTTP(w, r)
25 |
26 | ...
27 | log.Println("proxy listening :8081")
28 | http.ListenAndServe(":8081", h)
29 | ```
30 | ```golang
31 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
32 | fmt.Fprintf(w, "Hello World!\n")
33 | })
34 |
35 | log.Println("Server Listening :8080")
36 | http.ListenAndServe(":8080", nil)
37 |
38 | ```
39 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/rpc-cs/rpc-client.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "net/rpc"
7 | )
8 |
9 | type Args struct {
10 | A, B int
11 | }
12 |
13 | func main() {
14 | client, err := rpc.DialHTTP("tcp", "localhost:8080")
15 | if err != nil {
16 | log.Fatal("Dialing:", err)
17 | }
18 |
19 | //Synchronous call
20 | args := Args{17, 8}
21 | var reply int
22 | err = client.Call("Arith.Multiply", args, &reply)
23 | if err != nil {
24 | log.Fatal("arith error:", err)
25 | }
26 | fmt.Printf("Arith: %d * %d = %d\n", args.A, args.B, reply)
27 |
28 | // Asynchronous call
29 | // client.Go()
30 | }
31 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/rpc-cs/rpc-server.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "net/http"
7 | "net/rpc"
8 | )
9 |
10 | type Args struct {
11 | A, B int
12 | }
13 |
14 | type Arith int
15 |
16 | func (t *Arith) Multiply(args *Args, reply *int) error {
17 | *reply = args.A * args.B
18 | return nil
19 | }
20 |
21 | func main() {
22 | arith := new(Arith)
23 | rpc.Register(arith)
24 | rpc.HandleHTTP()
25 |
26 | log.Println("rpc server listening :8080")
27 | err := http.ListenAndServe(":8080", nil)
28 | if err != nil {
29 | fmt.Println(err.Error())
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/rpc-cs/rpc.md:
--------------------------------------------------------------------------------
1 | ```golang
2 | // main
3 | ...
4 | client, err := rpc.DialHTTP("tcp", "localhost:8080")
5 | err = client.Call("Arith.Multiply", args, &reply)
6 | ...
7 | ```
8 |
9 |
10 | ```golang
11 | // main
12 | ...
13 | rpc.Register(arith)
14 | rpc.HandleHTTP()
15 | err := http.ListenAndServe(":8080", nil)
16 | ...
17 |
18 | // Multiply
19 | func (t *Arith) Multiply(args *Args, reply *int) error {
20 | ...
21 | *reply = args.A * args.B
22 | return nil
23 | ...
24 | }
25 | ```
26 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/web/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "net/http"
6 | )
7 |
8 | func main() {
9 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
10 | fmt.Fprintf(w, "Hello from %s\n", r.URL.Path)
11 | })
12 |
13 | http.ListenAndServe(":8080", nil)
14 | }
15 |
--------------------------------------------------------------------------------
/OpenFreeShare/a-brief-introduction-to-golang/demo/web/main.md:
--------------------------------------------------------------------------------
1 | ```golang
2 | package main
3 |
4 | import (
5 | "fmt"
6 | "net/http"
7 | )
8 |
9 | func main() {
10 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
11 | fmt.Fprintf(w, "Hello from %s\n", r.URL.Path)
12 | })
13 |
14 | http.ListenAndServe(":8080", nil)
15 | }
16 | ```
17 |
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/Kubernetes2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/Kubernetes2.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/agenda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/agenda.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/background.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/challenge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/challenge.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/choice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/choice.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/cicd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/cicd.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/cicdflow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/cicdflow.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/cloudnative.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/cloudnative.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/efk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/efk.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/infrastructuer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/infrastructuer.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/kubernetes1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/kubernetes1.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/pipeline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/pipeline.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/qos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/qos.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/theory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/theory.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/yce.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/yce.png
--------------------------------------------------------------------------------
/Presentation/DockerOne/images/yceui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Presentation/DockerOne/images/yceui.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TechNotes
2 | ===========================
3 |
4 | 用于以下用途:
5 |
6 | * 容器技术(Moby,Kubernetes)等英文文章翻译
7 |
8 | * 一些技术知识和心得体会
9 |
10 | * 一些原创文章
11 |
--------------------------------------------------------------------------------
/Reprint/Kubernetes 1.6.0 高可靠集群部署/deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Reprint/Kubernetes 1.6.0 高可靠集群部署/deploy.png
--------------------------------------------------------------------------------
/Reprint/Kubernetes 1.6.0 高可靠集群部署/table.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/Reprint/Kubernetes 1.6.0 高可靠集群部署/table.png
--------------------------------------------------------------------------------
/Review/README.md:
--------------------------------------------------------------------------------
1 | Review on Project Y.
2 |
3 | - [ ] Docker
4 | - [ ] Kubernetes
5 | - [ ] Golang
6 | - [ ] Shell
7 | - [ ] MySQL
8 | - [ ] Redis
9 | - [ ] DesignPattern
10 | - [ ] Extensions
11 |
--------------------------------------------------------------------------------
/Review/designpattern/README.md:
--------------------------------------------------------------------------------
1 | design pattern review
2 | single instance
3 | factory
4 |
5 | 单例模式
6 | 工厂模式
7 | 职责模式
8 | 状态模式
9 |
--------------------------------------------------------------------------------
/Review/docker/README.md:
--------------------------------------------------------------------------------
1 | docker review
2 |
3 | - [ ] docker basic operations (commands, etc)
4 | - [ ] docker network and storage
5 | - [ ] docker structure
6 | - [ ] docker push / run / logs analysis
7 | - [ ] docker private registry
8 | - [ ] FAQS
9 |
--------------------------------------------------------------------------------
/Review/extensions/README.md:
--------------------------------------------------------------------------------
1 | ceph review
2 | container review
3 | storage(volume)review
4 | network review
5 | restful
6 | makefile review
7 |
8 |
--------------------------------------------------------------------------------
/Review/golang/README.md:
--------------------------------------------------------------------------------
1 | golang review
2 | - [ ] Golang http server
3 | - [ ] Golang single instance
4 | - [ ] Golang MySQL
5 | - [ ] Golang Redis
6 | - [ ] Golang Websocket
7 |
--------------------------------------------------------------------------------
/Review/kubernetes/README.md:
--------------------------------------------------------------------------------
1 | kubernetes review
2 |
3 | - [ ] Kubernetes basic operations (commands, etc)
4 | - [ ] Kubernetes network
5 | - [ ] Kubernetes structure
6 | - [ ] Kubernetes kubeadm / logs analysis
7 | - [ ] Kubernetes Design Pattern
8 |
--------------------------------------------------------------------------------
/Review/mysql/README.md:
--------------------------------------------------------------------------------
1 | mysql review
2 |
3 | - [ ] basic operation CRUD
4 | - [ ] batch / bulk
5 | - [ ] transaction
6 |
--------------------------------------------------------------------------------
/Review/redis/README.md:
--------------------------------------------------------------------------------
1 | redis review
2 |
--------------------------------------------------------------------------------
/Review/shell/README.md:
--------------------------------------------------------------------------------
1 | shell review
2 |
--------------------------------------------------------------------------------
/Tips/Search images from gcr/README.md:
--------------------------------------------------------------------------------
1 | 从Google Container Registry(GCR)搜索镜像
2 | =======================
3 |
4 | ### 第一步: 注册gcloud账号
5 | ----------
6 |
7 | 注册Google Cloude账号:xunmi2004@gmail.com
8 |
9 |
10 | ### 第二步: 安装gcloud命令
11 | ----------
12 |
13 | 在外网机器安装gcloud命令:
14 |
15 | #### Red Hat and CentOS
16 | ----------
17 |
18 | ```bash
19 | sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
20 | [google-cloud-sdk]
21 | name=Google Cloud SDK
22 | baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
23 | enabled=1
24 | gpgcheck=1
25 | repo_gpgcheck=1
26 | gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
27 | https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
28 | EOM
29 |
30 | yum install google-cloud-sdk
31 | ```
32 |
33 | #### Debian and Ubuntu only
34 | -----------
35 |
36 | ```bash
37 | export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
38 |
39 | echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
40 |
41 | curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
42 |
43 | sudo apt-get update && sudo apt-get install google-cloud-sdk
44 | ```
45 |
46 | ### 第三步: 登录
47 | ----------
48 |
49 | 登录glcoude
50 |
51 | ```bash
52 | #gcloud auth login
53 |
54 | >Go to the following link in your browser:
55 | > https://accounts.google.com/o/oauth2/auth?redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&access_type=offline
56 |
57 | Enter verification code:
58 | ```
59 |
60 | 在浏览器中输入上面URL后,会返回一串秘钥,拷贝到命令行,回车,登录完成。
61 |
62 |
63 | ### 第四步: 查询镜像
64 | --------
65 |
66 | 查询项目:
67 |
68 | ```bash
69 | gcloud alpha container images list --repository=gcr.io/google_containers
70 | ```
71 |
72 | 查询镜像的Tags:
73 |
74 | ```bash
75 | gcloud alpha container images list-tags gcr.io/google_containers/kubedns-amd64
76 | ```
77 |
78 |
79 | ### 附录
80 | ---------
81 |
82 | kubedns镜像tags列表:
83 |
84 | ```bash
85 | gcloud alpha container images list-tags gcr.io/google_containers/kubedns-amd64
86 |
87 | DIGEST TAGS TIMESTAMP
88 | 3d3d67f51930 1.9 2016-11-19T01:10:50
89 | 39264fd3c998 1.8 2016-09-29T18:44:48
90 | 9b811ed606fd 1.7 2016-08-24T23:41:32
91 | ec8d3ddb120d 1.6-test 2016-07-02T04:05:18
92 | 3aad94a965b1 2016-07-02T03:58:05
93 | 8699d3593b6f 2016-07-02T03:51:36
94 | 9d102cc48bbe 2016-07-02T02:37:40
95 | 7e63b783cdbf 2016-07-02T02:20:27
96 | ac7672acd351 2016-07-02T00:05:12
97 | 2cb02e679acf 1.6 2016-06-30T00:05:57
98 | ```
99 |
100 | dnsmasq镜像tags列表:
101 |
102 | ```bash
103 | DIGEST TAGS TIMESTAMP
104 | 6da81cd706e4 1.1 2016-05-24T20:30:29
105 | 6c66fa360516 1.0 2016-05-23T23:44:22
106 | ```
107 |
108 | exechealthz镜像tags列表:
109 |
110 | ```bash
111 | gcloud alpha container images list-tags gcr.io/google_containers/exechealthz-amd64
112 | DIGEST TAGS TIMESTAMP
113 | 7ecf20f93a63 v1.2.0 2016-09-27T01:05:09
114 | 503e158c3f65 1.2 2016-09-23T01:15:29
115 | 2e2a318b5627 1.1 2016-07-28T20:49:53
116 | a5c595bcc2cd 1.0 2016-03-31T03:30:59
117 | ```
118 | ```
119 |
--------------------------------------------------------------------------------
/index.rst:
--------------------------------------------------------------------------------
1 | Hello World
2 |
--------------------------------------------------------------------------------
/pics/addrepo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/addrepo.png
--------------------------------------------------------------------------------
/pics/build.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/build.png
--------------------------------------------------------------------------------
/pics/gitgoplugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/gitgoplugin.png
--------------------------------------------------------------------------------
/pics/idealli j vim.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/idealli j vim.png
--------------------------------------------------------------------------------
/pics/ideapr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/ideapr.png
--------------------------------------------------------------------------------
/pics/moduledepedent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/moduledepedent.png
--------------------------------------------------------------------------------
/pics/modulenext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/modulenext.png
--------------------------------------------------------------------------------
/pics/modulepath.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/modulepath.png
--------------------------------------------------------------------------------
/pics/modules.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/modules.png
--------------------------------------------------------------------------------
/pics/plugins.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/plugins.png
--------------------------------------------------------------------------------
/pics/preference.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/preference.png
--------------------------------------------------------------------------------
/pics/projectstructure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/projectstructure.png
--------------------------------------------------------------------------------
/pics/searchgo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/pics/searchgo.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/Kubernetes_ShippingContainers.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/Kubernetes_ShippingContainers.jpg
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/dp-rs-pod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/dp-rs-pod.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/error.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/kubectldescirbedps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/kubectldescirbedps.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/kubectlgetdpsyce.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/kubectlgetdpsyce.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/revisionhistory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/revisionhistory.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/soucecode-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/soucecode-error.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/sourcecode-adler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/sourcecode-adler.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/sourcecode-create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/sourcecode-create.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/sourcecode-getNewRs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/sourcecode-getNewRs.png
--------------------------------------------------------------------------------
/从Kubernetes的一个Bug说开去/sourcecode-podtemplate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/从Kubernetes的一个Bug说开去/sourcecode-podtemplate.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/.DS_Store
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/Deployment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/Deployment.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/Nodes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/Nodes.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/Pods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/Pods.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/StatefulSet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/StatefulSet.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/etcd-by-prometheus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/etcd-by-prometheus.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/etcd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/etcd.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/kubernetes-cluster-health.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/kubernetes-cluster-health.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/kubernetes-metrics-with-prometheus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/kubernetes-metrics-with-prometheus.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/kubernetes-monitoring-proposal.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/kubernetes-monitoring-proposal.jpeg
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/kubernetes-prometheus-architecture.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/kubernetes-prometheus-architecture.jpeg
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/operator-workflow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/operator-workflow.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/prometheus-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/prometheus-dashboard.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/prometheus-etcd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/prometheus-etcd.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/prometheus-graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/prometheus-graph.png
--------------------------------------------------------------------------------
/使用prometheus-operator监控kubernetes集群/images/prometheus-targets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/使用prometheus-operator监控kubernetes集群/images/prometheus-targets.png
--------------------------------------------------------------------------------
/聊聊持续发布/6E33E5AB-CE62-4D52-BE14-28E59DC6D49C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lth2015/TechNotes/297dec63107cd10f51c0e0484eea28600f44eebf/聊聊持续发布/6E33E5AB-CE62-4D52-BE14-28E59DC6D49C.png
--------------------------------------------------------------------------------
/聊聊持续发布/README.md:
--------------------------------------------------------------------------------
1 | 持续交付
2 | ==========================
3 |
4 | **if it hurts, do it more often, and bring the pain forward.**
5 |
6 |
7 |
8 |
9 | #### 部署流水线
10 | ---------------------
11 |
12 | 
13 |
14 | #### 持续交付的优点:
15 | ---------------------
16 |
17 |
18 | #### 持续发布的原则:
19 | ---------------------
20 |
21 | 1. 发布应该是一个可重复、可靠的过程
22 |
23 | 2. 发布过程尽可能的自动化
24 |
25 | 3. 发布过程尽可能多的使用版本控制
26 |
27 | 4. 频繁地发布,持续改进、优化发布流程
28 |
29 | 5. 保证构建阶段产出(可执行文件)的质量
30 |
31 | 6. 跟交付相关的所有人都对交付过程负有责任
32 |
33 | 7.
34 |
35 |
36 | #### 实践:
37 | -----------------------
38 |
39 | 1. 只构建可执行文件一次,它在多个环境(测试、生产)中运行
40 |
41 | 2. 在不同环境中部署使用相同的方式
42 |
43 | 3. 每次部署完成后都进行冒烟测试
44 |
45 | 4. 先在准生产环境发布,再发布到生产环境
46 |
47 | 5. 任何修改都要重新执行部署流水线
48 |
49 | 6. 在发布过程中,任何环节出现服务,立即终止流水线执行,并将错误信息反馈给用户
50 |
--------------------------------------------------------------------------------