Copy kubectl command ref docs to Hugo site. (#8430)

* Copy kubectl command ref docs to Hugo site.

* Fix link. Remove extraneous page.
pull/8479/head
Steve Perry 2018-05-10 14:31:56 -07:00 committed by k8s-ci-robot
parent b427be22ab
commit 2a655a05d0
11 changed files with 9002 additions and 1 deletions

View File

@ -5,7 +5,7 @@ approvers:
title: Overview of kubectl
---
`kubectl` is a command line interface for running commands against Kubernetes clusters. This overview covers `kubectl` syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the [kubectl](/docs/user-guide/kubectl/) reference documentation. For installation instructions see [installing kubectl](/docs/tasks/tools/install-kubectl/).
`kubectl` is a command line interface for running commands against Kubernetes clusters. This overview covers `kubectl` syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the [kubectl](/docs/reference/generated/kubectl/kubectl-commands/) reference documentation. For installation instructions see [installing kubectl](/docs/tasks/kubectl/install/).
## Syntax

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,99 @@
/*
Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
/* Base color: saturation 0; */
.hljs,
.hljs-subst {
color: #444;
}
.hljs-comment {
color: #888888;
}
.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
.hljs-meta-keyword,
.hljs-doctag,
.hljs-name {
font-weight: bold;
}
/* User color: hue: 0 */
.hljs-type,
.hljs-string,
.hljs-number,
.hljs-selector-id,
.hljs-selector-class,
.hljs-quote,
.hljs-template-tag,
.hljs-deletion {
color: #880000;
}
.hljs-title,
.hljs-section {
color: #880000;
font-weight: bold;
}
.hljs-regexp,
.hljs-symbol,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #BC6060;
}
/* Language color: hue: 90; */
.hljs-literal {
color: #78A960;
}
.hljs-built_in,
.hljs-bullet,
.hljs-code,
.hljs-addition {
color: #397300;
}
/* Meta color: hue: 200 */
.hljs-meta {
color: #1f7199;
}
.hljs-meta-string {
color: #4d99bf;
}
/* Misc effects */
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
* Licensed under MIT
* @author Ariel Flesler
* @version 2.1.2
*/
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,196 @@
$(document).ready(function() {
/**
* TODO: Refactor with intent toward pure functions. Mutation of state can lead to bugs and difficult debugging.
*/
var toc = navData.toc;
var flatToc = navData.flatToc.reverse();
function collectNodes(tocMap) {
var tocNodes = {};
tocMap.map(function(node, index) {
var sectionNode = $('#' + node.section);
var tocSubsections = {};
tocItem = {section: sectionNode};
var subsectionNodes;
if (node.subsections) {
subsectionNodes = (collectNodes(node.subsections));
tocItem.subsections = subsectionNodes;
}
tocNodes[node.section] = tocItem;
});
return tocNodes;
}
var tocItems = collectNodes(toc);
function collectNodesFlat(tocMap, obj) {
var collect = obj || {};
tocMap.map(function(node, index) {
var sectionNode = $('#' + node.section);
tocItem = {section: sectionNode};
if (node.subsections) {
subsectionNodes = (collectNodesFlat(node.subsections, collect));
}
collect[node.section] = sectionNode;
});
return collect;
}
var tocFlat = collectNodesFlat(toc);
var prevSectionToken;
var prevSubsectionToken;
var activeTokensObj = {};
function scrollActions(scrollPosition) {
var activeSection = checkNodePositions(toc, tocFlat, scrollPosition);
var activeSubSection,
prevL1Nav,
currL1Nav,
prevL2Nav,
currL2Nav;
// No active section - return existing activeTokensObj (may be empty)
if (!activeSection) {
return activeTokensObj;
}
/**
* This block deals with L1Nav sections
*/
// If no previous token, set previous to current active and show L1Nav
if (!prevSectionToken) {
prevSectionToken = activeSection.token;
currL1Nav = getNavNode(activeSection.token);
currL1Nav.show('fast');
}
// If active active is not the same as previous, hide previous L1Nav and show current L1Nav; set previous to current
else if (activeSection.token !== prevSectionToken) {
prevL1Nav = getNavNode(prevSectionToken);
currL1Nav = getNavNode(activeSection.token);
prevL1Nav.hide('fast');
currL1Nav.show('fast');
prevSectionToken = activeSection.token;
}
/**
* This block deals with L2Nav subsections
*/
// If there is a subsections array and it has a non-zero length, set active subsection
if (activeSection.subsections && activeSection.subsections.length !== 0) {
activeSubSection = checkNodePositions(activeSection.subsections, tocFlat, scrollPosition);
if (activeSubSection) {
if (!prevSubsectionToken) {
prevSubsectionToken = activeSubSection.token;
currL2Nav = getNavNode(activeSubSection.token);
currL2Nav.show('fast');
} else if (activeSubSection.token !== prevSubsectionToken) {
prevL2Nav = getNavNode(prevSubsectionToken);
currL2Nav = getNavNode(activeSubSection.token);
prevL2Nav.hide('fast');
currL2Nav.show('fast');
prevSubsectionToken = activeSubSection.token;
}
} else {
prevL2Nav = getNavNode(prevSubsectionToken);
prevL2Nav.hide('fast');
prevSubsectionToken = null;
}
}
activeTokensObj.L1 = prevSectionToken;
activeTokensObj.L2 = prevSubsectionToken;
return activeTokensObj;
}
/**
* Checks for active elements by scroll position
*/
var prevElemToken;
var activeElemToken;
function checkActiveElement(items, scrollPosition) {
var offset = 50;
var offsetScroll = scrollPosition + offset;
var visibleNode;
for (var i = 0; i < items.length; i++) {
var token = items[i];
var node = getHeadingNode(token);
if (offsetScroll >= node.offset().top) {
activeElemToken = token;
}
}
if (!prevElemToken) {
getNavElemNode(activeElemToken).addClass('selected');
prevElemToken = activeElemToken;
return;
}
if (activeElemToken !== prevElemToken) {
getNavElemNode(prevElemToken).removeClass('selected');
getNavElemNode(activeElemToken).addClass('selected');
prevElemToken = activeElemToken;
}
return activeElemToken;
}
function getHeadingNode(token) {
return $('#' + token);
}
function getNavNode(token) {
return $('#' + token + '-nav');
}
function getNavElemNode(token) {
return $('#sidebar-wrapper > ul a[href="#' + token + '"]');
}
function checkNodePositions(nodes, flatNodeMap, scrollPosition) {
var activeNode;
for (var i = 0; i < nodes.length; i++) {
var item = nodes[i];
var node = flatNodeMap[item.section];
var nodeTop = node.offset().top - 50;
if (scrollPosition >= nodeTop) {
activeNode = {token: item.section, node: node};
if (item.subsections) {
activeNode.subsections = item.subsections;
}
break;
}
}
return activeNode;
}
function scrollToNav(token) {
setTimeout(function() {
var scrollPosition = $(window).scrollTop();
var activeSectionTokens = scrollActions(scrollPosition);
var activeElemToken = checkActiveElement(flatToc, scrollPosition);
var navNode = $('#sidebar-wrapper > ul a[href="#' + token + '"]');
$('#sidebar-wrapper').scrollTo(navNode, {duration: 'fast', axis: 'y'});
}, 200);
}
$(window).on('hashchange', function(event) {
var scrollPosition = $(window).scrollTop();
var activeSectionTokens = scrollActions(scrollPosition);
var activeElemToken = checkActiveElement(flatToc, scrollPosition);
var scrollToken = activeSectionTokens.L2 ? activeSectionTokens.L2 : activeSectionTokens.L1;
scrollToNav(scrollToken);
var token = location.hash.slice(1);
});
var scrollPosition = $(window).scrollTop();
scrollActions(scrollPosition);
checkActiveElement(flatToc, scrollPosition);
// TODO: prevent scroll on sidebar from propogating to window
$(window).on('scroll', function(event) {
var scrollPosition = $(window).scrollTop();
var activeSectionTokens = scrollActions(scrollPosition);
var activeElemToken = checkActiveElement(flatToc, scrollPosition);
});
});

View File

@ -0,0 +1,269 @@
/*
Kubernetes colors
kubernetes blue - rgb(50, 109, 230)
dark blue - rgb(51, 113, 227)
dark grey - rgb(48, 48, 48)
light grey - rgb(161, 160, 158)
*/
/* User agent CSS overrides */
#sidebar-wrapper ul, #sidebar-wrapper li {
margin-left: 10px;
padding-left: 0;
}
/* Inspired by Slate CSS */
.body-content aside {
padding: 1.6em;
margin: 1.8em 0;
background: lightsteelblue;
line-height: 1.6;
border-radius: 15px;
}
.body-content aside.warning {
background-color: peachpuff;
}
.body-content aside.success {
background-color: olivedrab;
}
.body-content aside:before {
vertical-align: middle;
padding-right: 1em;
font-size: 16px;
}
.body-content aside.warning:before, .body-content aside.notice:before, .body-content aside.success:before {
font-family: 'FontAwesome';
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
}
.body-content aside.warning:before {
content: "\f071";
}
.body-content aside.notice:before {
content: "\f05a";
}
.body-content hr {
margin: 2em 0;
border-top: 2px solid dimgrey;
border-bottom: 2px solid antiquewhite;
}
.body-content table {
margin-bottom: 1em;
overflow: auto;
}
.body-content table th, .body-content table td {
text-align: left;
vertical-align: top;
line-height: 1.6;
}
.body-content table th {
padding: 15px 20px;
border-bottom: 1px solid lightsteelblue;
vertical-align: bottom;
}
.body-content table td {
padding: 10px;
}
.body-content table tr:last-child {
border-bottom: 1px solid lightsteelblue;
}
.body-content table tr:nth-child(odd) > td {
background-color: whitesmoke;
}
.body-content table tr:nth-child(even) > td {
background-color: lightsteelblue;
}
.body-content dt {
font-weight: bold;
}
.body-content dd {
margin-left: 15px;
}
.body-content p, .body-content li, .body-content dt, .body-content dd {
line-height: 1.6;
margin-top: 0;
}
/* Brodoc CSS */
body > #wrapper {
display: block;
padding-bottom: 500px;
background-image: linear-gradient(90deg, #FFFFFF 63%, rgb(48, 48, 48) 63%);
}
#sidebar-wrapper {
display: block;
height: 100%;
width: 20%;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: whitesmoke;
border-right: 2px solid slategrey;
overflow-x: hidden;
padding-top: 60px;
}
#sidebar-wrapper a {
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 0 5px;
}
#sidebar-wrapper ul {
list-style: none;
}
#sidebar-wrapper a.selected {
font-style: bold;
color: whitesmoke;
border: 1px solid rgb(161, 160, 158);
background-color: rgb(51, 113, 227);
border-radius: 5px;
}
#sidebar-wrapper .strong-nav {
font-family: monospace;
font-weight: bold;
}
#sidebar-wrapper .nav-level-1.strong-nav {
margin-top: 25px;
}
#sidebar-wrapper .copyright {
padding-left: 10px;
padding-top: 50px;
padding-bottom: 50px;
text-decoration: underline;
}
#page-content-wrapper {
margin-left: 20%;
padding-top: 60px;
}
.body-content h1, .body-content h2 {
width: 52%;
clear: both;
border-bottom: 3px solid lightslategrey;
}
.body-content > h3, .body-content > h4, .body-content > h5, .body-content > h6, .body-content > p, .body-content > aside, .body-content > ul > li, .body-content > ul > li {
width: 52%;
padding-top: 20px;
}
.body-content table {
width: 52%;
}
.body-content table tr td:not(:first-child) {
overflow-wrap: break-word;
word-wrap: break-word;
}
.body-content table tr td a {
word-break: break-word;
}
.body-content p code {
text-overflow: ellipsis;
display: inline-block;
font-size: smaller;
word-break: break-word;
}
.body-content blockquote {
border-left: 0;
border-radius: 5px;
}
.body-content pre.code-block {
margin-bottom: 80px;
}
.body-content blockquote p, .body-content pre {
color: black;
font-size: 13px;
}
.body-content blockquote.code-block {
background: lightsteelblue;
}
.body-content pre.code-block code {
overflow: auto;
overflow-wrap: normal;
word-wrap: normal;
white-space: pre;
}
.code-block {
display: none;
width: 45%;
float: right;
clear: right;
}
.code-block.active {
display: initial;
}
#code-tabs-wrapper {
width: 35%;
height: 60px;
position: fixed;
top: 0;
right: 0;
}
#code-tabs-wrapper .code-tab-list {
float: right;
margin-top: 0;
padding: 0 10px;
}
#code-tabs-wrapper .code-tab {
color: white;
display: inline-block;
padding: 0 30px;
background: rgb(48, 48, 48);
border: 1px solid rgb(161, 160, 158);
border-radius: 5px;
}
#code-tabs-wrapper .tab-selected {
background: rgb(51, 113, 227);
font-style: bold;
border-radius: 5px;
}
.side-nav a {
color: black;
}

View File

@ -0,0 +1,27 @@
$(document).ready(function() {
var codeTabs = $('#code-tabs-wrapper').find('li');
for (var i = 0; i < codeTabs.length; i++) {
createCodeTabListeners(codeTabs, i);
}
function createCodeTabListeners(codeTabs, index) {
var tab = $(codeTabs[index]),
id = tab.attr('id'),
codeClass = '.' + id;
tab.on('click', function() {
codeTabs.removeClass('tab-selected');
tab.addClass('tab-selected');
$('.code-block').removeClass('active');
$(codeClass).addClass('active');
});
}
function setDefautTab() {
$(codeTabs[0]).addClass('tab-selected');
$('.' + codeTabs[0].id).addClass('active');
}
setDefautTab();
});