{"id":27,"date":"2026-03-24T09:48:18","date_gmt":"2026-03-24T01:48:18","guid":{"rendered":"http:\/\/www.8ykxvf.top\/?p=27"},"modified":"2026-03-24T09:48:18","modified_gmt":"2026-03-24T01:48:18","slug":"k8s%e7%9a%84%e8%b5%84%e6%ba%90%e6%b8%85%e5%8d%95","status":"publish","type":"post","link":"https:\/\/www.8ykxvf.top\/?p=27","title":{"rendered":"k8s\u7684\u8d44\u6e90\u6e05\u5355"},"content":{"rendered":"\n<!doctype html>\n<html>\n<head>\n<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>\n\n<link href='https:\/\/fonts.googleapis.com\/css?family=Open+Sans:400italic,700italic,700,400&#038;subset=latin,latin-ext' rel='stylesheet' type='text\/css' \/><style type='text\/css'>html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --select-text-bg-color: #B5D6FC; --select-text-font-color: auto; --monospace: \"Lucida Console\",Consolas,\"Courier\",monospace; --title-bar-height: 20px; }\n.mac-os-11 { --title-bar-height: 28px; }\nhtml { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }\nh1, h2, h3, h4, h5 { white-space: pre-wrap; }\nbody { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }\niframe { margin: auto; }\na.url { word-break: break-all; }\na:active, a:hover { outline: 0px; }\n.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }\n#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }\n#write.first-line-indent p { text-indent: 2em; }\n#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }\n#write.first-line-indent li { margin-left: 2em; }\n.for-image #write { padding-left: 8px; padding-right: 8px; }\nbody.typora-export { padding-left: 30px; padding-right: 30px; }\n.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }\n.typora-export .task-list-item input { pointer-events: none; }\n@media screen and (max-width: 500px) {\n  body.typora-export { padding-left: 0px; padding-right: 0px; }\n  #write { padding-left: 20px; padding-right: 20px; }\n}\n#write li > figure:last-child { margin-bottom: 0.5rem; }\n#write ol, #write ul { position: relative; }\nimg { max-width: 100%; vertical-align: middle; image-orientation: from-image; }\nbutton, input, select, textarea { color: inherit; font: inherit; }\ninput[type=\"checkbox\"], input[type=\"radio\"] { line-height: normal; padding: 0px; }\n*, ::after, ::before { box-sizing: border-box; }\n#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }\n#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }\np { line-height: inherit; }\nh1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }\np { orphans: 4; }\nh1 { font-size: 2rem; }\nh2 { font-size: 1.8rem; }\nh3 { font-size: 1.6rem; }\nh4 { font-size: 1.4rem; }\nh5 { font-size: 1.2rem; }\nh6 { font-size: 1rem; }\n.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }\n.hidden { display: none; }\n.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }\na { cursor: pointer; }\nsup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }\nsup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }\n#write input[type=\"checkbox\"] { cursor: pointer; width: inherit; height: inherit; }\nfigure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }\nfigure > table { margin: 0px; }\nthead, tr { break-inside: avoid; break-after: auto; }\nthead { display: table-header-group; }\ntable { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }\ntable.md-table td { min-width: 32px; }\n.CodeMirror-gutters { border-right: 0px; background-color: inherit; }\n.CodeMirror-linenumber { user-select: none; }\n.CodeMirror { text-align: left; }\n.CodeMirror-placeholder { opacity: 0.3; }\n.CodeMirror pre { padding: 0px 4px; }\n.CodeMirror-lines { padding: 0px; }\ndiv.hr:focus { cursor: none; }\n#write pre { white-space: pre-wrap; }\n#write.fences-no-line-wrapping pre { white-space: pre; }\n#write pre.ty-contain-cm { white-space: normal; }\n.CodeMirror-gutters { margin-right: 4px; }\n.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }\n.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }\n#write .md-fences.mock-cm { white-space: pre-wrap; }\n.md-fences.md-fences-with-lineno { padding-left: 0px; }\n#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }\n.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }\n.CodeMirror-line, twitterwidget { break-inside: avoid; }\nsvg { break-inside: avoid; }\n.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }\n.footnotes + .footnotes { margin-top: 0px; }\n.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }\nli div { padding-top: 0px; }\nblockquote { margin: 1rem 0px; }\nli .mathjax-block, li p { margin: 0.5rem 0px; }\nli blockquote { margin: 1rem 0px; }\nli { margin: 0px; position: relative; }\nblockquote > :last-child { margin-bottom: 0px; }\nblockquote > :first-child, li > :first-child { margin-top: 0px; }\n.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }\n#write .footnote-line { white-space: pre-wrap; }\n@media print {\n  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }\n  #write { margin-top: 0px; border-color: transparent !important; padding-top: 0px !important; padding-bottom: 0px !important; }\n  .typora-export * { -webkit-print-color-adjust: exact; }\n  .typora-export #write { break-after: avoid; }\n  .typora-export #write::after { height: 0px; }\n  .is-mac table { break-inside: avoid; }\n  #write > p:nth-child(1) { margin-top: 0px; }\n  .typora-export-show-outline .typora-export-sidebar { display: none; }\n  figure { overflow-x: visible; }\n}\n.footnote-line { margin-top: 0.714em; font-size: 0.7em; }\na img, img a { cursor: pointer; }\npre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }\np > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }\n#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }\np > .md-image:only-child { display: inline-block; width: 100%; }\n#write .MathJax_Display { margin: 0.8em 0px 0px; }\n.md-math-block { width: 100%; }\n.md-math-block:not(:empty)::after { display: none; }\n.MathJax_ref { fill: currentcolor; }\n[contenteditable=\"true\"]:active, [contenteditable=\"true\"]:focus, [contenteditable=\"false\"]:active, [contenteditable=\"false\"]:focus { outline: 0px; box-shadow: none; }\n.md-task-list-item { position: relative; list-style-type: none; }\n.task-list-item.md-task-list-item { padding-left: 0px; }\n.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }\n.math { font-size: 1rem; }\n.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }\n.md-toc-content { position: relative; margin-left: 0px; }\n.md-toc-content::after, .md-toc::after { display: none; }\n.md-toc-item { display: block; color: rgb(65, 131, 196); }\n.md-toc-item a { text-decoration: none; }\n.md-toc-inner:hover { text-decoration: underline; }\n.md-toc-inner { display: inline-block; cursor: pointer; }\n.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }\n.md-toc-h2 .md-toc-inner { margin-left: 2em; }\n.md-toc-h3 .md-toc-inner { margin-left: 4em; }\n.md-toc-h4 .md-toc-inner { margin-left: 6em; }\n.md-toc-h5 .md-toc-inner { margin-left: 8em; }\n.md-toc-h6 .md-toc-inner { margin-left: 10em; }\n@media screen and (max-width: 48em) {\n  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }\n  .md-toc-h4 .md-toc-inner { margin-left: 5em; }\n  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }\n  .md-toc-h6 .md-toc-inner { margin-left: 8em; }\n}\na.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }\n.footnote-line a:not(.reversefootnote) { color: inherit; }\n.reversefootnote { font-family: ui-monospace, sans-serif; }\n.md-attr { display: none; }\n.md-fn-count::after { content: \".\"; }\ncode, pre, samp, tt { font-family: var(--monospace); }\nkbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }\n.md-comment { color: rgb(162, 127, 3); opacity: 0.6; font-family: var(--monospace); }\ncode { text-align: left; vertical-align: initial; }\na.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }\n.os-windows.monocolor-emoji .md-emoji { font-family: \"Segoe UI Symbol\", sans-serif; }\n.md-diagram-panel > svg { max-width: 100%; }\n[lang=\"flow\"] svg, [lang=\"mermaid\"] svg { max-width: 100%; height: auto; }\n[lang=\"mermaid\"] .node text { font-size: 1rem; }\ntable tr th { border-bottom: 0px; }\nvideo { max-width: 100%; display: block; margin: 0px auto; }\niframe { max-width: 100%; width: 100%; border: none; }\n.highlight td, .highlight tr { border: 0px; }\nmark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }\n.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }\n.md-expand mark .md-meta { opacity: 0.3 !important; }\nmark .md-meta { color: rgb(0, 0, 0); }\n@media print {\n  .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }\n}\n.md-diagram-panel .messageText { stroke: none !important; }\n.md-diagram-panel .start-state { fill: var(--node-fill); }\n.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }\n.md-fences.md-fences-math { font-size: 1em; }\n.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }\n.md-fences-advanced:not(.md-focus) { background: inherit; }\n.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }\n.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }\n.typora-export-show-outline #write { --webkit-flex: 2; flex: 2 1 0%; }\n.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }\n@media screen and (max-width: 1024px) {\n  .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }\n}\n@media screen and (max-width: 800px) {\n  .typora-export-sidebar { display: none; }\n}\n.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; overflow-wrap: anywhere; }\n.outline-content ul { margin-top: 0px; margin-bottom: 0px; }\n.outline-content strong { font-weight: 400; }\n.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }\n.outline-expander::before { content: \"\uf125\"; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }\n.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }\n.outline-expander:hover::before { content: \"\uf123\"; }\n.outline-h1 > .outline-item { padding-left: 0px; }\n.outline-h2 > .outline-item { padding-left: 1em; }\n.outline-h3 > .outline-item { padding-left: 2em; }\n.outline-h4 > .outline-item { padding-left: 3em; }\n.outline-h5 > .outline-item { padding-left: 4em; }\n.outline-h6 > .outline-item { padding-left: 5em; }\n.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }\n.outline-label:hover { text-decoration: underline; }\n.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }\n.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }\n.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }\n.outline-item-open > .outline-item > .outline-expander::before { content: \"\uf123\"; }\n.outline-children { display: none; }\n.info-panel-tab-wrapper { display: none; }\n.outline-item-open > .outline-children { display: block; }\n.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }\n.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }\n.typora-export .outline-expander::before { content: \"+\"; font-family: inherit; top: -1px; }\n.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: \"\u2212\"; }\n.typora-export-collapse-outline .outline-children { display: none; }\n.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }\n.typora-export-no-collapse-outline .outline-expander::before { content: \"\" !important; }\n.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }\n.md-inline-math-container mjx-container { zoom: 0.95; }\nmjx-container { break-inside: avoid; }\n.md-alert.md-alert-note { border-left-color: rgb(9, 105, 218); }\n.md-alert.md-alert-important { border-left-color: rgb(130, 80, 223); }\n.md-alert.md-alert-warning { border-left-color: rgb(154, 103, 0); }\n.md-alert.md-alert-tip { border-left-color: rgb(31, 136, 61); }\n.md-alert.md-alert-caution { border-left-color: rgb(207, 34, 46); }\n.md-alert { padding: 0px 1em; margin-bottom: 16px; color: inherit; border-left: 0.25em solid rgb(0, 0, 0); }\n.md-alert-text-note { color: rgb(9, 105, 218); }\n.md-alert-text-important { color: rgb(130, 80, 223); }\n.md-alert-text-warning { color: rgb(154, 103, 0); }\n.md-alert-text-tip { color: rgb(31, 136, 61); }\n.md-alert-text-caution { color: rgb(207, 34, 46); }\n.md-alert-text { font-size: 0.9rem; font-weight: 700; }\n.md-alert-text svg { fill: currentcolor; position: relative; top: 0.125em; margin-right: 1ch; overflow: visible; }\n.md-alert-text-container::after { content: attr(data-text); text-transform: capitalize; pointer-events: none; margin-right: 1ch; }\n\n\n:root {\n    --side-bar-bg-color: #fafafa;\n    --control-text-color: #777;\n}\n\n@include-when-export url(https:\/\/fonts.googleapis.com\/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);\n\n\/* open-sans-regular - latin-ext_latin *\/\n  \/* open-sans-italic - latin-ext_latin *\/\n    \/* open-sans-700 - latin-ext_latin *\/\n    \/* open-sans-700italic - latin-ext_latin *\/\n  html {\n    font-size: 16px;\n    -webkit-font-smoothing: antialiased;\n}\n\nbody {\n    font-family: \"Open Sans\",\"Clear Sans\", \"Helvetica Neue\", Helvetica, Arial, 'Segoe UI Emoji', sans-serif;\n    color: rgb(51, 51, 51);\n    line-height: 1.6;\n}\n\n#write {\n    max-width: 860px;\n  \tmargin: 0 auto;\n  \tpadding: 30px;\n    padding-bottom: 100px;\n}\n\n@media only screen and (min-width: 1400px) {\n\t#write {\n\t\tmax-width: 1024px;\n\t}\n}\n\n@media only screen and (min-width: 1800px) {\n\t#write {\n\t\tmax-width: 1200px;\n\t}\n}\n\n#write > ul:first-child,\n#write > ol:first-child{\n    margin-top: 30px;\n}\n\na {\n    color: #4183C4;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n    position: relative;\n    margin-top: 1rem;\n    margin-bottom: 1rem;\n    font-weight: bold;\n    line-height: 1.4;\n    cursor: text;\n}\nh1:hover a.anchor,\nh2:hover a.anchor,\nh3:hover a.anchor,\nh4:hover a.anchor,\nh5:hover a.anchor,\nh6:hover a.anchor {\n    text-decoration: none;\n}\nh1 tt,\nh1 code {\n    font-size: inherit;\n}\nh2 tt,\nh2 code {\n    font-size: inherit;\n}\nh3 tt,\nh3 code {\n    font-size: inherit;\n}\nh4 tt,\nh4 code {\n    font-size: inherit;\n}\nh5 tt,\nh5 code {\n    font-size: inherit;\n}\nh6 tt,\nh6 code {\n    font-size: inherit;\n}\nh1 {\n    font-size: 2.25em;\n    line-height: 1.2;\n    border-bottom: 1px solid #eee;\n}\nh2 {\n    font-size: 1.75em;\n    line-height: 1.225;\n    border-bottom: 1px solid #eee;\n}\n\n\/*@media print {\n    .typora-export h1,\n    .typora-export h2 {\n        border-bottom: none;\n        padding-bottom: initial;\n    }\n\n    .typora-export h1::after,\n    .typora-export h2::after {\n        content: \"\";\n        display: block;\n        height: 100px;\n        margin-top: -96px;\n        border-top: 1px solid #eee;\n    }\n}*\/\n\nh3 {\n    font-size: 1.5em;\n    line-height: 1.43;\n}\nh4 {\n    font-size: 1.25em;\n}\nh5 {\n    font-size: 1em;\n}\nh6 {\n   font-size: 1em;\n    color: #777;\n}\np,\nblockquote,\nul,\nol,\ndl,\ntable{\n    margin: 0.8em 0;\n}\nli>ol,\nli>ul {\n    margin: 0 0;\n}\nhr {\n    height: 2px;\n    padding: 0;\n    margin: 16px 0;\n    background-color: #e7e7e7;\n    border: 0 none;\n    overflow: hidden;\n    box-sizing: content-box;\n}\n\nli p.first {\n    display: inline-block;\n}\nul,\nol {\n    padding-left: 30px;\n}\nul:first-child,\nol:first-child {\n    margin-top: 0;\n}\nul:last-child,\nol:last-child {\n    margin-bottom: 0;\n}\nblockquote {\n    border-left: 4px solid #dfe2e5;\n    padding: 0 15px;\n    color: #777777;\n}\nblockquote blockquote {\n    padding-right: 0;\n}\ntable {\n    padding: 0;\n    word-break: initial;\n}\ntable tr {\n    border: 1px solid #dfe2e5;\n    margin: 0;\n    padding: 0;\n}\ntable tr:nth-child(2n),\nthead {\n    background-color: #f8f8f8;\n}\ntable th {\n    font-weight: bold;\n    border: 1px solid #dfe2e5;\n    border-bottom: 0;\n    margin: 0;\n    padding: 6px 13px;\n}\ntable td {\n    border: 1px solid #dfe2e5;\n    margin: 0;\n    padding: 6px 13px;\n}\ntable th:first-child,\ntable td:first-child {\n    margin-top: 0;\n}\ntable th:last-child,\ntable td:last-child {\n    margin-bottom: 0;\n}\n\n.CodeMirror-lines {\n    padding-left: 4px;\n}\n\n.code-tooltip {\n    box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);\n    border-top: 1px solid #eef2f2;\n}\n\n.md-fences,\ncode,\ntt {\n    border: 1px solid #e7eaed;\n    background-color: #f8f8f8;\n    border-radius: 3px;\n    padding: 0;\n    padding: 2px 4px 0px 4px;\n    font-size: 0.9em;\n}\n\ncode {\n    background-color: #f3f4f4;\n    padding: 0 2px 0 2px;\n}\n\n.md-fences {\n    margin-bottom: 15px;\n    margin-top: 15px;\n    padding-top: 8px;\n    padding-bottom: 6px;\n}\n\n\n.md-task-list-item > input {\n  margin-left: -1.3em;\n}\n\n@media print {\n    html {\n        font-size: 13px;\n    }\n    pre {\n        page-break-inside: avoid;\n        word-wrap: break-word;\n    }\n}\n\n.md-fences {\n\tbackground-color: #f8f8f8;\n}\n#write pre.md-meta-block {\n\tpadding: 1rem;\n    font-size: 85%;\n    line-height: 1.45;\n    background-color: #f7f7f7;\n    border: 0;\n    border-radius: 3px;\n    color: #777777;\n    margin-top: 0 !important;\n}\n\n.mathjax-block>.code-tooltip {\n\tbottom: .375rem;\n}\n\n.md-mathjax-midline {\n    background: #fafafa;\n}\n\n#write>h3.md-focus:before{\n\tleft: -1.5625rem;\n\ttop: .375rem;\n}\n#write>h4.md-focus:before{\n\tleft: -1.5625rem;\n\ttop: .285714286rem;\n}\n#write>h5.md-focus:before{\n\tleft: -1.5625rem;\n\ttop: .285714286rem;\n}\n#write>h6.md-focus:before{\n\tleft: -1.5625rem;\n\ttop: .285714286rem;\n}\n.md-image>.md-meta {\n    \/*border: 1px solid #ddd;*\/\n    border-radius: 3px;\n    padding: 2px 0px 0px 4px;\n    font-size: 0.9em;\n    color: inherit;\n}\n\n.md-tag {\n    color: #a7a7a7;\n    opacity: 1;\n}\n\n.md-toc { \n    margin-top:20px;\n    padding-bottom:20px;\n}\n\n.sidebar-tabs {\n    border-bottom: none;\n}\n\n#typora-quick-open {\n    border: 1px solid #ddd;\n    background-color: #f8f8f8;\n}\n\n#typora-quick-open-item {\n    background-color: #FAFAFA;\n    border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;\n    border-style: solid;\n    border-width: 1px;\n}\n\n\/** focus mode *\/\n.on-focus-mode blockquote {\n    border-left-color: rgba(85, 85, 85, 0.12);\n}\n\nheader, .context-menu, .megamenu-content, footer{\n    font-family: \"Segoe UI\", \"Arial\", sans-serif;\n}\n\n.file-node-content:hover .file-node-icon,\n.file-node-content:hover .file-node-open-state{\n    visibility: visible;\n}\n\n.mac-seamless-mode #typora-sidebar {\n    background-color: #fafafa;\n    background-color: var(--side-bar-bg-color);\n}\n\n.mac-os #write{\n    caret-color: AccentColor;\n}\n\n.md-lang {\n    color: #b4654d;\n}\n\n\/*.html-for-mac {\n    --item-hover-bg-color: #E6F0FE;\n}*\/\n\n#md-notification .btn {\n    border: 0;\n}\n\n.dropdown-menu .divider {\n    border-color: #e5e5e5;\n    opacity: 0.4;\n}\n\n.ty-preferences .window-content {\n    background-color: #fafafa;\n}\n\n.ty-preferences .nav-group-item.active {\n    color: white;\n    background: #999;\n}\n\n.menu-item-container a.menu-style-btn {\n    background-color: #f5f8fa;\n    background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0)); \n}\n\n\n\n<\/style><title>k8s \u7684\u8d44\u6e90\u6e05\u5355<\/title>\n<\/head>\n<body class='typora-export os-windows'><div class='typora-export-content'>\n<div id='write'  class=''><h1 id='k8s-\u7684\u8d44\u6e90\u6e05\u5355'><span>K8S \u7684\u8d44\u6e90\u6e05\u5355<\/span><\/h1><figure class='table-figure'><table><thead><tr><th><span>\u53c2\u6570\u540d<\/span><\/th><th><span>\u7c7b\u578b<\/span><\/th><th><span>\u5b57\u6bb5\u8bf4\u660e<\/span><\/th><\/tr><\/thead><tbody><tr><td><span>apiVersion<\/span><\/td><td><span>String<\/span><\/td><td><span>K8S APl \u7684\u7248\u672c\uff0c\u53ef\u4ee5\u7528 kubectl api versions \u547d\u4ee4\u67e5\u8be2<\/span><\/td><\/tr><tr><td><span>kind<\/span><\/td><td><span>String<\/span><\/td><td><span>yam \u6587\u4ef6\u5b9a\u4e49\u7684\u8d44\u6e90\u7c7b\u578b\u548c\u89d2\u8272<\/span><\/td><\/tr><tr><td><span>metadata<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u5143\u6570\u636e\u5bf9\u8c61\uff0c\u4e0b\u9762\u662f\u5b83\u7684\u5c5e\u6027<\/span><\/td><\/tr><tr><td><span>metadata.name<\/span><\/td><td><span>String<\/span><\/td><td><span>\u5143\u6570\u636e\u5bf9\u8c61\u7684\u540d\u5b57\uff0c\u6bd4\u5982 pod \u7684\u540d\u5b57<\/span><\/td><\/tr><tr><td><span>metadata.namespace<\/span><\/td><td><span>String<\/span><\/td><td><span>\u5143\u6570\u636e\u5bf9\u8c61\u7684\u547d\u540d\u7a7a\u95f4<\/span><\/td><\/tr><tr><td><span>Spec<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u8be6\u7ec6\u5b9a\u4e49\u5bf9\u8c61<\/span><\/td><\/tr><tr><td><span>spec.containers[]<\/span><\/td><td><span>list<\/span><\/td><td><span>\u5b9a\u4e49 Spec \u5bf9\u8c61\u7684\u5bb9\u5668\u5217\u8868<\/span><\/td><\/tr><tr><td><span>spec.containers[].name<\/span><\/td><td><span>String<\/span><\/td><td><span>\u4e3a\u5217\u8868\u4e2d\u7684\u67d0\u4e2a\u5bb9\u5668\u5b9a\u4e49\u540d\u79f0<\/span><\/td><\/tr><tr><td><span>spec.containers[].image<\/span><\/td><td><span>String<\/span><\/td><td><span>\u4e3a\u5217\u8868\u4e2d\u7684\u67d0\u4e2a\u5bb9\u5668\u5b9a\u4e49\u9700\u8981\u7684\u955c\u50cf\u540d\u79f0<\/span><\/td><\/tr><tr><td><span>spec.containers[].imagePullPolicy<\/span><\/td><td><span>string<\/span><\/td><td><span>\u5b9a\u4e49\u955c\u50cf\u62c9\u53d6\u7b56\u7565\uff0c\u6709 Always\u3001Never\u3001IfNotPresent \u4e09\u4e2a\u503c\u53ef\u9009<\/span><br \/><span>  &#8211; Always\uff08\u9ed8\u8ba4\uff09\uff1a\u610f\u601d\u662f\u6bcf\u6b21\u90fd\u5c1d\u8bd5\u91cd\u65b0\u62c9\u53d6\u955c\u50cf<\/span><br \/><span>  &#8211; Never\uff1a\u8868\u793a\u4ec5\u9002\u7528\u672c\u5730\u955c\u50cf<\/span><br \/><span>  &#8211; IfNotPresent\uff1a\u5982\u679c\u672c\u5730\u6709\u955c\u50cf\u5c31\u4f7f\u7528\u672c\u5730\u955c\u50cf\uff0c\u6ca1\u6709\u5c31\u62c9\u53d6\u5728\u7ebf\u955c\u50cf\u3002<\/span><\/td><\/tr><tr><td><span>spec.containers[].command[]<\/span><\/td><td><span>list<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u542f\u52a8\u547d\u4ee4\uff0c\u56e0\u4e3a\u662f\u6570\u7ec4\u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\uff0c\u4e0d\u6307\u5b9a\u5219\u4f7f\u7528\u955c\u50cf\u6253\u5305\u65f6\u4f7f\u7528\u7684\u542f\u52a8\u547d\u4ee4\u3002<\/span><\/td><\/tr><tr><td><span>spec.containers[].args[]<\/span><\/td><td><span>list<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u542f\u52a8\u547d\u4ee4\u53c2\u6570\uff0c\u56e0\u4e3a\u662f\u6570\u7ec4\u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u3002<\/span><\/td><\/tr><tr><td><span>spec.containers[].workingDir<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u7684\u5de5\u4f5c\u76ee\u5f55<\/span><\/td><\/tr><tr><td><span>spec.containers[].volumeMounts[]<\/span><\/td><td><span>list<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u5185\u90e8\u7684\u5b58\u50a8\u5377\u914d\u7f6e<\/span><\/td><\/tr><tr><td><span>spec.containers[].volumeMounts[].name<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u53ef\u4ee5\u88ab\u5bb9\u5668\u6302\u8f7d\u7684\u5b58\u50a8\u5377\u7684\u540d\u79f0<\/span><\/td><\/tr><tr><td><span>spec.containers[].volumeMounts[].mountPath<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u53ef\u4ee5\u88ab\u5bb9\u5668\u6302\u8f7d\u7684\u5b58\u50a8\u5377\u7684\u8def\u5f84<\/span><\/td><\/tr><tr><td><span>spec.containers[].volumeMounts[].readOnly<\/span><\/td><td><span>string<\/span><\/td><td><span>\u8bbe\u7f6e\u5b58\u50a8\u5377\u8def\u5f84\u7684\u8bfb\u5199\u6a21\u5f0f\uff0cture \u6216\u8005 false\uff0c\u9ed8\u8ba4\u662f\u8bfb\u5199\u6a21\u5f0f<\/span><\/td><\/tr><tr><td><span>spec.containers[].ports[]<\/span><\/td><td><span>list<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u9700\u8981\u7528\u5230\u7684\u7aef\u53e3\u5217\u8868<\/span><\/td><\/tr><tr><td><span>spec.containers[].ports[].name<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u7aef\u53e3\u7684\u540d\u79f0<\/span><\/td><\/tr><tr><td><span>spec.containers[].ports[].containerPort<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u9700\u8981\u76d1\u542c\u7684\u7aef\u53e3\u53f7<\/span><\/td><\/tr><tr><td><span>spec.containers[].ports[].hostPort<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u6240\u5728\u4e3b\u673a\u9700\u8981\u76d1\u542c\u7684\u7aef\u53e3\u53f7\uff0c\u9ed8\u8ba4\u8ddf\u4e0a\u9762 containerPort \u76f8\u540c\uff0c\u6ce8\u610f\u8bbe\u7f6e\u4e86 hostPort \u540c\u4e00\u53f0\u4e3b\u673a\u65e0\u6cd5\u542f\u52a8\u8be5\u5bb9\u5668\u7684\u76f8\u540c\u526f\u672c\uff08\u56e0\u4e3a\u4e3b\u673a\u7684\u7aef\u53e3\u53f7\u4e0d\u80fd\u76f8\u540c\uff0c\u8fd9\u6837\u4f1a\u51b2\u7a81\uff09<\/span><\/td><\/tr><tr><td><span>spec.containers[].ports[].protocol<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u7aef\u53e3\u534f\u8bae\uff0c\u652f\u6301 TCP \u548c UDP\uff0c\u9ed8\u8ba4\u503c\u4e3a TCP<\/span><\/td><\/tr><tr><td><span>spec.containers[].env[]<\/span><\/td><td><span>list<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u8fd0\u884c\u524d\u9700\u8bbe\u7f6e\u7684\u73af\u5883\u53d8\u91cf\u5217\u8868<\/span><\/td><\/tr><tr><td><span>spec.containers[].env[].name<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u73af\u5883\u53d8\u91cf\u540d\u79f0<\/span><\/td><\/tr><tr><td><span>spec.containers[].env[].value<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a\u73af\u5883\u53d8\u91cf\u503c<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u6307\u5b9a\u8d44\u6e90\u9650\u5236\u548c\u8d44\u6e90\u8bf7\u6c42\u7684\u503c\uff08\u8fd9\u91cc\u5f00\u59cb\u5c31\u662f\u8bbe\u7f6e\u5bb9\u5668\u7684\u8d44\u6e90\u4e0a\u9650\uff09<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources.limits<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u6307\u5b9a\u8bbe\u7f6e\u5bb9\u5668\u8fd0\u884c\u65f6\u8d44\u6e90\u7684\u8fd0\u884c\u4e0a\u9650<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources.limits.cpu<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a CPU \u7684\u9650\u5236\uff0c\u5355\u4f4d\u4e3a Core \u6570\uff0c\u5c06\u7528\u4e8e docker run \u2013cpu-shares \u53c2\u6570<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources.limits.memory<\/span><\/td><td><span>string<\/span><\/td><td><span>\u6307\u5b9a mem \u5185\u5b58\u7684\u9650\u5236\uff0c\u5355\u4f4d\u4e3a MIB\u3001GiB<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources.requests<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u6307\u5b9a\u5bb9\u5668\u542f\u52a8\u548c\u8c03\u5ea6\u65f6\u7684\u9650\u5236\u8bbe\u7f6e<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources.requests.cpu<\/span><\/td><td><span>string<\/span><\/td><td><span>CPU\u8bf7\u6c42\uff0c\u5355\u4f4d\u4e3acore\u6570\uff0c\u5bb9\u5668\u542f\u52a8\u65f6\u521d\u59cb\u5316\u53ef\u7528\u6570\u91cf<\/span><\/td><\/tr><tr><td><span>spec.containers[].resources.requests.memory<\/span><\/td><td><span>string<\/span><\/td><td><span>\u5185\u5b58\u8bf7\u6c42\uff0c\u5355\u4f4d\u4e3aMIB\u3001GiB\uff0c\u5bb9\u5668\u542f\u52a8\u7684\u521d\u59cb\u5316\u53ef\u7528\u6570\u91cf<\/span><\/td><\/tr><tr><td><span>spec.restartPolicy<\/span><\/td><td><span>string<\/span><\/td><td><span>\u5b9a\u4e49 pod \u7684\u91cd\u542f\u7b56\u7565\uff0c\u53ef\u9009\u503c\u4e3a Always\u3001OnFailure\u3001Never\uff0c\u9ed8\u8ba4\u503c\u4e3a Always\u3002<\/span><br \/><span>  &#8211; Always\uff1apod \u4e00\u65e6\u7ec8\u6b62\u8fd0\u884c\uff0c\u5219\u65e0\u8bba\u5bb9\u5668\u662f\u5982\u4f55\u7ec8\u6b62\u7684\uff0ckubelet \u670d\u52a1\u90fd\u5c06\u91cd\u542f\u5b83\u3002<\/span><br \/><span>  &#8211; OnFailure\uff1a\u53ea\u6709 pod \u4ee5\u975e\u96f6\u9000\u51fa\u7801\u7ec8\u6b62\u65f6\uff0ckubelet \u624d\u4f1a\u91cd\u542f\u8be5\u5bb9\u5668\u3002\u5982\u679c\u5bb9\u5668\u6b63\u5e38\u7ed3\u675f\uff08\u9000\u51fa\u7801\u4e3a0\uff09\uff0c\u5219 kubectl \u5c06\u4e0d\u4f1a\u91cd\u542f\u5b83\u3002<\/span><br \/><span>  &#8211; Never\uff1aPod \u7ec8\u6b62\u540e\uff0ckubelet \u5c06\u9000\u51fa\u7801\u62a5\u544a\u7ed9 master\uff0c\u4e0d\u4f1a\u91cd\u542f\u8be5 pod<\/span><\/td><\/tr><tr><td><span>spec.nodeSelector<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u5b9a\u4e49 Node \u7684 label \u8fc7\u6ee4\u6807\u7b7e\uff0c\u4ee5 key\uff1avalue \u683c\u5f0f\u6307\u5b9a<\/span><\/td><\/tr><tr><td><span>spec.imagePullSecrets<\/span><\/td><td><span>Object<\/span><\/td><td><span>\u5b9a\u4e49 pull \u955c\u50cf\u65f6\u4f7f\u7528 secret \u540d\u79f0\uff0c\u4ee5 name\uff1asecretkey \u683c\u5f0f\u6307\u5b9a<\/span><\/td><\/tr><tr><td><span>spec.hostNetwork<\/span><\/td><td><span>Boolean<\/span><\/td><td><span>\u5b9a\u4e49\u662f\u5426\u4f7f\u7528\u4e3b\u673a\u7f51\u7edc\u6a21\u5f0f\uff0c\u9ed8\u8ba4\u503c\u4e3a false\u3002\u8bbe\u7f6e true \u8868\u793a\u4f7f\u7528\u5bbf\u4e3b\u673a\u7f51\u7edc\uff0c\u4e0d\u4f7f\u7528 docker \u7f51\u6865\uff0c\u540c\u65f6\u8bbe\u7f6e\u4e86 true\u5c06\u65e0\u6cd5\u5728\u540c\u4e00\u53f0\u5bbf\u4e3b\u673a\u4e0a\u542f\u52a8\u7b2c\u4e8c\u4e2a\u526f\u672c<\/span><\/td><\/tr><\/tbody><\/table><\/figure><p>&nbsp;<\/p><\/div><\/div>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>k8s \u7684\u8d44\u6e90\u6e05\u5355 K8S \u7684\u8d44\u6e90\u6e05\u5355 \u53c2\u6570\u540d \u7c7b\u578b \u5b57\u6bb5\u8bf4\u660e apiVersion String K8S A [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-k8s"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27"}],"version-history":[{"count":1,"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":28,"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=\/wp\/v2\/posts\/27\/revisions\/28"}],"wp:attachment":[{"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.8ykxvf.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}