From 445e05855ac71bce895e8b72f785637e2c45b977 Mon Sep 17 00:00:00 2001 From: "huanqing.shao" Date: Fri, 18 Oct 2019 23:47:36 +0800 Subject: [PATCH] LimitRange --- .vuepress/components/AdSenseTitle.vue | 4 +- .vuepress/components/FriendlyUrl.vue | 29 + .vuepress/components/HomePage.vue | 1 + .vuepress/components/InstallEnvCheck.vue | 15 +- .vuepress/components/KuboardLiscense.vue | 57 ++ .vuepress/config.js | 23 +- .vuepress/public/robots.txt | 3 + .../policy/lr-container-limit-range.yaml | 19 + .../learning/policy/lr-container-pod.yaml | 37 + .vuepress/theme/components/Page.vue | 2 +- .vuepress/theme/components/PageVssue.vue | 2 +- .vuepress/theme/layouts/Layout.vue | 7 +- .vuepress/theme/layouts/LearningLayout.vue | 7 +- README.md | 2 +- .../history-k8s/install-kubernetes-1.15.3.md | 8 +- install/upgrade-k8s/1.15.x-1.15.4.md | 18 +- install/upgrade-k8s/1.15.x-1.16.x.md | 28 +- install/upgrade-k8s/calico-3.8-3.9.md | 49 +- learning/k8s-advanced/policy/lr.md | 34 +- learning/k8s-advanced/policy/lr_container.md | 172 ++++ learning/k8s-intermediate/persistent/nfs.md | 3 + package-lock.json | 761 ++++++++++-------- package.json | 16 +- support/change-log/change-log-on-the-way.md | 4 +- support/change-log/v1.0.x.md | 2 +- support/index copy.md | 127 +++ support/index.md | 31 + 27 files changed, 1072 insertions(+), 389 deletions(-) create mode 100644 .vuepress/components/FriendlyUrl.vue create mode 100644 .vuepress/components/KuboardLiscense.vue create mode 100644 .vuepress/public/robots.txt create mode 100644 .vuepress/public/statics/learning/policy/lr-container-limit-range.yaml create mode 100644 .vuepress/public/statics/learning/policy/lr-container-pod.yaml create mode 100644 learning/k8s-advanced/policy/lr_container.md create mode 100644 support/index copy.md diff --git a/.vuepress/components/AdSenseTitle.vue b/.vuepress/components/AdSenseTitle.vue index 9ef0bd0..d00a873 100644 --- a/.vuepress/components/AdSenseTitle.vue +++ b/.vuepress/components/AdSenseTitle.vue @@ -1,6 +1,6 @@ + + diff --git a/.vuepress/config.js b/.vuepress/config.js index 3525c57..b5613b7 100644 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -29,6 +29,12 @@ module.exports = { // `], ['script', { 'data-ad-client': "ca-pub-3313149841665250", async: true, src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"}], // + // ['script', { 'type': 'text/javascript', async: true, src: '//downloads.mailchimp.com/js/signup-forms/popup/unique-methods/embed.js', 'data-dojo-config': 'usePlainJson: true, isDebug: false'}], + // ['script', { 'type': 'text/javascript' }, ` + // window.dojoRequire(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us20.list-manage.com","uuid":"2273cb19eb20bb1bc5b7745a7","lid":"f1f25d6dac","uniqueMethods":true}) }) + // `], + // + // ], markdown: { toc: { includeLevel: [2, 3] }, @@ -64,7 +70,7 @@ module.exports = { // }, '@vssue/vuepress-plugin-vssue': { // set `platform` rather than `api` - platform: 'github', + platform: 'github-v4', locale: 'zh-CN', autoCreateIssue: false, admins: ['shaohq'], @@ -201,7 +207,7 @@ module.exports = { children: [ // ['install-k8s-upgrade', '升级Kubernetes集群'], 'upgrade-k8s/1.15.x-1.15.4', - 'upgrade-k8s/1.15.x-1.16.x', + ['upgrade-k8s/1.15.x-1.16.x', 'K8S从1.15.x(1.16.x)升级到 1.16.x'], 'upgrade-k8s/calico-3.8-3.9', ] }, @@ -209,11 +215,11 @@ module.exports = { title: '管理 Kubernetes', collapsable: false, children: [ + 'install-dashboard', + 'install-dashboard-upgrade', 'install-kubectl', 'config-kubectl', 'install-k8s-dashboard', - 'install-dashboard', - 'install-dashboard-upgrade' ] }, // { @@ -468,7 +474,14 @@ module.exports = { title: '策略', collapsable: true, children: [ - 'k8s-advanced/policy/lr', + { + title: 'Limit Range', + collapsable: true, + children: [ + 'k8s-advanced/policy/lr', + 'k8s-advanced/policy/lr_container', + ] + }, ] }, ] diff --git a/.vuepress/public/robots.txt b/.vuepress/public/robots.txt new file mode 100644 index 0000000..8fc1790 --- /dev/null +++ b/.vuepress/public/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Disallow: /support/ diff --git a/.vuepress/public/statics/learning/policy/lr-container-limit-range.yaml b/.vuepress/public/statics/learning/policy/lr-container-limit-range.yaml new file mode 100644 index 0000000..3c2b30f --- /dev/null +++ b/.vuepress/public/statics/learning/policy/lr-container-limit-range.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: LimitRange +metadata: + name: limit-mem-cpu-per-container +spec: + limits: + - max: + cpu: "800m" + memory: "1Gi" + min: + cpu: "100m" + memory: "99Mi" + default: + cpu: "700m" + memory: "900Mi" + defaultRequest: + cpu: "110m" + memory: "111Mi" + type: Container diff --git a/.vuepress/public/statics/learning/policy/lr-container-pod.yaml b/.vuepress/public/statics/learning/policy/lr-container-pod.yaml new file mode 100644 index 0000000..0457792 --- /dev/null +++ b/.vuepress/public/statics/learning/policy/lr-container-pod.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Pod +metadata: + name: busybox1 +spec: + containers: + - name: busybox-cnt01 + image: busybox + command: ["/bin/sh"] + args: ["-c", "while true; do echo hello from cnt01; sleep 10;done"] + resources: + requests: + memory: "100Mi" + cpu: "100m" + limits: + memory: "200Mi" + cpu: "500m" + - name: busybox-cnt02 + image: busybox + command: ["/bin/sh"] + args: ["-c", "while true; do echo hello from cnt02; sleep 10;done"] + resources: + requests: + memory: "100Mi" + cpu: "100m" + - name: busybox-cnt03 + image: busybox + command: ["/bin/sh"] + args: ["-c", "while true; do echo hello from cnt03; sleep 10;done"] + resources: + limits: + memory: "200Mi" + cpu: "500m" + - name: busybox-cnt04 + image: busybox + command: ["/bin/sh"] + args: ["-c", "while true; do echo hello from cnt04; sleep 10;done"] diff --git a/.vuepress/theme/components/Page.vue b/.vuepress/theme/components/Page.vue index ecc995c..6a1423f 100644 --- a/.vuepress/theme/components/Page.vue +++ b/.vuepress/theme/components/Page.vue @@ -51,7 +51,7 @@ -