1KUBERNETES(1)(kubernetes)                            KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7

NAME

9       kubectl diff - Diff the live version against a would-be applied version
10
11
12

SYNOPSIS

14       kubectl diff [OPTIONS]
15
16
17

DESCRIPTION

19       Diff configurations specified by file name or stdin between the current
20       online configuration, and the configuration as it would be if applied.
21
22
23       The output is always YAML.
24
25
26       KUBECTL_EXTERNAL_DIFF environment variable can be used to  select  your
27       own  diff command. Users can use external commands with params too, ex‐
28       ample: KUBECTL_EXTERNAL_DIFF="colordiff -N -u"
29
30
31       By default, the "diff" command available in your path will be run  with
32       the "-u" (unified diff) and "-N" (treat absent files as empty) options.
33
34
35       Exit  status: 0 No differences were found. 1 Differences were found. >1
36       Kubectl or diff failed with an error.
37
38
39       Note: KUBECTL_EXTERNAL_DIFF, if used, is expected to follow  that  con‐
40       vention.
41
42
43

OPTIONS

45       --field-manager="kubectl-client-side-apply"       Name  of  the manager
46       used to track field ownership.
47
48
49       -f, --filename=[]      Filename, directory, or URL  to  files  contains
50       the configuration to diff
51
52
53       --force-conflicts=false       If true, server-side apply will force the
54       changes against conflicts.
55
56
57       -k, --kustomize=""      Process the kustomization directory. This  flag
58       can't be used together with -f or -R.
59
60
61       --prune=false       Include resources that would be deleted by pruning.
62       Can be used with -l and default shows all resources would be pruned
63
64
65       --prune-allowlist=[]      Overwrite the  default  whitelist  with   for
66       --prune
67
68
69       -R, --recursive=false      Process the directory used in -f, --filename
70       recursively. Useful when you want to manage related manifests organized
71       within the same directory.
72
73
74       -l,  --selector=""       Selector  (label query) to filter on, supports
75       '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects
76       must satisfy all of the specified label constraints.
77
78
79       --server-side=false       If  true, apply runs in the server instead of
80       the client.
81
82
83

OPTIONS INHERITED FROM PARENT COMMANDS

85       --as=""      Username to impersonate for the operation. User could be a
86       regular user or a service account in a namespace.
87
88
89       --as-group=[]       Group  to  impersonate for the operation, this flag
90       can be repeated to specify multiple groups.
91
92
93       --as-uid=""      UID to impersonate for the operation.
94
95
96       --azure-container-registry-config=""      Path to the  file  containing
97       Azure container registry configuration information.
98
99
100       --cache-dir="/builddir/.kube/cache"      Default cache directory
101
102
103       --certificate-authority=""      Path to a cert file for the certificate
104       authority
105
106
107       --client-certificate=""      Path to a client certificate file for TLS
108
109
110       --client-key=""      Path to a client key file for TLS
111
112
113       --cluster=""      The name of the kubeconfig cluster to use
114
115
116       --context=""      The name of the kubeconfig context to use
117
118
119       --insecure-skip-tls-verify=false      If true, the server's certificate
120       will not be checked for validity. This will make your HTTPS connections
121       insecure
122
123
124       --kubeconfig=""      Path to the kubeconfig file to  use  for  CLI  re‐
125       quests.
126
127
128       --match-server-version=false        Require  server  version  to  match
129       client version
130
131
132       -n, --namespace=""      If present, the namespace scope  for  this  CLI
133       request
134
135
136       --password=""      Password for basic authentication to the API server
137
138
139       --profile="none"         Name   of   profile   to   capture.   One   of
140       (none|cpu|heap|goroutine|threadcreate|block|mutex)
141
142
143       --profile-output="profile.pprof"      Name of the  file  to  write  the
144       profile to
145
146
147       --request-timeout="0"       The length of time to wait before giving up
148       on a single server request. Non-zero values  should  contain  a  corre‐
149       sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
150       out requests.
151
152
153       -s, --server=""      The address and port of the Kubernetes API server
154
155
156       --tls-server-name=""      Server name to  use  for  server  certificate
157       validation.  If  it  is  not provided, the hostname used to contact the
158       server is used
159
160
161       --token=""      Bearer token for authentication to the API server
162
163
164       --user=""      The name of the kubeconfig user to use
165
166
167       --username=""      Username for basic authentication to the API server
168
169
170       --version=false      Print version information and quit
171
172
173       --warnings-as-errors=false      Treat warnings received from the server
174       as errors and exit with a non-zero exit code
175
176
177

EXAMPLE

179                # Diff resources included in pod.json
180                kubectl diff -f pod.json
181
182                # Diff file read from stdin
183                cat service.yaml | kubectl diff -f -
184
185
186
187

SEE ALSO

189       kubectl(1),
190
191
192

HISTORY

194       January  2015,  Originally compiled by Eric Paris (eparis at redhat dot
195       com) based on the kubernetes source material, but hopefully  they  have
196       been automatically generated since!
197
198
199
200Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum