2019-04-09 14:03:27 +00:00
<!doctype html>
< html lang = "en" class = "no-js" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
2019-11-08 14:46:32 +00:00
< link rel = "canonical" href = "https://kubernetes.github.io/ingress-nginx/kubectl-plugin/" >
2019-04-09 14:03:27 +00:00
< link rel = "shortcut icon" href = "../assets/images/favicon.png" >
2020-04-15 17:09:38 +00:00
< meta name = "generator" content = "mkdocs-1.1, mkdocs-material-5.1.0" >
2019-04-09 14:03:27 +00:00
2019-04-09 22:45:20 +00:00
< title > kubectl plugin - NGINX Ingress Controller< / title >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< link rel = "stylesheet" href = "../assets/stylesheets/main.89dc9fe3.min.css" >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< link rel = "stylesheet" href = "../assets/stylesheets/palette.ecd4686e.min.css" >
2019-04-09 14:03:27 +00:00
< meta name = "theme-color" content = "#009688" >
< link href = "https://fonts.gstatic.com" rel = "preconnect" crossorigin >
2020-02-09 23:53:05 +00:00
< link rel = "stylesheet" href = "https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback" >
2020-04-15 17:09:38 +00:00
< style > body , input { font-family : "Roboto" , - apple-system , BlinkMacSystemFont , Helvetica , Arial , sans-serif } code , kbd , pre { font-family : "Roboto Mono" , SFMono-Regular , Consolas , Menlo , monospace } < / style >
2019-04-09 14:03:27 +00:00
< link rel = "stylesheet" href = "../extra.css" >
2020-04-15 17:09:38 +00:00
< link rel = "preconnect dns-prefetch" href = "https://www.google-analytics.com" >
< script > window . ga = window . ga || function ( ) { ( ga . q = ga . q || [ ] ) . push ( arguments ) } , ga . l = + new Date , ga ( "create" , "UA-118407822-1" , "kubernetes.github.io" ) , ga ( "set" , "anonymizeIp" , ! 0 ) , ga ( "send" , "pageview" ) , document . addEventListener ( "DOMContentLoaded" , function ( ) { document . forms . search && document . forms . search . query . addEventListener ( "blur" , function ( ) { if ( this . value ) { var e = document . location . pathname ; ga ( "send" , "pageview" , e + "?q=" + this . value ) } } ) } ) , document . addEventListener ( "DOMContentSwitch" , function ( ) { ga ( "send" , "pageview" ) } ) < / script >
2019-04-09 14:03:27 +00:00
< script async src = "https://www.google-analytics.com/analytics.js" > < / script >
< / head >
2020-04-15 17:09:38 +00:00
2019-04-09 14:03:27 +00:00
< body dir = "ltr" data-md-color-primary = "teal" data-md-color-accent = "green" >
< input class = "md-toggle" data-md-toggle = "drawer" type = "checkbox" id = "__drawer" autocomplete = "off" >
< input class = "md-toggle" data-md-toggle = "search" type = "checkbox" id = "__search" autocomplete = "off" >
2020-04-15 17:09:38 +00:00
< label class = "md-overlay" for = "__drawer" > < / label >
< div data-md-component = "skip" >
< a href = "#the-ingress-nginx-kubectl-plugin" class = "md-skip" >
Skip to content
< / a >
< / div >
< div data-md-component = "announce" >
< / div >
2019-04-09 14:03:27 +00:00
< header class = "md-header" data-md-component = "header" >
2020-04-15 17:09:38 +00:00
< nav class = "md-header-nav md-grid" aria-label = "Header" >
< a href = "https://kubernetes.github.io/ingress-nginx" title = "NGINX Ingress Controller" class = "md-header-nav__button md-logo" aria-label = "NGINX Ingress Controller" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M12,8A3,3 0 0,0 15,5A3,3 0 0,0 12,2A3,3 0 0,0 9,5A3,3 0 0,0 12,8M12,11.54C9.64,9.35 6.5,8 3,8V19C6.5,19 9.64,20.35 12,22.54C14.36,20.35 17.5,19 21,19V8C17.5,8 14.36,9.35 12,11.54Z" / > < / svg >
< / a >
< label class = "md-header-nav__button md-icon" for = "__drawer" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" / > < / svg >
< / label >
< div class = "md-header-nav__title" data-md-component = "header-title" >
< div class = "md-header-nav__ellipsis" >
< span class = "md-header-nav__topic md-ellipsis" >
NGINX Ingress Controller
< / span >
< span class = "md-header-nav__topic md-ellipsis" >
kubectl plugin
< / span >
2019-04-09 14:03:27 +00:00
< / div >
2020-04-15 17:09:38 +00:00
< / div >
< label class = "md-header-nav__button md-icon" for = "__search" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" / > < / svg >
< / label >
2019-04-09 14:03:27 +00:00
< div class = "md-search" data-md-component = "search" role = "dialog" >
< label class = "md-search__overlay" for = "__search" > < / label >
< div class = "md-search__inner" role = "search" >
< form class = "md-search__form" name = "search" >
2020-04-15 17:09:38 +00:00
< input type = "text" class = "md-search__input" name = "query" aria-label = "Search" placeholder = "Search" autocapitalize = "off" autocorrect = "off" autocomplete = "off" spellcheck = "false" data-md-component = "search-query" data-md-state = "active" >
< label class = "md-search__icon md-icon" for = "__search" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" / > < / svg >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / label >
< button type = "reset" class = "md-search__icon md-icon" aria-label = "Clear" data-md-component = "search-reset" tabindex = "-1" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" / > < / svg >
2019-04-09 14:03:27 +00:00
< / button >
< / form >
< div class = "md-search__output" >
< div class = "md-search__scrollwrap" data-md-scrollfix >
2020-04-15 17:09:38 +00:00
< div class = "md-search-result" data-md-component = "search-result" >
2019-04-09 14:03:27 +00:00
< div class = "md-search-result__meta" >
Type to start searching
< / div >
< ol class = "md-search-result__list" > < / ol >
< / div >
< / div >
< / div >
< / div >
< / div >
2020-04-15 17:09:38 +00:00
< div class = "md-header-nav__source" >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< a href = "https://github.com/kubernetes/ingress-nginx/" title = "Go to repository" class = "md-source" >
< div class = "md-source__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 448 512" > < path d = "M439.55 236.05L244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z" / > < / svg >
< / div >
2019-04-09 14:03:27 +00:00
< div class = "md-source__repository" >
kubernetes/ingress-nginx
< / div >
< / a >
2020-04-15 17:09:38 +00:00
< / div >
2019-04-09 14:03:27 +00:00
< / nav >
< / header >
2020-04-15 17:09:38 +00:00
< div class = "md-container" data-md-component = "container" >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
2019-04-09 14:03:27 +00:00
2019-04-09 22:45:20 +00:00
2020-04-15 17:09:38 +00:00
< nav class = "md-tabs md-tabs--active" aria-label = "Tabs" data-md-component = "tabs" >
2019-04-09 14:03:27 +00:00
< div class = "md-tabs__inner md-grid" >
< ul class = "md-tabs__list" >
< li class = "md-tabs__item" >
2019-09-22 20:06:22 +00:00
< a href = ".." class = "md-tabs__link md-tabs__link--active" >
2019-04-09 14:03:27 +00:00
Welcome
< / a >
< / li >
< li class = "md-tabs__item" >
2019-09-22 20:06:22 +00:00
< a href = "../deploy/" class = "md-tabs__link" >
2019-04-09 14:03:27 +00:00
Deployment
< / a >
< / li >
< li class = "md-tabs__item" >
2019-09-22 20:06:22 +00:00
< a href = "../user-guide/nginx-configuration/" class = "md-tabs__link" >
2019-04-09 14:03:27 +00:00
User guide
< / a >
< / li >
< li class = "md-tabs__item" >
2019-09-22 20:06:22 +00:00
< a href = "../examples/" class = "md-tabs__link" >
2019-04-09 14:03:27 +00:00
Examples
< / a >
< / li >
< / ul >
< / div >
< / nav >
2020-04-15 17:09:38 +00:00
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< main class = "md-main" data-md-component = "main" >
< div class = "md-main__inner md-grid" >
2019-04-09 14:03:27 +00:00
< div class = "md-sidebar md-sidebar--primary" data-md-component = "navigation" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav md-nav--primary" aria-label = "Navigation" data-md-level = "0" >
< label class = "md-nav__title" for = "__drawer" >
< a href = "https://kubernetes.github.io/ingress-nginx" title = "NGINX Ingress Controller" class = "md-nav__button md-logo" aria-label = "NGINX Ingress Controller" >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M12,8A3,3 0 0,0 15,5A3,3 0 0,0 12,2A3,3 0 0,0 9,5A3,3 0 0,0 12,8M12,11.54C9.64,9.35 6.5,8 3,8V19C6.5,19 9.64,20.35 12,22.54C14.36,20.35 17.5,19 21,19V8C17.5,8 14.36,9.35 12,11.54Z" / > < / svg >
2019-04-09 14:03:27 +00:00
< / a >
NGINX Ingress Controller
< / label >
< div class = "md-nav__source" >
2020-04-15 17:09:38 +00:00
< a href = "https://github.com/kubernetes/ingress-nginx/" title = "Go to repository" class = "md-source" >
< div class = "md-source__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 448 512" > < path d = "M439.55 236.05L244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z" / > < / svg >
< / div >
2019-04-09 14:03:27 +00:00
< div class = "md-source__repository" >
kubernetes/ingress-nginx
< / div >
< / a >
< / div >
< ul class = "md-nav__list" data-md-scrollfix >
2019-04-09 22:45:20 +00:00
2019-04-09 14:03:27 +00:00
2019-04-09 22:45:20 +00:00
< li class = "md-nav__item md-nav__item--active md-nav__item--nested" >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-1" type = "checkbox" id = "nav-1" checked >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-1" >
Welcome
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Welcome" data-md-level = "1" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-1" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
Welcome
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = ".." title = "Welcome" class = "md-nav__link" >
Welcome
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../how-it-works/" title = "How it works" class = "md-nav__link" >
How it works
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../troubleshooting/" title = "Troubleshooting" class = "md-nav__link" >
Troubleshooting
< / a >
< / li >
2019-04-09 22:45:20 +00:00
< li class = "md-nav__item md-nav__item--active" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "toc" type = "checkbox" id = "__toc" >
2019-04-09 22:45:20 +00:00
< label class = "md-nav__link md-nav__link--active" for = "__toc" >
kubectl plugin
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M3,9H17V7H3V9M3,13H17V11H3V13M3,17H17V15H3V17M19,17H21V15H19V17M19,7V9H21V7H19M19,13H21V11H19V13Z" / > < / svg >
< / span >
2019-04-09 22:45:20 +00:00
< / label >
< a href = "./" title = "kubectl plugin" class = "md-nav__link md-nav__link--active" >
kubectl plugin
< / a >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav md-nav--secondary" aria-label = "Table of contents" >
2019-04-09 22:45:20 +00:00
2020-04-15 17:09:38 +00:00
< label class = "md-nav__title" for = "__toc" >
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
Table of contents
< / label >
2019-04-09 22:45:20 +00:00
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#installation" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
Installation
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#common-flags" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
Common Flags
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#subcommands" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
Subcommands
< / a >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Subcommands" >
2019-04-09 22:45:20 +00:00
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#backends" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
backends
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#certs" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
certs
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#conf" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
conf
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#exec" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
exec
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#general" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
general
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#info" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
info
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#ingresses" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
ingresses
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#lint" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
lint
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#logs" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
logs
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#ssh" class = "md-nav__link" >
2019-04-09 22:45:20 +00:00
ssh
< / a >
< / li >
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / li >
2019-04-09 14:03:27 +00:00
< li class = "md-nav__item" >
< a href = "../development/" title = "Development" class = "md-nav__link" >
Development
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-2" type = "checkbox" id = "nav-2" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-2" >
Deployment
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Deployment" data-md-level = "1" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-2" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
Deployment
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../deploy/" title = "Installation Guide" class = "md-nav__link" >
Installation Guide
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../deploy/baremetal/" title = "Bare-metal considerations" class = "md-nav__link" >
Bare-metal considerations
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../deploy/rbac/" title = "Role Based Access Control (RBAC)" class = "md-nav__link" >
Role Based Access Control (RBAC)
< / a >
< / li >
2019-05-26 08:06:36 +00:00
< li class = "md-nav__item" >
< a href = "../deploy/validating-webhook/" title = "Validating Webhook (admission controller)" class = "md-nav__link" >
Validating Webhook (admission controller)
< / a >
< / li >
2019-04-09 14:03:27 +00:00
< li class = "md-nav__item" >
< a href = "../deploy/upgrade/" title = "Upgrade" class = "md-nav__link" >
Upgrade
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-3" type = "checkbox" id = "nav-3" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-3" >
User guide
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "User guide" data-md-level = "1" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-3" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
User guide
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-3-1" type = "checkbox" id = "nav-3-1" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-3-1" >
NGINX Configuration
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "NGINX Configuration" data-md-level = "2" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-3-1" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
NGINX Configuration
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../user-guide/nginx-configuration/" title = "Introduction" class = "md-nav__link" >
Introduction
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/basic-usage/" title = "Basic usage" class = "md-nav__link" >
Basic usage
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/nginx-configuration/annotations/" title = "Annotations" class = "md-nav__link" >
Annotations
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/nginx-configuration/configmap/" title = "ConfigMap" class = "md-nav__link" >
ConfigMap
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/nginx-configuration/custom-template/" title = "Custom NGINX template" class = "md-nav__link" >
Custom NGINX template
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/nginx-configuration/log-format/" title = "Log format" class = "md-nav__link" >
Log format
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/cli-arguments/" title = "Command line arguments" class = "md-nav__link" >
Command line arguments
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/custom-errors/" title = "Custom errors" class = "md-nav__link" >
Custom errors
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/default-backend/" title = "Default backend" class = "md-nav__link" >
Default backend
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/exposing-tcp-udp-services/" title = "Exposing TCP and UDP services" class = "md-nav__link" >
Exposing TCP and UDP services
< / a >
< / li >
2019-08-01 23:58:36 +00:00
< li class = "md-nav__item" >
< a href = "../user-guide/fcgi-services/" title = "Exposing FCGI services" class = "md-nav__link" >
Exposing FCGI services
< / a >
< / li >
2019-04-09 14:03:27 +00:00
< li class = "md-nav__item" >
< a href = "../user-guide/ingress-path-matching/" title = "Regular expressions in paths" class = "md-nav__link" >
Regular expressions in paths
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/external-articles/" title = "External Articles" class = "md-nav__link" >
External Articles
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/miscellaneous/" title = "Miscellaneous" class = "md-nav__link" >
Miscellaneous
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/monitoring/" title = "Prometheus and Grafana installation" class = "md-nav__link" >
Prometheus and Grafana installation
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/multiple-ingress/" title = "Multiple Ingress controllers" class = "md-nav__link" >
Multiple Ingress controllers
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/tls/" title = "TLS/HTTPS" class = "md-nav__link" >
TLS/HTTPS
< / a >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-3-13" type = "checkbox" id = "nav-3-13" >
2019-04-09 14:03:27 +00:00
2019-08-01 23:58:36 +00:00
< label class = "md-nav__link" for = "nav-3-13" >
2019-04-09 14:03:27 +00:00
Third party addons
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Third party addons" data-md-level = "2" >
2019-08-01 23:58:36 +00:00
< label class = "md-nav__title" for = "nav-3-13" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
Third party addons
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../user-guide/third-party-addons/modsecurity/" title = "ModSecurity Web Application Firewall" class = "md-nav__link" >
ModSecurity Web Application Firewall
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../user-guide/third-party-addons/opentracing/" title = "OpenTracing" class = "md-nav__link" >
OpenTracing
< / a >
< / li >
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-4" type = "checkbox" id = "nav-4" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-4" >
Examples
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Examples" data-md-level = "1" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-4" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
Examples
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../examples/" title = "Introduction" class = "md-nav__link" >
Introduction
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/PREREQUISITES/" title = "Prerequisites" class = "md-nav__link" >
Prerequisites
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/affinity/cookie/" title = "Sticky Sessions" class = "md-nav__link" >
Sticky Sessions
< / a >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-4-4" type = "checkbox" id = "nav-4-4" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-4-4" >
Auth
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Auth" data-md-level = "2" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-4-4" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
Auth
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../examples/auth/basic/" title = "Basic Authentication" class = "md-nav__link" >
Basic Authentication
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/auth/client-certs/" title = "Client Certificate Authentication" class = "md-nav__link" >
Client Certificate Authentication
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/auth/external-auth/" title = "External Basic Authentication" class = "md-nav__link" >
External Basic Authentication
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/auth/oauth-external-auth/" title = "External OAUTH Authentication" class = "md-nav__link" >
External OAUTH Authentication
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
2020-04-15 17:09:38 +00:00
< input class = "md-nav__toggle md-toggle" data-md-toggle = "nav-4-5" type = "checkbox" id = "nav-4-5" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__link" for = "nav-4-5" >
Customization
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
< / label >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Customization" data-md-level = "2" >
2019-04-09 14:03:27 +00:00
< label class = "md-nav__title" for = "nav-4-5" >
2020-04-15 17:09:38 +00:00
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
2019-04-09 14:03:27 +00:00
Customization
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../examples/customization/configuration-snippets/" title = "Configuration Snippets" class = "md-nav__link" >
Configuration Snippets
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/customization/custom-configuration/" title = "Custom Configuration" class = "md-nav__link" >
Custom Configuration
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/customization/custom-errors/" title = "Custom Errors" class = "md-nav__link" >
Custom Errors
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/customization/custom-headers/" title = "Custom Headers" class = "md-nav__link" >
Custom Headers
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/customization/external-auth-headers/" title = "External authentication" class = "md-nav__link" >
External authentication
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/customization/ssl-dh-param/" title = "Custom DH parameters for perfect forward secrecy" class = "md-nav__link" >
Custom DH parameters for perfect forward secrecy
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/customization/sysctl/" title = "Sysctl tuning" class = "md-nav__link" >
Sysctl tuning
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/docker-registry/" title = "Docker registry" class = "md-nav__link" >
Docker registry
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/grpc/" title = "gRPC" class = "md-nav__link" >
gRPC
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/multi-tls/" title = "Multi TLS certificate termination" class = "md-nav__link" >
Multi TLS certificate termination
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/rewrite/" title = "Rewrite" class = "md-nav__link" >
Rewrite
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/static-ip/" title = "Static IPs" class = "md-nav__link" >
Static IPs
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../examples/tls-termination/" title = "TLS termination" class = "md-nav__link" >
TLS termination
< / a >
< / li >
2019-08-01 23:58:36 +00:00
< li class = "md-nav__item" >
< a href = "../examples/psp/" title = "Pod Security Policy (PSP)" class = "md-nav__link" >
Pod Security Policy (PSP)
< / a >
< / li >
2019-04-09 14:03:27 +00:00
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / div >
< / div >
< / div >
< div class = "md-sidebar md-sidebar--secondary" data-md-component = "toc" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav md-nav--secondary" aria-label = "Table of contents" >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< label class = "md-nav__title" for = "__toc" >
< span class = "md-nav__icon md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
< / span >
Table of contents
< / label >
2019-04-09 14:03:27 +00:00
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#installation" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
Installation
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#common-flags" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
Common Flags
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#subcommands" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
Subcommands
< / a >
2020-04-15 17:09:38 +00:00
< nav class = "md-nav" aria-label = "Subcommands" >
2019-04-09 14:03:27 +00:00
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#backends" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
backends
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#certs" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
certs
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#conf" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
conf
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#exec" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
exec
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#general" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
general
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#info" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
info
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#ingresses" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
ingresses
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#lint" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
lint
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#logs" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
logs
< / a >
< / li >
< li class = "md-nav__item" >
2019-09-22 20:06:22 +00:00
< a href = "#ssh" class = "md-nav__link" >
2019-04-09 14:03:27 +00:00
ssh
< / a >
< / li >
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / div >
< / div >
< / div >
< div class = "md-content" >
< article class = "md-content__inner md-typeset" >
2020-04-15 17:09:38 +00:00
< a href = "https://github.com/kubernetes/ingress-nginx/edit/master/docs/kubectl-plugin.md" title = "Edit this page" class = "md-content__button md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" / > < / svg >
< / a >
2019-04-09 14:03:27 +00:00
<!--
-----------------NOTICE------------------------
This file is referenced in code as
https://github.com/kubernetes/ingress-nginx/blob/master/docs/kubectl-plugin.md
Do not move it without providing redirects.
-----------------------------------------------
-->
2019-11-08 19:24:34 +00:00
< h1 id = "the-ingress-nginx-kubectl-plugin" > The ingress-nginx kubectl plugin< a class = "headerlink" href = "#the-ingress-nginx-kubectl-plugin" title = "Permanent link" > ¶< / a > < / h1 >
< h2 id = "installation" > Installation< a class = "headerlink" href = "#installation" title = "Permanent link" > ¶< / a > < / h2 >
2019-09-22 20:06:22 +00:00
< p > Install < a href = "https://github.com/GoogleContainerTools/krew" > krew< / a > , then run< / p >
2020-04-15 17:09:38 +00:00
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "go" > kubectl krew install ingress-nginx< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-09-22 20:06:22 +00:00
< p > to install the plugin. Then run< / p >
2020-04-15 17:09:38 +00:00
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "go" > kubectl ingress-nginx --help< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-09-22 20:06:22 +00:00
< p > to make sure the plugin is properly installed and to get a list of commands:< / p >
2020-04-15 17:09:38 +00:00
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "go" > kubectl ingress-nginx --help< / span >
2019-04-09 14:03:27 +00:00
< span class = "go" > A kubectl plugin for inspecting your ingress-nginx deployments< / span >
< span class = "go" > Usage:< / span >
< span class = "go" > ingress-nginx [command]< / span >
< span class = "go" > Available Commands:< / span >
< span class = "go" > backends Inspect the dynamic backend information of an ingress-nginx instance< / span >
< span class = "go" > certs Output the certificate data stored in an ingress-nginx pod< / span >
< span class = "go" > conf Inspect the generated nginx.conf< / span >
< span class = "go" > exec Execute a command inside an ingress-nginx pod< / span >
< span class = "go" > general Inspect the other dynamic ingress-nginx information< / span >
< span class = "go" > help Help about any command< / span >
< span class = "go" > info Show information about the ingress-nginx service< / span >
< span class = "go" > ingresses Provide a short summary of all of the ingress definitions< / span >
< span class = "go" > lint Inspect kubernetes resources for possible issues< / span >
< span class = "go" > logs Get the kubernetes logs for an ingress-nginx pod< / span >
< span class = "go" > ssh ssh into a running ingress-nginx pod< / span >
< span class = "go" > Flags:< / span >
< span class = "go" > --as string Username to impersonate for the operation< / span >
< span class = "go" > --as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.< / span >
< span class = "go" > --cache-dir string Default HTTP cache directory (default " /Users/alexkursell/.kube/http-cache" )< / span >
< span class = "go" > --certificate-authority string Path to a cert file for the certificate authority< / span >
< span class = "go" > --client-certificate string Path to a client certificate file for TLS< / span >
< span class = "go" > --client-key string Path to a client key file for TLS< / span >
< span class = "go" > --cluster string The name of the kubeconfig cluster to use< / span >
< span class = "go" > --context string The name of the kubeconfig context to use< / span >
< span class = "go" > -h, --help help for ingress-nginx< / span >
< span class = "go" > --insecure-skip-tls-verify If true, the server' s certificate will not be checked for validity. This will make your HTTPS connections insecure< / span >
< span class = "go" > --kubeconfig string Path to the kubeconfig file to use for CLI requests.< / span >
< span class = "go" > -n, --namespace string If present, the namespace scope for this CLI request< / span >
< span class = "go" > --request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don' t timeout requests. (default " 0" )< / span >
< span class = "go" > -s, --server string The address and port of the Kubernetes API server< / span >
< span class = "go" > --token string Bearer token for authentication to the API server< / span >
< span class = "go" > --user string The name of the kubeconfig user to use< / span >
< span class = "go" > Use " ingress-nginx [command] --help" for more information about a command.< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< p > If a new < code > ingress-nginx< / code > version has just been released, the plugin may not yet have been updated inside the repository. In that case, you can install the latest version of the plugin by running:< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "go" > (< / span >
2019-04-09 14:03:27 +00:00
< span class = "go" > set -x; cd " $(mktemp -d)" & & < / span >
< span class = "go" > curl -fsSLO " https://github.com/kubernetes/ingress-nginx/releases/download/nginx-0.24.0/{ingress-nginx.yaml,kubectl-ingress_nginx-$(uname | tr ' [:upper:]' ' [:lower:]' )-amd64.tar.gz}" & & < / span >
< span class = "go" > kubectl krew install \< / span >
< span class = "go" > --manifest=ingress-nginx.yaml --archive=kubectl-ingress_nginx-$(uname | tr ' [:upper:]' ' [:lower:]' )-amd64.tar.gz< / span >
< span class = "go" > )< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< p > Replacing < code > 0.24.0< / code > with the recently released version.< / p >
2019-11-08 19:24:34 +00:00
< h2 id = "common-flags" > Common Flags< a class = "headerlink" href = "#common-flags" title = "Permanent link" > ¶< / a > < / h2 >
2019-04-09 14:03:27 +00:00
< ul >
2020-04-15 17:09:38 +00:00
< li > Every subcommand supports the basic < code > kubectl< / code > configuration flags like < code > --namespace< / code > , < code > --context< / code > , < code > --client-key< / code > and so on.< / li >
< li > Subcommands that act on a particular < code > ingress-nginx< / code > pod (< code > backends< / code > , < code > certs< / code > , < code > conf< / code > , < code > exec< / code > , < code > general< / code > , < code > logs< / code > , < code > ssh< / code > ), support the < code > --deployment < deployment> < / code > and < code > --pod < pod> < / code > flags to select either a pod from a deployment with the given name, or a pod with the given name. The < code > --deployment< / code > flag defaults to < code > nginx-ingress-controller< / code > .< / li >
< li > Subcommands that inspect resources (< code > ingresses< / code > , < code > lint< / code > ) support the < code > --all-namespaces< / code > flag, which causes them to inspect resources in every namespace.< / li >
2019-04-09 14:03:27 +00:00
< / ul >
2019-11-08 19:24:34 +00:00
< h2 id = "subcommands" > Subcommands< a class = "headerlink" href = "#subcommands" title = "Permanent link" > ¶< / a > < / h2 >
2020-04-15 17:09:38 +00:00
< p > Note that < code > backends< / code > , < code > general< / code > , < code > certs< / code > , and < code > conf< / code > require < code > ingress-nginx< / code > version < code > 0.23.0< / code > or higher.< / p >
2019-11-08 19:24:34 +00:00
< h3 id = "backends" > backends< a class = "headerlink" href = "#backends" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > Run < code > kubectl ingress-nginx backends< / code > to get a JSON array of the backends that an ingress-nginx controller currently knows about:< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx backends -n ingress-nginx
2019-04-09 14:03:27 +00:00
< span class = "go" > [< / span >
< span class = "go" > {< / span >
< span class = "go" > " name" : " default-apple-service-5678" ,< / span >
< span class = "go" > " service" : {< / span >
< span class = "go" > " metadata" : {< / span >
< span class = "go" > " creationTimestamp" : null< / span >
< span class = "go" > },< / span >
< span class = "go" > " spec" : {< / span >
< span class = "go" > " ports" : [< / span >
< span class = "go" > {< / span >
< span class = "go" > " protocol" : " TCP" ,< / span >
< span class = "go" > " port" : 5678,< / span >
< span class = "go" > " targetPort" : 5678< / span >
< span class = "go" > }< / span >
< span class = "go" > ],< / span >
< span class = "go" > " selector" : {< / span >
< span class = "go" > " app" : " apple" < / span >
< span class = "go" > },< / span >
< span class = "go" > " clusterIP" : " 10.97.230.121" ,< / span >
< span class = "go" > " type" : " ClusterIP" ,< / span >
< span class = "go" > " sessionAffinity" : " None" < / span >
< span class = "go" > },< / span >
< span class = "go" > " status" : {< / span >
< span class = "go" > " loadBalancer" : {}< / span >
< span class = "go" > }< / span >
< span class = "go" > },< / span >
< span class = "go" > " port" : 0,< / span >
< span class = "go" > " sslPassthrough" : false,< / span >
< span class = "go" > " endpoints" : [< / span >
< span class = "go" > {< / span >
< span class = "go" > " address" : " 10.1.3.86" ,< / span >
< span class = "go" > " port" : " 5678" < / span >
< span class = "go" > }< / span >
< span class = "go" > ],< / span >
< span class = "go" > " sessionAffinityConfig" : {< / span >
< span class = "go" > " name" : " " ,< / span >
< span class = "go" > " cookieSessionAffinity" : {< / span >
< span class = "go" > " name" : " " < / span >
< span class = "go" > }< / span >
< span class = "go" > },< / span >
< span class = "go" > " upstreamHashByConfig" : {< / span >
< span class = "go" > " upstream-hash-by-subset-size" : 3< / span >
< span class = "go" > },< / span >
< span class = "go" > " noServer" : false,< / span >
< span class = "go" > " trafficShapingPolicy" : {< / span >
< span class = "go" > " weight" : 0,< / span >
< span class = "go" > " header" : " " ,< / span >
< span class = "go" > " headerValue" : " " ,< / span >
< span class = "go" > " cookie" : " " < / span >
< span class = "go" > }< / span >
< span class = "go" > },< / span >
< span class = "go" > {< / span >
< span class = "go" > " name" : " default-echo-service-8080" ,< / span >
< span class = "go" > ...< / span >
< span class = "go" > },< / span >
< span class = "go" > {< / span >
< span class = "go" > " name" : " upstream-default-backend" ,< / span >
< span class = "go" > ...< / span >
< span class = "go" > }< / span >
< span class = "go" > ]< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< p > Add the < code > --list< / code > option to show only the backend names. Add the < code > --backend < backend> < / code > option to show only the backend with the given name.< / p >
2019-11-08 19:24:34 +00:00
< h3 id = "certs" > certs< a class = "headerlink" href = "#certs" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > Use < code > kubectl ingress-nginx certs --host < hostname> < / code > to dump the SSL cert/key information for a given host.< / p >
2019-09-22 20:06:22 +00:00
< p > < strong > WARNING:< / strong > This command will dump sensitive private key information. Don't blindly share the output, and certainly don't log it anywhere.< / p >
2020-04-15 17:09:38 +00:00
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx certs -n ingress-nginx --host testaddr.local
2019-04-09 14:03:27 +00:00
< span class = "go" > -----BEGIN CERTIFICATE-----< / span >
< span class = "go" > ...< / span >
< span class = "go" > -----END CERTIFICATE-----< / span >
< span class = "go" > -----BEGIN CERTIFICATE-----< / span >
< span class = "go" > ...< / span >
< span class = "go" > -----END CERTIFICATE-----< / span >
< span class = "go" > -----BEGIN RSA PRIVATE KEY-----< / span >
< span class = "go" > < REDACTED! DO NOT SHARE THIS!> < / span >
< span class = "go" > -----END RSA PRIVATE KEY-----< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "conf" > conf< a class = "headerlink" href = "#conf" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > Use < code > kubectl ingress-nginx conf< / code > to dump the generated < code > nginx.conf< / code > file. Add the < code > --host < hostname> < / code > option to view only the server block for that host:< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "go" > kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local< / span >
2019-04-09 14:03:27 +00:00
< span class = "go" > server {< / span >
< span class = "go" > server_name testaddr.local ;< / span >
< span class = "go" > listen 80;< / span >
< span class = "go" > set $proxy_upstream_name " -" ;< / span >
< span class = "go" > set $pass_access_scheme $scheme;< / span >
< span class = "go" > set $pass_server_port $server_port;< / span >
< span class = "go" > set $best_http_host $http_host;< / span >
< span class = "go" > set $pass_port $pass_server_port;< / span >
< span class = "go" > location / {< / span >
< span class = "go" > set $namespace " " ;< / span >
< span class = "go" > set $ingress_name " " ;< / span >
< span class = "go" > set $service_name " " ;< / span >
< span class = "go" > set $service_port " 0" ;< / span >
< span class = "go" > set $location_path " /" ;< / span >
< span class = "go" > ...< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "exec" > exec< a class = "headerlink" href = "#exec" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > < code > kubectl ingress-nginx exec< / code > is exactly the same as < code > kubectl exec< / code > , with the same command flags. It will automatically choose an < code > ingress-nginx< / code > pod to run the command in.< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx < span class = "nb" > exec< / span > -i -n ingress-nginx -- ls /etc/nginx
2019-04-09 14:03:27 +00:00
< span class = "go" > fastcgi_params< / span >
< span class = "go" > geoip< / span >
< span class = "go" > lua< / span >
< span class = "go" > mime.types< / span >
< span class = "go" > modsecurity< / span >
< span class = "go" > modules< / span >
< span class = "go" > nginx.conf< / span >
< span class = "go" > opentracing.json< / span >
< span class = "go" > owasp-modsecurity-crs< / span >
< span class = "go" > template< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "general" > general< a class = "headerlink" href = "#general" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > < code > kubectl ingress-nginx general< / code > dumps miscellaneous controller state as a JSON object. Currently it just shows the number of controller pods known to a particular controller pod.< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx general -n ingress-nginx
2019-04-09 14:03:27 +00:00
< span class = "go" > {< / span >
< span class = "go" > " controllerPodsCount" : 1< / span >
< span class = "go" > }< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "info" > info< a class = "headerlink" href = "#info" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > Shows the internal and external IP/CNAMES for an < code > ingress-nginx< / code > service.< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx info -n ingress-nginx
2019-04-09 14:03:27 +00:00
< span class = "go" > Service cluster IP address: 10.187.253.31< / span >
< span class = "go" > LoadBalancer IP|CNAME: 35.123.123.123< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< p > Use the < code > --service < service> < / code > flag if your < code > ingress-nginx< / code > < code > LoadBalancer< / code > service is not named < code > ingress-nginx< / code > .< / p >
2019-11-08 19:24:34 +00:00
< h3 id = "ingresses" > ingresses< a class = "headerlink" href = "#ingresses" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > < code > kubectl ingress-nginx ingresses< / code > , alternately < code > kubectl ingress-nginx ing< / code > , shows a more detailed view of the ingress definitions in a namespace. Compare:< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl get ingresses --all-namespaces
2019-04-09 14:03:27 +00:00
< span class = "go" > NAMESPACE NAME HOSTS ADDRESS PORTS AGE< / span >
< span class = "go" > default example-ingress1 testaddr.local,testaddr2.local localhost 80 5d< / span >
< span class = "go" > default test-ingress-2 * localhost 80 5d< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
< p > vs< / p >
2020-04-15 17:09:38 +00:00
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx ingresses --all-namespaces
2019-04-09 14:03:27 +00:00
< span class = "go" > NAMESPACE INGRESS NAME HOST+PATH ADDRESSES TLS SERVICE SERVICE PORT ENDPOINTS< / span >
< span class = "go" > default example-ingress1 testaddr.local/etameta localhost NO pear-service 5678 5< / span >
< span class = "go" > default example-ingress1 testaddr2.local/otherpath localhost NO apple-service 5678 1< / span >
< span class = "go" > default example-ingress1 testaddr2.local/otherotherpath localhost NO pear-service 5678 5< / span >
< span class = "go" > default test-ingress-2 * localhost NO echo-service 8080 2< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "lint" > lint< a class = "headerlink" href = "#lint" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > < code > kubectl ingress-nginx lint< / code > can check a namespace or entire cluster for potential configuration issues. This command is especially useful when upgrading between < code > ingress-nginx< / code > versions.< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx lint --all-namespaces --verbose
2019-04-09 14:03:27 +00:00
< span class = "go" > Checking ingresses...< / span >
< span class = "go" > ✗ anamespace/this-nginx< / span >
< span class = "go" > - Contains the removed session-cookie-hash annotation.< / span >
< span class = "go" > Lint added for version 0.24.0< / span >
< span class = "go" > https://github.com/kubernetes/ingress-nginx/issues/3743< / span >
< span class = "go" > ✗ othernamespace/ingress-definition-blah< / span >
< span class = "go" > - The rewrite-target annotation value does not reference a capture group< / span >
< span class = "go" > Lint added for version 0.22.0< / span >
< span class = "go" > https://github.com/kubernetes/ingress-nginx/issues/3174< / span >
< span class = "go" > Checking deployments...< / span >
< span class = "go" > ✗ namespace2/nginx-ingress-controller< / span >
< span class = "go" > - Uses removed config flag --sort-backends< / span >
< span class = "go" > Lint added for version 0.22.0< / span >
< span class = "go" > https://github.com/kubernetes/ingress-nginx/issues/3655< / span >
< span class = "go" > - Uses removed config flag --enable-dynamic-certificates< / span >
< span class = "go" > Lint added for version 0.24.0< / span >
< span class = "go" > https://github.com/kubernetes/ingress-nginx/issues/3808< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2020-04-15 17:09:38 +00:00
< p > to show the lints added < strong > only< / strong > for a particular < code > ingress-nginx< / code > release, use the < code > --from-version< / code > and < code > --to-version< / code > flags:< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx lint --all-namespaces --verbose --from-version < span class = "m" > 0< / span > .24.0 --to-version < span class = "m" > 0< / span > .24.0
2019-04-09 14:03:27 +00:00
< span class = "go" > Checking ingresses...< / span >
< span class = "go" > ✗ anamespace/this-nginx< / span >
< span class = "go" > - Contains the removed session-cookie-hash annotation.< / span >
< span class = "go" > Lint added for version 0.24.0< / span >
< span class = "go" > https://github.com/kubernetes/ingress-nginx/issues/3743< / span >
< span class = "go" > Checking deployments...< / span >
< span class = "go" > ✗ namespace2/nginx-ingress-controller< / span >
< span class = "go" > - Uses removed config flag --enable-dynamic-certificates< / span >
< span class = "go" > Lint added for version 0.24.0< / span >
< span class = "go" > https://github.com/kubernetes/ingress-nginx/issues/3808< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "logs" > logs< a class = "headerlink" href = "#logs" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > < code > kubectl ingress-nginx logs< / code > is almost the same as < code > kubectl logs< / code > , with fewer flags. It will automatically choose an < code > ingress-nginx< / code > pod to read logs from.< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx logs -n ingress-nginx
2019-04-09 14:03:27 +00:00
< span class = "go" > -------------------------------------------------------------------------------< / span >
< span class = "go" > NGINX Ingress controller< / span >
< span class = "go" > Release: dev< / span >
< span class = "go" > Build: git-48dc3a867< / span >
< span class = "go" > Repository: git@github.com:kubernetes/ingress-nginx.git< / span >
< span class = "go" > -------------------------------------------------------------------------------< / span >
< span class = "go" > W0405 16:53:46.061589 7 flags.go:214] SSL certificate chain completion is disabled (--enable-ssl-chain-completion=false)< / span >
< span class = "go" > nginx version: nginx/1.15.9< / span >
< span class = "go" > W0405 16:53:46.070093 7 client_config.go:549] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.< / span >
< span class = "go" > I0405 16:53:46.070499 7 main.go:205] Creating API client for https://10.96.0.1:443< / span >
< span class = "go" > I0405 16:53:46.077784 7 main.go:249] Running in Kubernetes cluster version v1.10 (v1.10.11) - git (clean) commit 637c7e288581ee40ab4ca210618a89a555b6e7e9 - platform linux/amd64< / span >
< span class = "go" > I0405 16:53:46.183359 7 nginx.go:265] Starting NGINX Ingress controller< / span >
< span class = "go" > I0405 16:53:46.193913 7 event.go:209] Event(v1.ObjectReference{Kind:" ConfigMap" , Namespace:" ingress-nginx" , Name:" udp-services" , UID:" 82258915-563e-11e9-9c52-025000000001" , APIVersion:" v1" , ResourceVersion:" 494" , FieldPath:" " }): type: ' Normal' reason: ' CREATE' ConfigMap ingress-nginx/udp-services< / span >
< span class = "go" > ...< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
2019-11-08 19:24:34 +00:00
< h3 id = "ssh" > ssh< a class = "headerlink" href = "#ssh" title = "Permanent link" > ¶< / a > < / h3 >
2020-04-15 17:09:38 +00:00
< p > < code > kubectl ingress-nginx ssh< / code > is exactly the same as < code > kubectl ingress-nginx exec -it -- /bin/bash< / code > . Use it when you want to quickly be dropped into a shell inside a running < code > ingress-nginx< / code > container.< / p >
< div class = "highlight" > < pre > < span > < / span > < code > < span class = "gp" > $< / span > kubectl ingress-nginx ssh -n ingress-nginx
2019-04-09 14:03:27 +00:00
< span class = "gp" > www-data@nginx-ingress-controller-7cbf77c976-wx5pn:/etc/nginx$< / span >
2020-02-09 23:53:05 +00:00
< / code > < / pre > < / div >
2019-04-09 14:03:27 +00:00
< / article >
< / div >
< / div >
< / main >
< footer class = "md-footer" >
2019-04-09 22:45:20 +00:00
< div class = "md-footer-nav" >
2020-04-15 17:09:38 +00:00
< nav class = "md-footer-nav__inner md-grid" aria-label = "Footer" >
2019-04-09 22:45:20 +00:00
2020-04-15 17:09:38 +00:00
< a href = "../troubleshooting/" title = "Troubleshooting" class = "md-footer-nav__link md-footer-nav__link--prev" rel = "prev" >
< div class = "md-footer-nav__button md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" / > < / svg >
2019-04-09 22:45:20 +00:00
< / div >
2020-04-15 17:09:38 +00:00
< div class = "md-footer-nav__title" >
< div class = "md-ellipsis" >
2019-04-09 22:45:20 +00:00
< span class = "md-footer-nav__direction" >
Previous
< / span >
Troubleshooting
2020-04-15 17:09:38 +00:00
< / div >
2019-04-09 22:45:20 +00:00
< / div >
< / a >
2020-04-15 17:09:38 +00:00
< a href = "../development/" title = "Development" class = "md-footer-nav__link md-footer-nav__link--next" rel = "next" >
< div class = "md-footer-nav__title" >
< div class = "md-ellipsis" >
2019-04-09 22:45:20 +00:00
< span class = "md-footer-nav__direction" >
Next
< / span >
Development
2020-04-15 17:09:38 +00:00
< / div >
2019-04-09 22:45:20 +00:00
< / div >
2020-04-15 17:09:38 +00:00
< div class = "md-footer-nav__button md-icon" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" / > < / svg >
2019-04-09 22:45:20 +00:00
< / div >
< / a >
< / nav >
< / div >
2019-04-09 14:03:27 +00:00
< div class = "md-footer-meta md-typeset" >
< div class = "md-footer-meta__inner md-grid" >
< div class = "md-footer-copyright" >
2020-04-15 17:09:38 +00:00
Made with
2020-02-09 23:53:05 +00:00
< a href = "https://squidfunk.github.io/mkdocs-material/" target = "_blank" rel = "noopener" >
2020-04-15 17:09:38 +00:00
Material for MkDocs
< / a >
2019-04-09 14:03:27 +00:00
< / div >
< / div >
< / div >
< / footer >
< / div >
2020-04-15 17:09:38 +00:00
< script src = "../assets/javascripts/vendor.36cbf620.min.js" > < / script >
< script src = "../assets/javascripts/bundle.00c583dd.min.js" > < / script > < script id = "__lang" type = "application/json" > { "clipboard.copy" : "Copy to clipboard" , "clipboard.copied" : "Copied to clipboard" , "search.config.lang" : "en" , "search.config.pipeline" : "trimmer, stopWordFilter" , "search.config.separator" : "[\\s\\-]+" , "search.result.placeholder" : "Type to start searching" , "search.result.none" : "No matching documents" , "search.result.one" : "1 matching document" , "search.result.other" : "# matching documents" } < / script >
< script >
app = initialize({
base: "..",
features: ["tabs", "instant"],
search: Object.assign({
worker: "../assets/javascripts/worker/search.7f7c8775.min.js"
}, typeof search !== "undefined" & & search)
})
< / script >
2019-04-09 14:03:27 +00:00
< / body >
< / html >