Immediate download Kubernetes Cookbook Practical solutions to container orchestration 2nd Edition Hideto Saito ebooks 2024
Immediate download Kubernetes Cookbook Practical solutions to container orchestration 2nd Edition Hideto Saito ebooks 2024
https://ebookfinal.com/download/kubernetes-cookbook-1st-edition-saito/
https://ebookfinal.com/download/kubernetes-operators-automating-the-
container-orchestration-platform-1st-edition-jason-dobies/
https://ebookfinal.com/download/php-cookbook-solutions-and-examples-
for-php-programmers-2nd-edition-david-sklar/
https://ebookfinal.com/download/kali-linux-cookbook-effective-
penetration-testing-solutions-2nd-edition-corey-p-schultz/
MySQL Cookbook 2nd Edition Solutions Examples for Database
Developers and DBAs Paul Dubois
https://ebookfinal.com/download/mysql-cookbook-2nd-edition-solutions-
examples-for-database-developers-and-dbas-paul-dubois/
https://ebookfinal.com/download/keras-to-kubernetes-1st-edition-
dattaraj-rao/
https://ebookfinal.com/download/container-gardening-for-dummies-2nd-
edition-bill-marken/
https://ebookfinal.com/download/digital-dice-computational-solutions-
to-practical-probability-problems-paul-j-nahin/
https://ebookfinal.com/download/bash-cookbook-solutions-and-examples-
for-bash-users-1st-edition-albing/
Kubernetes Cookbook Practical solutions to container
orchestration 2nd Edition Hideto Saito Digital Instant
Download
Author(s): Hideto Saito; Hui-Chuan Chloe Lee; Ke-Jou Carol Hsu
ISBN(s): 9781788836876, 1788836871
Edition: 2
File Details: PDF, 23.59 MB
Year: 2018
Language: english
Kubernetes Cookbook
Second Edition
Hideto Saito
Hui-Chuan Chloe Lee
Ke-Jou Carol Hsu
BIRMINGHAM - MUMBAI
Kubernetes Cookbook
Second Edition
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form
or by any means, without the prior written permission of the publisher, except in the case of brief quotations
embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented.
However, the information contained in this book is sold without warranty, either express or implied. Neither the
authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to
have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy
of this information.
ISBN 978-1-78883-760-6
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as
well as industry leading tools to help you plan your personal development and advance
your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos
from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters, and receive exclusive discounts and offers on Packt books and
eBooks.
Contributors
Hui-Chuan Chloe Lee is a DevOps and software developer. She has worked in the
software industry on a wide range of projects for over five years. As a technology
enthusiast, she loves trying and learning about new technologies, which makes her life
happier and more fulfilling. In her free time, she enjoys reading, traveling, and spending
time with the people she loves.
Ke-Jou Carol Hsu has three years of experience working as a software engineer and is
currently a PhD student in the area of computer systems. Not only involved programming,
she also enjoys getting multiple applications and machines perfectly working together to
solve big problems. In her free time, she loves movies, music, cooking, and working out.
About the reviewer
Stefan Lapers started his career almost 20 years ago as a support engineer and quickly
grew into Linux/Unix system engineering, security, and network positions. Over the years,
he accumulated experience in developing, deploying, and maintaining hosted applications
while working for great customers, such as MTV and TMF. In his spare time, he enjoys
spending time with his family, tinkering with electronics, and flying model helicopters.
See also 42
Setting up the Kubernetes cluster on Linux via Ansible (kubespray) 43
Getting ready 43
Installing pip 44
Installing Ansible 45
Installing python-netaddr 46
Setting up ssh public key authentication 46
How to do it... 48
Maintaining the Ansible inventory 49
Running the Ansible ad hoc command to test your environment 50
Ansible troubleshooting 51
Need to specify a sudo password 52
Need to specify different ssh logon user 53
Need to change ssh port 53
Common ansible issue 53
How it works... 54
See also 58
Running your first container in Kubernetes 58
Getting ready 58
How to do it... 60
Running a HTTP server (nginx) 61
Exposing the port for external access 62
Stopping the application 63
How it works… 63
See also 66
Chapter 2: Walking through Kubernetes Concepts 67
Introduction 67
An overview of Kubernetes 68
Linking Pods and containers 71
Getting ready 71
How to do it... 72
How it works... 74
See also 77
Managing Pods with ReplicaSets 78
Getting ready 79
How to do it... 80
Creating a ReplicaSet 80
Getting the details of a ReplicaSet 82
Changing the configuration of a ReplicaSet 83
Deleting a ReplicaSet 84
How it works... 85
There's more... 88
See also 88
Deployment API 89
Getting ready 89
How to do it... 91
[ ii ]
Table of Contents
How it works... 94
Using kubectl set to update the container image 95
Updating the YAML and using kubectl apply 96
See also 98
Working with Services 99
Getting ready 100
How to do it... 101
Creating a Service for different resources 102
Creating a Service for a Pod 102
Creating a Service for a Deployment with an external IP 104
Creating a Service for an Endpoint without a selector 105
Creating a Service for another Service with session affinity 107
Deleting a Service 108
How it works... 109
There's more... 111
See also 114
Working with volumes 115
Getting ready 116
How to do it... 116
emptyDir 116
hostPath 119
NFS 120
glusterfs 122
downwardAPI 124
gitRepo 127
There's more... 128
PersistentVolumes 128
Using storage classes 132
gcePersistentDisk 133
awsElasticBlockStore 136
See also 140
Working with Secrets 140
Getting ready 141
How to do it... 141
Creating a Secret 141
Working with kubectl create command line 141
From a file 142
From a directory 143
From a literal value 143
Via configuration file 144
Using Secrets in Pods 144
By environment variables 144
By volumes 145
Deleting a Secret 147
How it works... 147
There's more... 147
Using ConfigMaps 147
Mounting Secrets and ConfigMap in the same volume 149
See also 150
[ iii ]
Table of Contents
[ iv ]
Table of Contents
[v]
Table of Contents
[ vi ]
Table of Contents
[ vii ]
Table of Contents
[ viii ]
Table of Contents
[ ix ]
Table of Contents
ResourceQuota 481
DenyEscalatingExec 481
AlwaysPullImages 481
There's more… 482
Initializers (alpha) 482
Webhook admission controllers (beta in v1.9) 482
See also 483
Chapter 9: Logging and Monitoring 484
Introduction 484
Working with EFK 484
Getting ready 485
How to do it... 485
Setting up EFK with minikube 486
Setting up EFK with kubespray 488
Setting up EFK with kops 491
How it works... 493
There's more... 496
See also 501
Working with Google Stackdriver 501
Getting ready 501
How to do it... 502
How it works... 506
See also 507
Monitoring master and node 508
Getting ready 508
How to do it... 509
How it works... 510
Introducing the Grafana dashboard 511
Creating a new metric to monitor Pod 513
There's more... 516
Monitoring your Kubernetes cluster on AWS 516
Monitoring your Kubernetes cluster on GCP 517
See also 518
Other Books You May Enjoy 520
Index 523
[x]
Preface
With the trend of microservices architecture in the recent years, a monolithic application is
refactored into multiple microservices. Container simplifies the deployment of the
application build from microservices. Container management, automation, and
orchestration have become crucial problems. Kubernetes is here to solve these.
This book is a practical guide that provides step-by-step tips and examples to help you
build and run your own Kubernetes cluster in both private and public clouds. Following
along with the book will lead you to understanding how to deploy and manage your
application and services in Kubernetes. You will also gain a deep understanding of how to
scale and update live containers, and how to do port forwarding and network routing in
Kubernetes. You will learn how to build a robust high-availability cluster with the book's
hands-on examples. Finally, you will build a Continuous Delivery pipeline by integrating
Jenkins, Docker registry, and Kubernetes.
Chapter 2, Walking through Kubernetes Concepts, covers both basic and advanced concepts
we need to know about Kubernetes. Then, you will learn how to combine them to create
Kubernetes objects by writing and applying configuration files.
Preface
Chapter 3, Playing with Containers, explains how to scale your containers up and down and
perform rolling updates without affecting application availability. Furthermore, you will
learn how deploy containers for dealing with different application workloads. It will also
walk you through best practices of configuration files.
Chapter 5, Building Continuous Delivery Pipelines, talks about how to integrate Kubernetes
into an existing Continuous Delivery pipeline with Jenkins and private Docker registry.
Chapter 6, Building Kubernetes on AWS, walks you through AWS fundamentals. You will
learn how to build a Kuberentes cluster on AWS in few minutes.
Chapter 7, Building Kubernetes on GCP, leads you to the Google Cloud Platform world. You
will learn the GCP essentials and how to launch a managed, production-ready Kubernetes
cluster with just a few clicks.
Chapter 9, Logging and Monitoring, explains how to collect both system and application logs
in Kubernetes by using Elasticsearch, Logstash, and Kibana (ELK). You will also learn how
to leverage Heapster, InfluxDB, and Grafana to monitor your Kubernetes cluster.
[2]
Preface
Once the file is downloaded, please make sure that you unzip or extract the folder using the
latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/
PacktPublishing/Kubernetes-Cookbook-Second-Edition. In case there's an update to the
code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available
at https://github.com/PacktPublishing/. Check them out!
Conventions used
There are a number of text conventions used throughout this book.
[3]
Preface
CodeInText: Indicates code words in text, database table names, folder names, filenames,
file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an
example: "Prepare the following YAML file, which is a simple Deployment that launches
two nginx containers."
When we wish to draw your attention to a particular part of a code block, the relevant lines
or items are set in bold:
Annotations: deployment.kubernetes.io/revision=1
Selector: env=test,project=My-Happy-Web,role=frontend
Replicas: 5 desired | 5 updated | 5 total | 5 available | 0
unavailable
StrategyType: RollingUpdate
Bold: Indicates a new term, an important word, or words that you see onscreen. For
example, words in menus or dialog boxes appear in the text like this. Here is an example:
"Installation is straightforward, so we can just choose the default options and click Next."
[4]
Preface
Sections
In this book, you will find several headings that appear frequently (Getting ready, How to do
it..., How it works..., There's more..., and See also).
To give clear instructions on how to complete a recipe, use these sections as follows:
Getting ready
This section tells you what to expect in the recipe and describes how to set up any software
or any preliminary settings required for the recipe.
How to do it...
This section contains the steps required to follow the recipe.
How it works...
This section usually consists of a detailed explanation of what happened in the previous
section.
There's more...
This section consists of additional information about the recipe in order to make you more
knowledgeable about the recipe.
See also
This section provides helpful links to other useful information for the recipe.
Get in touch
Feedback from our readers is always welcome.
General feedback: Email feedback@packtpub.com and mention the book title in the
subject of your message. If you have questions about any aspect of this book, please email
us at questions@packtpub.com.
[5]
Preface
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you have found a mistake in this book, we would be grateful if you would
report this to us. Please visit www.packtpub.com/submit-errata, selecting your book,
clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the internet, we
would be grateful if you would provide us with the location address or website name.
Please contact us at copyright@packtpub.com with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in
and you are interested in either writing or contributing to a book, please
visit authors.packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why not leave a review on
the site that you purchased it from? Potential readers can then see and use your unbiased
opinion to make purchase decisions, we at Packt can understand what you think about our
products, and our authors can see your feedback on their book. Thank you!
[6]
1
Building Your Own Kubernetes
Cluster
In this chapter, we will cover the following recipes:
Introduction
Welcome to your journey into Kubernetes! In this very first section, you will learn how to
build your own Kubernetes cluster. Along with understanding each component and
connecting them together, you will learn how to run your first container on Kubernetes.
Having a Kubernetes cluster will help you continue your studies in the chapters ahead.
Getting ready
Kubernetes is made up of the following components:
Kubernetes master
Kubernetes nodes
etcd
Kubernetes network
These components are connected via a network, as shown in the following diagram:
Kubernetes master: It connects to etcd via HTTP or HTTPS to store the data
Kubernetes nodes: It connect to the Kubernetes master via HTTP or HTTPS to
get a command and report the status
Kubernetes network: It L2, L3 or overlay make a connection of their container
applications
How to do it...
In this section, we are going to explain how to use the Kubernetes master and nodes to
realize the main functions of the Kubernetes system.
[8]
Building Your Own Kubernetes Cluster Chapter 1
Kubernetes master
The Kubernetes master is the main component of the Kubernetes cluster. It serves several
functionalities, such as the following:
The following diagram shows how master daemons work together to fulfill the
aforementioned functionalities:
There are several daemon processes that form the Kubernetes master's functionality, such
as kube-apiserver, kube-scheduler and kube-controller-manager. Hypercube, the
wrapper binary, can launch all these daemons.
In addition, the Kubernetes command-line interface, kubect can control the Kubernetes
master functionality.
[9]
Building Your Own Kubernetes Cluster Chapter 1
Scheduler (kube-scheduler)
The scheduler helps to choose which container runs on which nodes. It is a simple
algorithm that defines the priority for dispatching and binding containers to nodes. For
example:
CPU
Memory
How many containers are running?
[ 10 ]
Building Your Own Kubernetes Cluster Chapter 1
Kubernetes node
The Kubernetes node is a slave node in the Kubernetes cluster. It is controlled by the
Kubernetes master to run container applications using Docker (http://docker.com) or rkt
(http://coreos.com/rkt/docs/latest/). In this book, we will use the Docker container
runtime as the default engine.
Node or slave?
The term slave is used in the computer industry to represent the cluster
worker node; however, it is also associated with discrimination. The
Kubernetes project uses minion in the early version and node in the
current version.
The following diagram displays the role and tasks of daemon processes in the node:
The node also has two daemon processes, named kubelet and kube-proxy, to support its
functionalities.
[ 11 ]
Building Your Own Kubernetes Cluster Chapter 1
kubelet
kubelet is the main process on the Kubernetes node that communicates with the Kubernetes
master to handle the following operations:
Proxy (kube-proxy)
The proxy handles the network proxy and load balancer for each container. It
changes Linux iptables rules (nat table) to control TCP and UDP packets across the
containers.
After starting the kube-proxy daemon, it configures iptables rules; you can use iptables
-t nat -L or iptables -t nat -S to check the nat table rules, as follows:
[ 12 ]
Building Your Own Kubernetes Cluster Chapter 1
How it works...
There are two more components to complement Kubernetes node functionalities, the data
store etcd and the inter-container network. You can learn how they support the Kubernetes
system in the following subsections.
etcd
etcd (https://coreos.com/etcd/) is the distributed key-value data store. It can be accessed
via the RESTful API to perform CRUD operations over the network. Kubernetes uses etcd
as the main data store.
You can explore the Kubernetes configuration and status in etcd (/registry) using the
curl command, as follows:
[ 13 ]
Building Your Own Kubernetes Cluster Chapter 1
Kubernetes network
Network communication between containers is the most difficult part. Because Kubernetes
manages multiple nodes (hosts) running several containers, those containers on different
nodes may need to communicate with each other.
If the container's network communication is only within a single node, you can use Docker
network or Docker compose to discover the peer. However, along with multiple nodes,
Kubernetes uses an overlay network or container network interface (CNI) to achieve
multiple container communication.
See also
This recipe describes the basic architecture and methodology of Kubernetes and the related
components. Understanding Kubernetes is not easy, but a step-by-step learning process on
how to set up, configure, and manage Kubernetes is really fun.
Fortunately, there are some different solutions and tools that have been developed to set up
Kubernetes clusters effortlessly. Therefore, it is highly recommended you use such a tool to
set up Kubernetes on your environment.
The following tools are categorized by different types of solution to build your own
Kubernetes:
[ 14 ]
Building Your Own Kubernetes Cluster Chapter 1
Kubernetes can also run on different clouds and on-premise VMs by custom solutions. To
get started, we will build Kubernetes using minikube on macOS desktop machines in this
chapter.
[ 15 ]
Building Your Own Kubernetes Cluster Chapter 1
Getting ready
minikube runs Kubernetes on the Linux VM on macOS. It relies on a hypervisor
(virtualization technology), such as VirtualBox (https://www.virtualbox.org), VMWare
fusion (https://www.vmware.com/products/fusion.html), or hyperkit (https://github.
com/moby/hyperkit) In addition, we will need to have the Kubernetes command-line
interface (CLI) kubectl, which is used to connect through the hypervisor, to control
Kubernetes.
With minikube, you can run the entire suite of the Kubernetes stack on your macOS,
including the Kubernetes master, node, and CLI. It is recommended that macOS has
enough memory to run Kubernetes. By default, minikube uses VirtualBox as the
hypervisor.
In this chapter, however, we will demonstrate how to use hyperkit, which is the most
lightweight solution. As Linux VM consumes 2 GB of memory, at least 4 GB of memory is
recommended. Note that hyperkit is built on the top of the hypervisor framework (https:/
/developer.apple.com/documentation/hypervisor) on macOS; therefore, macOS 10.10
Yosemite or later is required.
The following diagram shows the relationship between kubectl, the hypervisor, minikube,
and macOS:
How to do it...
macOS doesn't have an official package management tool, such as yum and apt-get on
Linux. But there are some useful tools available for macOS. Homebrew (https://brew.sh) is
the most popular package management tool and manages many open source tools,
including minikube.
[ 16 ]
Building Your Own Kubernetes Cluster Chapter 1
3. Next, install the hyperkit driver for minikube. At the time of writing
(February 2018), HomeBrew does not support hyperkit; therefore type the
following command to install it:
$ curl -LO
https://storage.googleapis.com/minikube/releases/latest/docker-
machine-driver-hyperkit \
&& chmod +x docker-machine-driver-hyperkit \
&& sudo mv docker-machine-driver-hyperkit /usr/local/bin/ \
&& sudo chown root:wheel /usr/local/bin/docker-machine-driver-
hyperkit \
&& sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit
4. Next, let's install the Kubernetes CLI. Use Homebrew with the following
comment to install the kubectl command on your macOS:
//install kubectl command by "kubernetes-cli" package
$ brew install kubernetes-cli
[ 17 ]
Building Your Own Kubernetes Cluster Chapter 1
6. If you have never installed Docker for Mac on your machine, you need to install
it via homebrew-cask as well
//only if you don't have a Docker for Mac
$ brew cask install docker
//start Docker
$ open -a Docker.app
7. Now you are all set! The following command shows whether the required
packages have been installed on your macOS or not:
//check installed package by homebrew
$ brew list
kubernetes-cli
How it works...
minikube is suitable for setting up Kubernetes on your macOS with the following
command, which downloads and starts a Kubernetes VM stet, and then configures the
kubectl configuration (~/.kube/config):
//use --vm-driver=hyperkit to specify to use hyperkit
$ /usr/local/bin/minikube start --vm-driver=hyperkit
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
150.53 MB / 150.53 MB [============================================]
100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
[ 18 ]
Building Your Own Kubernetes Cluster Chapter 1
After getting all the necessary packages, perform the following steps:
1. Wait for a few minutes for the Kubernetes cluster setup to complete.
2. Use kubectl version to check the Kubernetes master version and kubectl
get cs to see the component status.
3. Also, use the kubectl get nodes command to check whether the Kubernetes
node is ready or not:
//it shows kubectl (Client) is 1.10.1, and Kubernetes master
(Server) is 1.10.0
$ /usr/local/bin/kubectl version --short
Client Version: v1.10.1
Server Version: v1.10.0
[ 19 ]
Building Your Own Kubernetes Cluster Chapter 1
4. Now you can start to use Kubernetes on your machine. The following sections
describe how to use the kubectl command to manipulate Docker containers.
5. Note that, in some cases, you may need to maintain the Kubernetes cluster, such
as starting/stopping the VM or completely deleting it. The following commands
maintain the minikube environment:
Command Purpose
minikube start --vm- Starts the Kubernetes VM using the hyperkit
driver=hyperkit driver
minikube stop Stops the Kubernetes VM
minikube delete Deletes a Kubernetes VM image
minikube ssh ssh to the Kubernetes VM guest
minikube ip Shows the Kubernetes VM (node) IP address
Checks and updates ~/.kube/config if the
minikube update-context
VM IP address is changed
Opens the web browser to connect the
minikube dashboard
Kubernetes UI
For example, minikube starts a dashboard (the Kubernetes UI) by the default. If you want
to access the dashboard, type minikube dashboard; it then opens your default browser
and connects the Kubernetes UI, as illustrated in the following screenshot:
[ 20 ]
Building Your Own Kubernetes Cluster Chapter 1
See also
This recipe describes how to set up a Kubernetes cluster on your macOS using minikube. It
is the easiest way to start using Kubernetes. We also learned how to use kubectl, the
Kubernetes command-line interface tool, which is the entry point to control our Kubernetes
cluster!
[ 21 ]
Building Your Own Kubernetes Cluster Chapter 1
You can run the Linux VM by using any hypervisor on Windows to set up Kubernetes from
scratch, but using minikube (https://github.com/kubernetes/minikube) is the fastest way
to build a Kubernetes cluster on Windows. Note that this recipe is not ideal for a
production environment because it will set up a Kubernetes on Linux VM on Windows.
Getting ready
To set up minikube on Windows requires a hypervisor, either VirtualBox (https://www.
virtualbox.org) or Hyper-V, because, again, minikube uses the Linux VM on Windows.
This means that you cannot use the Windows virtual machine (for example, running the
Windows VM on macOS by parallels).
However, kubectl , the Kubernetes CLI, supports a Windows native binary that can
connect to Kubernetes over a network. So, you can set up a portable suite of Kubernetes
stacks on your Windows machine.
The following diagram shows the relationship between kubectl, Hypervisor, minikube, and
Windows:
[ 22 ]
Building Your Own Kubernetes Cluster Chapter 1
Hyper-V is required for Windows 8 Pro or later. While many users still use Windows 7, we
will use VirtualBox as the minikube hypervisor in this recipe.
How to do it...
First of all, VirtualBox for Windows is required:
[ 23 ]
Building Your Own Kubernetes Cluster Chapter 1
3. Next, create the Kubernetes folder, which is used to store the minikube and
kubectl binaries. Let's create the k8s folder on top of the C: drive, as shown in
the following screenshot:
4. This folder must be in the command search path, so open System Properties,
then move to the Advanced tab.
5. Click the Environment Variables... button, then choose Path , and then click the
Edit... button, as shown in the following screenshot:
[ 24 ]
Exploring the Variety of Random
Documents with Different Content
would catch the ear of either side could do so only by fierce
denunciation of the other; he that would have it thought that he
loved us had only to show that he hated you. Men of moderation
found no hearers. The voices of the calm and clear-headed sank into
silence; and Wigfall and Toombs, and Sumner and Phillips walked up
and down in the land.
Yes, no doubt we had thousands of statesmen who knew better. But
who knew them? And so Seward kept piping of peace in ninety days,
and Yancey—Polyphemus of politicians—was willing to drink all the
blood that would be shed. A Yankee wouldn’t fight, said the one.
The slave-drivers, perhaps, would, said the other; but they were,
after all, a mere handful; and the poor white trash would be as
flocks of sheep.
A Yankee wouldn’t fight! And why not, pray? Two bulls will, meeting
in a path; two dogs, over a bone. The fishes of the sea fight; the
birds of the air; nay, do not even the little midgets, warmed by the
slanting rays of the summer’s sun, rend one another with
infinitesimal tooth and microscopic nail? All nature is but one vast
battle-field; and if the nations of men seem at times to be at peace,
what is that peace but taking breath for another grapple? And
congresses and kings are but bottle-holders, and time will be called
in due season. The Yankees wouldn’t fight! And suppose they
wouldn’t, why should they, pray, being sensible men?
Where was the Almighty Dollar?
Had any one of the Southern leaders read one page of history, not
to know that money means men? means cannon, rifles, sabres?
means ships, and commissariat, and clothing? means rallying from
reverses, and victory in the end? The Yankee would not fight, they
told us. His omnipotent ally they forgot to mention or to meet. Had
our Congress consisted of bankers, merchants, railway
superintendents, they would have seen to the gathering of the
sinews of war. We had only the statesmen of the period,—God save
the mark!
It was in finance that we blundered fatally. ’Twas not the eagle of
the orator that overcame us, but the effigy thereof, in silver and in
gold.
When we fired on Fort Sumter there was a burst of patriotism
throughout the North, and her young men flocked to her standards.
They fought, and fought well. The difference between them and us
was, that when they got tired of poor fare and hard knocks they
could find others to take their places. Being sensible, practical men,
they used their opportunities. When a man was drafted (as the war
went on) he or his friends found the means of hiring a substitute
(persons who have visited the North since the war tell me that you
rarely find a man of means who served in the army); and at last
cities and counties and States began to meet each successive call for
fresh troops by votes of money; their magnificent bounty system
grew up, and from that time the composition of the Northern armies
rapidly changed. Trained soldiers from every part of the world
flocked to the El Dorado of the West; and as the war went on each
successive battle brought less and less grief to the hearts and homes
of the North, while with us—with us!
From every corner of Europe they poured.
From Italy, from Sweden, from Russia, and from Spain.
From the Danube and the Loire; from the marshy borders of the
Elbe and the sunny slopes of the Guadalquivir.
From the Alps and the Balkan. From the home of the reindeer and
the land of the olive. From Majorca and Minorca, and from the Isles
of Greece.
From Berlin and Vienna; from Dublin and from Paris; from the vine-
clad hills of the Adriatic and the frozen shores of the Baltic Sea.
From Skager Rack and Skater Gat, and from Como and Killarney.
From sweet Auburn, loveliest village of the plain, from the banks and
braes o’ bonny Doon, and from Bingen-on-the-Rhine.
Catholic and Calvinist; Teuton, Slav, and Celt,—who was not there to
swell that host, and the babel of tongues around their camp-fires?
For to every hut in Europe, where the pinch of want was known, had
gone the rumor of fabulous bounty and high pay now, generous
pension hereafter.
At Bull Run the North met the South; at Appomattox Lee laid down
his sword in the presence of the world in arms.
CHAPTER LXXI.
MOVEMENT IV.
CHAPTER LXXIII.
During the night of this 18th of October, while we were making our
toilsome advance upon the enemy, a Virginia soldier, wounded in the
battle of Winchester, lay in a small room of a house in the edge of
Middletown; around which village the battle of Cedar Creek was
chiefly fought. Upon some bedding, spread upon the floor, lay a
young woman, his cousin; who, having heard that he had been hard
hit, had made her way to the enemy’s pickets, and, after some
parleying, gained permission to pass within their lines and nurse her
wounded relative. This young woman had, since the beginning of
the war, passed her life, as one might say, in our hospitals. But her
present position, within the enemy’s lines, was a trying one. It so
happened that between the Federal officer who occupied a room in
the same house and herself a strong antipathy soon grew up. The
little nurse was too busy attending to the wants of her wounded
cousin to leave his side often; but being under the same roof with
the Federal officer, they met, in a casual manner, not infrequently.
These meetings he contrived to make very disagreeable, by
continually attempting to force political discussions upon her. But
she, on her side, managed to render them far more exasperating to
him.
He that would get the better of a woman had best finish her with a
club at once and be done with it; he is sure to get the worst of it in
a tongue-battle. It may be a washerwoman opening on you with
Gatling-gun invective, and sweeping you from the face of the earth;
or a dainty society belle, with a dropping sharp-shooter fire of soft-
voiced sarcasm,—in either case you shall wish that you had held
your peace.
And so this big Federal colonel never had an encounter with the little
rebel nurse but he gnashed his teeth and raged for hours
afterwards. She always contrived, in the subtlest way, and without
saying so, to make him feel that she did not look upon him as a
gentleman. One day, for example, he had been carefully explaining
to her in how many ways the Northern people were superior to the
Southern.
“But I don’t believe,” added he, with evident acrimony, “that you F. F.
V.’s think there is one gentleman in the whole North. This arrogance
on your part is really one main cause of the war.”
“I can readily believe you,—for I understand the feeling. But really
you do us an injustice. I know, personally, a number of Northern
gentlemen. In New York, for instance” (the colonel was from that
city), “I am acquainted with the ——— family and the ———s and
the ———s, do you know them?”
The colonel hesitated.
“No?” said she, in soft surprise. “Ah, you should lose no time in
making their acquaintance on your return to the city. They are very
nice. But I hear my patient calling. Good-day!”
The colonel knew, and he saw plainly that she knew, that he could
no more enter one of those houses than he could fly. He could not
answer her. All that was left him was to hate her, and this he did
with his whole heart; and all aristocrats, living and dead.
When the crash of battle burst forth, on the morning of the
nineteenth, the colonel hurried forth to form his regiment. He met
his men rushing pell-mell to the rear, and he ran back to his
headquarters to gather a few things that lay scattered about his
room. Although the bullets were flying thick, frequently striking the
house itself, he found the little nurse standing on the porch,
exultation in every feature. The whizzing of the rifle-balls seemed
sweet to her ears. Confederate bullets would not hurt her.
“Get out of my way,” said he, in a gruff voice. “This is no place for
women.”
“Nor for men, either, you seem to think!”
He gave her a black look.
“Why this unseemly haste, colonel?” said she, following him into the
hall. “What! through the back door? The Confederates are there!”
And she stabbed the air in the direction of the coming bullets with a
gesture that would have made the fortune of a tragedy queen.
“Take that, d——n you!” And he brought his open hand down upon
her cheek with such force that, reeling through the open door of her
room, she fell headlong upon the floor.
“Coward!” roared a voice from the threshold of the hall.
Rising to her knees and turning, she saw the colonel spring forward
with a fierce glare in his eyes and a cocked pistol in his extended
hand. She shut her eyes and stopped her ears.
Had he killed the Confederate? No, for she heard no fall; but the
clear ring, instead, of a sabre drawn quickly from its scabbard. The
colonel stepped across the threshold of the room in which she was,
cocking his pistol for another shot. He raised the weapon,—but she
heard a spring in the hall, and saw a flash of steel; and the colonel
fell at full length upon the floor, with a sword-blade buried up to the
hilt in his breast. With such terrific force had the thrust been
delivered that he was knocked entirely off his feet, and the whole
house shook.
“Δούπησεν δὲ πεσών, ἀράβησε δὲ τεύχε᾽ ἐπ᾽αὐτῷ,”[1] muttered the
victor, as the young woman, springing to her feet, threw her arms
around his neck and kissed him.
“My brave defender!” cried she, in a fervor of patriotic exaltation,
lifting her eyes to his; and then she sprang back with a shiver, and
stood breathless before him, her head bowed upon her breast, her
face ashy pale.
A scene within a scene.
Without, the roar of cannon, the incessant rattle of musketry, the
bursting of shells, the panic-stricken rush of riderless horses, the
tramp of hurrying men, the Rebel Yell sweeping by like a tornado,
shouts of victory, moans of the dying.
Within, four people for a moment oblivious of all this mad hurly-burly
that billowed around them.
The convalescent soldier, rising upon his elbow, looked with silent
amazement upon the crouching figure of his fair cousin; while the
dying Union soldier forgot, for a moment, his gaping wound as he
gazed upon the man who had inflicted it. Tall, broad-shouldered,
gaunt of flank, supple, straight as an Indian, he held in his right
hand the gory sword, from which the prostrate officer saw his own
life-blood trickling, drop by drop, upon the floor. In his left he held
his cap uplifted.
Attila and Monsieur Deux-pas in one!
With cap uplifted; but head thrown back and eyes averted. His right
shoulder and breast were soaked with blood, which was streaming
down his brown beard upon his coat, from a bullet-hole in his
bronzed cheek. But it was his eyes which riveted the attention of his
fallen enemy. He had been appalled by their fierce glare, when,
angered by the pistol-shot, he had sprung upon him in the hall. But
that look had been soft compared with the cold, steady, pitiless
gleam they poured forth now. That man, thought he, would not give
a cup of water to a dying enemy.
Captain Smith made two steps towards the door, and turning,
bowed.
Feeling that he was going (for she had not dared to raise her eyes),
Mary Rolfe quivered for a moment from head to foot; then springing
forward, with passionate entreaty in every gesture and a cry of
anguish upon her lips:
“And you will leave me without a word? Listen! How frightfully the
battle is raging! And you are so cruel, cruel, as to go forth, and die,
perhaps, without ever— I know you will be killed, I know it, I know
it! And you won’t say you forgive me! Won’t you say just that one
little word? You loved me once,—and dearly, for you pressed me
against your heart and told me so; and can that heart, once so
tender, be so hard now? Oh, say you forgive me; for the sake of that
dear, dead love, say you forgive your little Mary!”
And round about them the battle roared and surged and thundered.
Her cousin has told me that such was the pathos and passion of her
tones, her looks, her gestures, as she uttered these words (which
hardly seemed unconventional in their fearful setting), that the eyes
of the dying soldier grew moist. But Captain Smith, standing like a
granite cliff:
“There is nothing to forgive. You did your duty as you saw it. So did
I when I ran that officer through.—Ah, pardon me: I had forgotten
you. Can I do anything for you?” added he in a tender voice, as he
kneeled beside him.
“Unbutton my coat, please; I am choking.”
The captain shuddered as he saw the broad gash in the breast of his
enemy. “I am sorry I hit you so hard.”
“It is all right,” replied he, wearily. “I tried to kill you, and you killed
me, that’s all. But thank you for your kind words.”
The captain’s eyes filled with tears. “I hope it is not as bad as you
think. I’ll send you a surgeon immediately. Meanwhile, keep up your
spirits.” And taking the wounded man’s hand in his, he pressed it
softly. Then, rising, “Good-by,” said he, with a cheering smile, and
moved towards the door.
It was then that Mary, catching, for the first time, a view of the right
side of his face, saw the blood trickling down his cheek.
“You are wounded already,” she cried in terror.
“Yes; wounded beyond healing,” said the captain of the Myrmidons;
and with a cold bow, he passed out of the door and into the tempest
of the battle.
“Oh—oh—oh!” gasped Mary, wringing her interlocked hands high
above her head; and she sank slowly down upon the floor.
The measures fashioned by the hands of men can hold but so much;
but anguish without limit may be pent up within a human heart that
is bursting, yet will not burst.
The officer turned his eyes, and, even in his own great extremity,
pitied her.
And, after all, which of the two was most to be pitied?
He was about to speak a few kind words, when he saw upon her
pallid cheek the dark bruises made by his own heavy hand; and he
held his peace. His lips were parched, his throat tortured with that
cruel thirst that loss of blood entails. His wounded neighbor could
not, she would not hand him a cup of water. At any rate, it were
worthier to die there, where he lay, rather than ask a favor of the
woman he had so insulted. Three times he tried to rise, and as often
fell heavily back. She raised her head and saw the longing, wistful
look in his eyes, fixed upon a bucket which stood in a corner of the
room.
It is wonderful how sorrow softens the heart!
She rose in an instant and brought him the cup. He could not lift his
head. Bending over him, she placed her arm beneath his neck and
raised him. As he drank, the tears poured down his cheeks. Gently
withdrawing her arm, she tripped softly across the room and brought
her own pillow and placed it beneath his head; and sitting down
upon the floor, by his side, stroked his brown forehead with her soft
white hand. He raised his streaming eyes to hers, and again and
again essayed to speak; but his quivering lips refused to obey.
“I know what you would say; so never mind. Don’t worry now. You
may beg my pardon when you get well.”
He shook his head sadly. “I am dying now,—I feel it.”
His voice sank into a whisper. She bent over him to catch his words.
“Promise me to write to my mother and tell her how I died, and that
you sat beside me. Leave out one thing. It would break her heart to
hear that of me. You will? God bless you. Her address is in my
pocket. Write to her. You promise? Oh, how good of you to hold the
very hand that—”
“Hush! Don’t talk of that now.”
“You won’t have to hold it long. I feel it coming, coming. Press my
hand hard, harder! You have forgiven me! Tell her, that as I lay—
dying—far away from home—an angel—of light—”
[1] He fell with a crash, and his arms rattled upon him.
(The Homeric formula when a warrior falls.)
CHAPTER LXXIV.
Let us return to that little parlor on Leigh Street, from the windows
of which, four years ago, we caught our first glimpse of the man
who has played so large a part in our story. It is full of people, now,
—half a dozen elderly men, all the rest women. Of the men, one is a
minister, with a face so singularly gentle that his smile is a sort of
subdued sunbeam.
The countenances of the women all wear looks of happy expectancy.
Mr. and Mrs. Poythress are there, and Lucy. Mr. and Mrs. Rolfe, but
not Mary. And others whom the reader, to her cost, does not know.
Our plump friend, Mrs. Carter, is bustling about, who but she, her
jolly face wreathed in smiles.
At every sound in the hall, every female neck is craned towards the
door. Somebody or something is expected.
“Mrs. Carter,” said Mrs. Poythress, “what name has Alice selected for
the little man?”
“Oh, yes! what is to be his name?” echoed every lady in the room.
Thereupon, Mrs. Carter, being constitutionally incapable of laughing,
began to shake.
At this eccentric behavior on the part of the young grandmother,
curiosity rose to fever heat; but the more they plied her with
questions, the more she could not answer. Seeing her incapable of
speech, her grave and silent husband came to the rescue, and
explained that what amused Mrs. Carter was that she did not know
what their grandchild was to be called. It appeared that Alice, as a
reward for his getting well of his wound, had allowed Charley the
privilege of naming their son. He had accepted the responsibility,—
but no mortal, not even his wife, had been able to make him say
what the name was to be.
This statement sent the curiosity of the audience up to the boiling
point. Did you ever!
Mrs. Rolfe interrogated Mr. Rolfe with her impressive eyes.
“Such a fancy would never have occurred to me, I’m sure,” said that
man of peace.
“Al-i-ce!” called Mrs. Carter, from the foot of the stairs.
“We are coming, mother,” answered a cheery voice from the ball
above; and Alice, giving two or three final little jerks at the ends of
certain ribbons and bits of lace that adorned her boy (he was asleep
on his nurse’s shoulder), stood aside to let that dignitary pass down-
stairs, at the head of the procession.
“And now,” said Alice, going up to her husband, “what is his name to
be?”
“One that he will never have cause to be ashamed of,” replied
Charley.
Alice drew back in surprise. Up to this point she had looked upon the
thing as a joke, and enjoyed it, too, as so characteristic of her
husband. This time, however, he had not smiled, as usual. On the
contrary, he betrayed, both in voice and look, a certain suppressed
excitement. She imagined, even, that he was a trifle pale; and her
heart began to flutter a little, she knew not why.
The column halted when it reached the closed parlor door. Here
Charley took the sleeping boy in his arms.
When the audience within heard the knob rattle, the excitement was
intense. It was dissipated, in an instant, by the sight of Charley
bearing the child.
In this wide world there lives not a woman who can look upon a
bearded man, with his first infant in his arms, without smiling.
The admiring ohs and ahs made the young mother’s heart beat high
with joy. And who shall call her weak, because she forgot that they
are to be heard at every christening? In the name of pity, let us sip
whatever illusive nectar chance flowers along our stony path may
afford!
Every one noticed how awkward Charley was in handing the baby to
the minister; while the good man, on the contrary, received an
ovation of approving smiles for his skill in holding him.
The little fellow, himself, appeared to feel the difference. He nestled,
at any rate, against the comfortable shoulder, and threw his head
back; and his little twinkling nose, pointing heavenward, seemed to
say that he knew what it all meant.
“Name this child!”
“Ah-ah-ah-ah!”
Every neck was craned, every ear eager to catch the first mysterious
syllable!
Alice glanced anxiously at her husband.
Why that determined look? What was he going to do?
A lightning-flash darted through her brain! Charley’s mother’s father
was named Peter! He had been a man of mark in his day; and,
besides, Charley worshipped his mother’s memory. Peter! Horrors!
And then he stammers so over his P’s! That half-defiant look, too!
Charley leaned forward.
She could not hear what he said; but she saw, from the obstinate
recusancy of his lips, that there was a P in the name. She felt a
choking in her throat.
’Twas her first,—and Peter! And he knew how painfully absurd she
thought the name! Poor little innocent babe! Peter! Her eyes filled
with tears.
No one had heard the name; not even the minister. He bent an
inquiring look upon Charley.
Charley repeated the words.
This time the good man heard, though no one else did. Bringing his
left arm around in front of his breast, he dipped his right hand into
the water, and raised it above the head of the sleeping boy.
Alice’s heart stood still!
“Theodoric Poythress, I baptize thee—”
A gasp of surprise, followed by a stifled moan, startled minister and
people; and all eyes were turned towards the Poythress group.
Mrs. Poythress lay with her head upon her husband’s breast, silent
tears streaming from her closed eyes. Lucy, half-risen from her seat,
leaned over her mother, holding her hand, deep compassion in her
gentle eyes! Her father sat bolt upright, looking stern, in his effort to
appear calm. Her mother pressed Lucy gently back into her chair,
and the minister went on.
Hurried leave-takings followed the ceremony. The baby was awake
and gurgling, but nobody noticed him; not even his mother. Mrs.
Poythress did not stir.
The front door was heard to close.
“Lucy, are they all gone?”
“Yes, mother.”
She opened her eyes, and seeing Charley standing, silent, by the
side of his wife, rose and staggered towards him, with outstretched
arms. He ran to meet her; and she folded him to her breast with a
long, convulsive embrace; then dropped into a chair, without a word,
and covered her face with one hand, while she held one of his with
the other.
First, Lucy thanked Charley, and then Mr. Poythress, coming up, and
taking Charley’s hand in both his: “My boy, you are as true as steel,
—I thank you.” And he strode stiffly out into the hall.
And instantly, as Alice’s quick eye noticed, the cloud which had
lingered on her husband’s brow vanished. He drew a long, deep
breath, and turning with a bright smile, chucked young Theodoric
under the chin. “How do you like your name, young fellow?”
The corners of the young fellow’s mouth made for his ears, then
snapped together beneath his nose.
“Your views vary with kaleidoscopic rap-p-p-pidity,” remarked the
philosopher.
The son of the philosopher crowed.
“He says he rather likes his name,” said Charley; “but,” added he,
drawing his handkerchief from his pocket, “those drops of water, at
the corners of his eyes, look too much like—”
“Hush!” cried Alice, quickly; and she laid her hand on her husband’s
mouth.
“Absit omen!” said he.
CHAPTER LXXVI.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com