-
Notifications
You must be signed in to change notification settings - Fork 0
/
running-kubernetes-locally-via-minikube.html
456 lines (395 loc) · 15.9 KB
/
running-kubernetes-locally-via-minikube.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns# fb: https://www.facebook.com/2008/fbml">
<head>
<title>Running Kubernetes locally via Minikube - Justin Naldzin</title>
<!-- Using the latest rendering mode for IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="./running-kubernetes-locally-via-minikube.html">
<meta name="author" content="Justin Naldzin" />
<meta name="keywords" content="kubernetes,minikube,kubectl" />
<meta name="description" content="Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day." />
<meta property="og:site_name" content="Justin Naldzin" />
<meta property="og:type" content="article"/>
<meta property="og:title" content="Running Kubernetes locally via Minikube"/>
<meta property="og:url" content="./running-kubernetes-locally-via-minikube.html"/>
<meta property="og:description" content="Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day."/>
<meta property="article:published_time" content="2018-03-01" />
<meta property="article:section" content="guides" />
<meta property="article:tag" content="kubernetes" />
<meta property="article:tag" content="minikube" />
<meta property="article:tag" content="kubectl" />
<meta property="article:author" content="Justin Naldzin" />
<!-- Bootstrap -->
<link rel="stylesheet" href="./theme/css/bootstrap.paper.min.css" type="text/css"/>
<link href="./theme/css/font-awesome.min.css" rel="stylesheet">
<link href="./theme/css/pygments/emacs.css" rel="stylesheet">
<link rel="stylesheet" href="./theme/css/style.css" type="text/css"/>
<link href="./feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
title="Justin Naldzin ATOM Feed"/>
<link href="./feeds/guides.atom.xml" type="application/atom+xml" rel="alternate"
title="Justin Naldzin guides ATOM Feed"/>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="./" class="navbar-brand">
Justin Naldzin </a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li >
<a href="./category/about.html">About</a>
</li>
<li >
<a href="./category/github-repos.html">Github repos</a>
</li>
<li class="active">
<a href="./category/guides.html">Guides</a>
</li>
<li >
<a href="./category/internet-of-things.html">Internet of things</a>
</li>
<li >
<a href="./category/notebooks.html">Notebooks</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div> <!-- /.navbar -->
<!-- Banner -->
<!-- End Banner -->
<!-- Content Container -->
<div class="container">
<div class="row">
<div class="col-sm-9">
<section id="content">
<article>
<header class="page-header">
<h1>
<a href="./running-kubernetes-locally-via-minikube.html"
rel="bookmark"
title="Permalink to Running Kubernetes locally via Minikube">
Running Kubernetes locally via Minikube
</a>
</h1>
</header>
<div class="entry-content">
<div class="panel">
<div class="panel-body">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2018-03-01T00:00:00-05:00"> Thu 01 March 2018</time>
</span>
<span class="label label-default">Tags</span>
<a href="./tag/kubernetes.html">kubernetes</a>
/
<a href="./tag/minikube.html">minikube</a>
/
<a href="./tag/kubectl.html">kubectl</a>
</footer><!-- /.post-info --> </div>
</div>
<h2>Overview</h2>
<p><a href="https://kubernetes.io">Kubernetes</a> is an open-source system for automating deployment, scaling, and management of containerized applications.</p>
<p><a href="https://github.com/kubernetes/minikube">Minikube</a> is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.</p>
<p align="center">
<img src="images/logos/kubernetes_logo.png" alt="Kubernetes" hspace="100" vspace="10">
<img src="images/logos/kubernetes_name.png" alt="Kubernetes" hspace="100" vspace="10">
</p>
<h2>Requirements</h2>
<h4>Install Java 8</h4>
<blockquote>
<p>NOTE: Java 9 fails as of this writing</p>
</blockquote>
<div class="highlight"><pre><span></span>brew tap caskroom/versions
brew update
brew cask install java8
</pre></div>
<h4>Install kubectl</h4>
<div class="highlight"><pre><span></span>brew install kubectl
</pre></div>
<h4>Install VirtualBox</h4>
<div class="highlight"><pre><span></span>brew cask install virtualbox
brew cask install virtualbox-extension-pack
</pre></div>
<h4>Install Minikube</h4>
<div class="highlight"><pre><span></span>brew cask install minikube
</pre></div>
<h3>kubectl Configuration</h3>
<p>The kubectl config file is located at:</p>
<p><strong>~/.kube/config</strong></p>
<div class="highlight"><pre><span></span>apiVersion: v1
clusters:
- cluster:
certificate-authority: /Users/user/.minikube/ca.crt
server: https://192.168.99.100:8443
name: minikube
contexts:
- context:
cluster: minikube
user: minikube
name: minikube
current-context: minikube
kind: Config
preferences: <span class="o">{}</span>
users:
- name: minikube
user:
as-user-extra: <span class="o">{}</span>
client-certificate: /Users/user/.minikube/client.crt
client-key: /Users/user/.minikube/client.key
</pre></div>
<h2>Hello World</h2>
<h4>Start minikube cluster</h4>
<div class="highlight"><pre><span></span>minikube start
</pre></div>
<p>Starting minikube automatically generates a kubeconfig entry and switches to that context.</p>
<h4>Show kubectl contexts</h4>
<div class="highlight"><pre><span></span>kubectl config get-contexts
kubectl config use-context minikube
</pre></div>
<h4>View cluster info</h4>
<div class="highlight"><pre><span></span>kubectl cluster-info
</pre></div>
<h4>Run an image creating a deployment</h4>
<div class="highlight"><pre><span></span>kubectl run hello-minikube --image<span class="o">=</span>k8s.gcr.io/echoserver:1.4 --port<span class="o">=</span><span class="m">8080</span>
kubectl expose deployment hello-minikube --type<span class="o">=</span>NodePort
kubectl get pod
curl <span class="k">$(</span>minikube service hello-minikube --url<span class="k">)</span>
</pre></div>
<h4>Kubernetes Dashboard</h4>
<div class="highlight"><pre><span></span>minikube dashboard
</pre></div>
<h4>Delete deployment</h4>
<div class="highlight"><pre><span></span>kubectl delete deployment hello-minikube
</pre></div>
<h4>Stopping a Cluster</h4>
<div class="highlight"><pre><span></span>minikube stop
</pre></div>
<h4>Deleting a Cluster</h4>
<div class="highlight"><pre><span></span>minikube delete
</pre></div>
</div>
<!-- /.entry-content -->
</article>
</section>
</div>
<div class="col-sm-3" id="sidebar">
<aside>
<!-- Sidebar -->
<section class="well well-sm">
<ul class="list-group list-group-flush">
<!-- Sidebar/Social -->
<li class="list-group-item">
<h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Social</span></h4>
<ul class="list-group" id="social">
<li class="list-group-item"><a href="https://www.linkedin.com/in/justinnaldzin"><i class="fa fa-linkedin-square fa-lg"></i> LinkedIn</a></li>
<li class="list-group-item"><a href="https://www.github.com/justinnaldzin"><i class="fa fa-github-square fa-lg"></i> GitHub</a></li>
<li class="list-group-item"><a href="https://www.youtube.com/justinnaldzin"><i class="fa fa-youtube-square fa-lg"></i> YouTube</a></li>
<li class="list-group-item"><a href="https://www.facebook.com/justinnaldzin"><i class="fa fa-facebook-square fa-lg"></i> Facebook</a></li>
<li class="list-group-item"><a href="https://www.twitter.com/justinnaldzin"><i class="fa fa-twitter-square fa-lg"></i> Twitter</a></li>
</ul>
</li>
<!-- End Sidebar/Social -->
<!-- Sidebar/Tag Cloud -->
<li class="list-group-item">
<a href="./"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a>
<ul class="list-group list-inline tagcloud" id="tags">
<li class="list-group-item tag-3">
<a href="./tag/about.html">about</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/apache.html">apache</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/apache-spark.html">apache spark</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/aws.html">aws</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/benchmarking.html">benchmarking</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/big-data.html">big data</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/bokeh.html">bokeh</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/change-data-capture.html">change data capture</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/cloud-sql.html">cloud sql</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/container-registry.html">container registry</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/datalab.html">datalab</a>
</li>
<li class="list-group-item tag-2">
<a href="./tag/dataproc.html">dataproc</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/debezium.html">debezium</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/docker.html">docker</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/gcloud.html">gcloud</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/github.html">github</a>
</li>
<li class="list-group-item tag-1">
<a href="./tag/google-cloud.html">google cloud</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/google-cloud-platform.html">google cloud platform</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/hadoop.html">hadoop</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/hana.html">hana</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/hdfs.html">hdfs</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/hive.html">hive</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/information-technology.html">information technology</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/iot.html">iot</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/java.html">java</a>
</li>
<li class="list-group-item tag-1">
<a href="./tag/jupyter.html">jupyter</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/kafka.html">kafka</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/kubectl.html">kubectl</a>
</li>
<li class="list-group-item tag-2">
<a href="./tag/kubernetes.html">kubernetes</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/magic-mirror.html">magic-mirror</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/matplotlib.html">matplotlib</a>
</li>
<li class="list-group-item tag-2">
<a href="./tag/minikube.html">minikube</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/mysql.html">mysql</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/oracle.html">oracle</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/pelican.html">pelican</a>
</li>
<li class="list-group-item tag-2">
<a href="./tag/pyspark.html">pyspark</a>
</li>
<li class="list-group-item tag-1">
<a href="./tag/python.html">python</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/rds.html">rds</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/scala.html">scala</a>
</li>
<li class="list-group-item tag-1">
<a href="./tag/spark.html">spark</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/sql-server.html">sql server</a>
</li>
<li class="list-group-item tag-3">
<a href="./tag/sqoop.html">sqoop</a>
</li>
<li class="list-group-item tag-4">
<a href="./tag/vagrant.html">vagrant</a>
</li>
</ul>
</li>
<!-- End Sidebar/Tag Cloud -->
<!-- Sidebar/Github -->
<li class="list-group-item">
<h4><i class="fa fa-github fa-lg"></i><span class="icon-label">GitHub Repos</span></h4>
<div id="gh_repos">
<p class="list-group-item">Status updating...</p>
</div>
</li>
<!-- End Sidebar/Github -->
</ul>
</section>
<!-- End Sidebar --> </aside>
</div>
</div>
</div>
<!-- End Content Container -->
<footer>
<div class="container">
<hr>
<div class="row">
<div class="col-xs-10">© 2018 Justin Naldzin
· Powered by <a href="https://github.com/getpelican/pelican-themes/tree/master/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>,
<a href="http://docs.getpelican.com/" target="_blank">Pelican</a>,
<a href="http://getbootstrap.com" target="_blank">Bootstrap</a> </div>
<div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div>
</div>
</div>
</footer>
<script src="./theme/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./theme/js/bootstrap.min.js"></script>
<!-- Enable responsive features in IE8 with Respond.js (https://github.com/scottjehl/Respond) -->
<script src="./theme/js/respond.min.js"></script>
<!-- GitHub JS Code -->
<script type="text/javascript">
$(document).ready(function () {
if (!window.jXHR) {
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = './theme/js/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: 'justinnaldzin',
count: 5,
skip_forks: false,
target: '#gh_repos'
});
});
</script>
<script src="./theme/js/github.js" type="text/javascript"></script>
<!-- End GitHub JS Code -->
</body>
</html>