Kubernetes Microservices with Docker [1st ed. 2016] 9781484219065, 9781484219072, 1484219066, 1484219074

Start using Kubernetes in complex big data and enterprise applications, including Docker containers. Starting with insta

715 189 14MB

English Pages 432 [440] Year 2016

Report DMCA / Copyright

DOWNLOAD FILE

Kubernetes Microservices with Docker [1st ed. 2016]
 9781484219065, 9781484219072, 1484219066, 1484219074

Table of contents :
Contents at a Glance......Page 4
Contents......Page 6
About the Author......Page 18
About the Technical Reviewer......Page 20
Foreword......Page 22
Part I: Getting Started......Page 23
Chapter 1: Installing Kubernetes Using Docker......Page 24
Setting the Environment......Page 25
Installing Docker......Page 26
Installing Kubernetes......Page 36
Starting etcd......Page 44
Starting Kubernetes Master......Page 46
Starting Service Proxy......Page 49
Listing the Kubernetes Docker Containers......Page 50
Installing kubectl......Page 53
Listing Services......Page 56
Testing the Kubernetes Installation......Page 57
Summary......Page 59
What Is a Node?......Page 60
What Is a Replication Controller?......Page 61
Why Kubernetes?......Page 62
Setting the Environment......Page 63
Creating an Application Imperatively......Page 64
Creating a Service......Page 65
Describing a Pod......Page 67
Invoking the Hello-World Application......Page 68
Scaling the Application......Page 69
Deleting a Replication Controller......Page 73
Creating an Application Declaratively......Page 74
Creating a Pod Definition......Page 75
Creating a Service Definition......Page 79
Creating a Replication Controller Definition......Page 82
Invoking the Hello-World Application......Page 85
Scaling the Application......Page 89
Using JSON for the Resource Definitions......Page 91
Summary......Page 97
Setting the Environment......Page 98
The ENTRYPOINT and CMD Instructions......Page 99
The Command and Args Fields in a Pod Definition......Page 100
Environment Variables......Page 101
Using the Default ENTRYPOINT and CMD from a Docker Image......Page 102
Overriding Both the ENTRYPOINT and CMD......Page 105
Specifying both the Executable and the Parameters in the Command Mapping......Page 108
Specifying Both the Executable and the Parameters in the Args Mapping......Page 111
Summary......Page 114
Part II: Relational Databases......Page 115
Setting the Environment......Page 116
Creating a Service......Page 118
Creating a Replication Controller......Page 119
Listing Logs......Page 123
Describing the Service......Page 125
Starting an Interactive Shell......Page 126
Starting the MySQL CLI......Page 128
Creating a Database Table......Page 129
Scaling the Replicas......Page 130
Deleting the Replication Controller......Page 132
Summary......Page 133
Setting the Environment......Page 134
Creating a Service......Page 136
Creating a Replication Controller......Page 138
Starting an Interactive Command Shell......Page 142
Starting the PostgreSQL SQL Terminal......Page 143
Creating a Database Table......Page 144
Exiting the Interactive Command Shell......Page 145
Scaling the PostgreSQL Cluster......Page 146
Listing the Logs......Page 147
Deleting the Replication Controller......Page 149
Creating a PostgreSQL Cluster Imperatively......Page 150
Getting the Pods......Page 151
Creating a Service......Page 152
Creating a Database Table......Page 153
Scaling the PostgreSQL Cluster......Page 156
Deleting the Replication Controller......Page 157
Summary......Page 158
Setting the Environment......Page 159
Creating an Oracle Database Instance Imperatively......Page 160
Listing Logs......Page 162
Creating a Service......Page 163
Scaling the Database......Page 164
Deleting the Replication Controller and Service......Page 165
Creating a Pod......Page 166
Creating a Service......Page 168
Creating a Replication Controller......Page 171
Keeping the Replication Level......Page 174
Scaling the Database......Page 176
Starting the Interactive Shell......Page 177
Connecting to Database......Page 178
Creating a User......Page 179
Creating a Database Table......Page 180
Summary......Page 181
Part III: NoSQL Database......Page 182
Setting the Environment......Page 183
Creating a Service......Page 185
Creating a Replication Controller......Page 189
Creating a Volume......Page 192
Listing the Logs......Page 194
Starting the Interactive Shell for Docker Container......Page 196
Creating a Database......Page 198
Creating a Collection......Page 199
Adding Documents......Page 200
Finding a Single Document......Page 202
Finding Specific Fields in a Single Document......Page 203
Scaling the Cluster......Page 204
Deleting the Replication Controller......Page 205
Using a Host Port......Page 206
Creating a Replication Controller......Page 210
Listing the Pods......Page 211
Listing the Logs......Page 212
Creating a Service......Page 213
Scaling the Cluster......Page 214
Summary......Page 216
Setting the Environment......Page 217
Creating a Service......Page 219
Creating a Replication Controller......Page 222
Scaling the Database......Page 227
Describing the Pod......Page 228
Starting an Interactive Shell......Page 229
Altering a Keyspace......Page 231
Creating a Table......Page 232
Deleting from a Table......Page 233
Dropping a Table and Keyspace......Page 234
Creating a Volume......Page 235
Creating a Replication Controller......Page 241
Creating a Service......Page 243
Scaling the Database......Page 244
Deleting the Replication Controller and Service......Page 245
Summary......Page 246
Setting the Environment......Page 247
Creating a Pod......Page 250
Creating a Service......Page 253
Creating a Replication Controller......Page 255
Listing the Logs......Page 259
Setting Port Forwarding......Page 260
Logging into Couchbase Web Console......Page 262
Configuring Couchbase Server......Page 263
Adding Documents......Page 271
Starting an Interactive Shell......Page 280
Using the cbtransfer Tool......Page 281
Listing the Pods......Page 282
Creating a Service......Page 284
Scaling the Cluster......Page 285
Keeping the Replication Level......Page 286
Logging in to Couchbase Admin Console......Page 288
Summary......Page 289
Part IV: Apache Hadoop Ecosystem......Page 290
Setting the Environment......Page 291
Creating an Apache Hadoop Cluster Declaratively......Page 292
Creating a Service......Page 293
Creating a Replication Controller......Page 295
Listing the Pods......Page 297
Listing Logs......Page 298
Scaling a Cluster......Page 299
Starting an Interactive Shell......Page 300
Running a MapReduce Application......Page 301
Running Hive......Page 310
Running HBase......Page 316
Creating a Replication Controller......Page 321
Listing the Pods......Page 322
Creating a Service......Page 323
Starting an Interactive Shell......Page 324
Summary......Page 325
Chapter 11: Using Apache Solr......Page 326
Setting the Environment......Page 327
Creating a Service......Page 328
Describing the Service......Page 330
Creating a Replication Controller......Page 331
Listing the Pods......Page 334
Describing a Replication Controller......Page 335
Listing the Logs......Page 336
Starting an Interactive Shell......Page 338
Creating a Solr Core......Page 341
Indexing Documents......Page 342
Accessing Solr on Command Line with a REST Client......Page 345
Setting Port Forwarding......Page 350
Accessing Solr in Admin Console......Page 351
Scaling the Cluster......Page 357
Summary......Page 358
Chapter 12: Using Apache Kafka......Page 359
Setting the Environment......Page 360
Modifying the Docker Image......Page 361
Creating a Service......Page 367
Creating a Replication Controller......Page 370
Listing the Pods......Page 373
Describing a Pod......Page 374
Starting an Interactive Shell......Page 375
Starting the Kafka Server......Page 376
Creating a Topic......Page 378
Producing and Consuming Messages......Page 379
Scaling the Cluster......Page 380
Deleting Replication Controller and Service......Page 382
Summary......Page 383
Part V: Multi Containers and Nodes......Page 384
Chapter 13: Creating a Multi-Container Pod......Page 385
Types of Applications Using a Multi-Container Pod......Page 386
Setting the Environment......Page 387
Creating a Service......Page 388
Describing a Service......Page 389
Creating a Replication Container......Page 390
Listing the Pods......Page 392
Listing the Docker Containers......Page 393
Describing the Service after Creating Replication Controller......Page 394
Invoking the Hello World Application on Command Line......Page 395
Starting the Interactive Shell......Page 396
Setting Port Forwarding......Page 397
Opening the Hello World Application in a Browser......Page 398
Scaling the Cluster......Page 399
Listing the Docker Containers......Page 401
Setting Port Forwarding......Page 402
Opening the Hello World Application in a Browser......Page 403
Invoking the Hello World Application from Command Line......Page 404
Deleting the Replication Controller......Page 406
Summary......Page 407
Chapter 14: Installing Kubernetes on a Multi-Node Cluster......Page 408
Setting the Environment......Page 409
Setting up Bootstrap Instance of Docker......Page 411
Setting Up etcd......Page 412
Setting Up Flannel......Page 413
Starting the Kubernetes Master......Page 418
Running the Service Proxy......Page 420
Exporting the Master IP......Page 421
Setting Up Flanneld......Page 422
Starting Up Kubernetes on Worker Node......Page 427
Running an Application on the Cluster......Page 428
Exposing the Application as a Service......Page 429
Testing the Application in a Browser......Page 431
Scaling the Application......Page 432
Summary......Page 436
Index......Page 437

Polecaj historie