The Book of Kubernetes Alan Hohn 2024 scribd download
The Book of Kubernetes Alan Hohn 2024 scribd download
com
https://ebookname.com/product/the-book-of-kubernetes-alan-
hohn/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/son-of-spellsinger-spellsinger-
book-7-first-edition-alan-dean-foster/
ebookname.com
https://ebookname.com/product/kubernetes-for-developers-1st-edition-
william-denniss/
ebookname.com
https://ebookname.com/product/kubernetes-best-practices-1st-edition-
brendan-burns/
ebookname.com
https://ebookname.com/product/quantum-mechanics-second-edition-amit-
goswami/
ebookname.com
Photonic Electronic and Atomic Collisions Proceedings of
the XXIV International Conference 1st Edition Pablo D.
Fainstein
https://ebookname.com/product/photonic-electronic-and-atomic-
collisions-proceedings-of-the-xxiv-international-conference-1st-
edition-pablo-d-fainstein/
ebookname.com
https://ebookname.com/product/performance-and-phenomenology-
traditions-and-transformations-1st-edition-maaike-bleeker/
ebookname.com
https://ebookname.com/product/what-have-i-done-a-victim-empathy-
programme-for-young-people-1st-edition-clair-aldington/
ebookname.com
https://ebookname.com/product/data-mining-in-public-and-private-
sectors-organizational-and-government-applications-first-edition-
antti-syvajarvi/
ebookname.com
Polymers phosphors and voltaics for radioisotope
microbatteries 1st Edition Kenneth E. Bower
https://ebookname.com/product/polymers-phosphors-and-voltaics-for-
radioisotope-microbatteries-1st-edition-kenneth-e-bower/
ebookname.com
THE BOOK OF KUBERNETES
A Complete Guide to Container Orchestration
by Alan Hohn
San Francisco
THE BOOK OF KUBERNETES. Copyright © 2022 by Alan Hohn.
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying, recording, or by any information storage or
retrieval system, without the prior written permission of the copyright owner and the publisher.
First printing
26 25 24 23 22 12345
ISBN-13: 978-1-7185-0264-2 (print)
ISBN-13: 978-1-7185-0265-9 (ebook)
Publisher: William Pollock
Managing Editor: Jill Franklin
Production Manager: Rachel Monaghan
Production Editors: Paula Williamson and Jennifer Kepler
Developmental Editor: Jill Franklin
Cover Illustrator: Gina Redman
Interior Design: Octopod Studios
Technical Reviewer: Xander Soldaat
Production Services: Octal Publishing, Inc.
For information on distribution, bulk sales, corporate sales, or translations, please contact No Starch
Press, Inc. directly at [email protected] or:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1.415.863.9900
www.nostarch.com
Library of Congress Control Number: 2022020536
No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other
product and company names mentioned herein may be the trademarks of their respective owners.
Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the
names only in an editorial fashion and to the benefit of the trademark owner, with no intention of
infringement of the trademark.
The information in this book is distributed on an “As Is” basis, without warranty. While every
precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc.
shall have any liability to any person or entity with respect to any loss or damage caused or alleged to
be caused directly or indirectly by the information contained in it.
For my wife, Sheryl
About the Author
Alan Hohn is the director for software strategy for Lockheed Martin. He has
25 years of experience as a Lockheed Martin Fellow, software developer,
architect, lead, and manager. He has delivered real applications to production
in Ada, Java, Python, and Go, among others, and has worked with Linux
since the early 1990s. He is an Agile and DevSecOps coach and is an
experienced trainer for Java, Ansible, containers, software architecture, and
Kubernetes. Alan has a degree in computer science from Embry-Riddle
Aeronautical University, a master’s in business administration from the
University of Minnesota, and a master’s in industrial engineering from the
Georgia Institute of Technology.
About the Technical Reviewer
Xander Soldaat started his Linux journey back in 1994 with a sports bag full
of floppy disks, a 486DX2/66, and a spare weekend. He has a deep
background in IT infrastructure architecture, as well as embedded systems,
compiler, and STEM curriculum development. He is currently an OpenShift
Cloud Success Architect at Red Hat. In his spare time, he likes to tinker with
robots, electronics, retro computers, and tabletop games.
BRIEF CONTENTS
Acknowledgments
Introduction
INTRODUCTION
The Approach
Running Examples
What You Will Need
Run in the Cloud or Local
Terminal Windows
PART I
MAKING AND USING CONTAINERS
1
WHY CONTAINERS MATTER
Modern Application Architecture
Attribute: Cloud Native
Attribute: Modular
Attribute: Microservice-Based
Benefit: Scalability
Benefit: Reliability
Benefit: Resilience
Why Containers
Requirements for Containers
Requirements for Orchestration
Running Containers
What Containers Look Like
What Containers Really Are
Deploying Containers to Kubernetes
Talking to the Kubernetes Cluster
Application Overview
Kubernetes Features
Final Thoughts
2
PROCESS ISOLATION
Understanding Isolation
Why Processes Need Isolation
File Permissions and Change Root
Container Isolation
Container Platforms and Container Runtimes
Installing containerd
Using containerd
Introducing Linux Namespaces
Containers and Namespaces in CRI-O
Running Processes in Namespaces Directly
Final Thoughts
3
RESOURCE LIMITING
CPU Priorities
Real-Time and Non-Real-Time Policies
Setting Process Priorities
Linux Control Groups
CPU Quotas with cgroups
CPU Quota with CRI-O and crictl
Memory Limits
Network Bandwidth Limits
Final Thoughts
4
NETWORK NAMESPACES
Network Isolation
Network Namespaces
Inspecting Network Namespaces
Creating Network Namespaces
Bridge Interfaces
Adding Interfaces to a Bridge
Tracing Traffic
Masquerade
Final Thoughts
5
CONTAINER IMAGES AND RUNTIME LAYERS
Filesystem Isolation
Container Image Contents
Image Versions and Layers
Building Container Images
Using a Dockerfile
Tagging and Publishing Images
Image and Container Storage
Overlay Filesystems
Understanding Container Layers
Practical Image Building Advice
Open Container Initiative
Final Thoughts
PART II
CONTAINERS IN KUBERNETES
6
WHY KUBERNETES MATTERS
Running Containers in a Cluster
Cross-Cutting Concerns
Kubernetes Concepts
Cluster Deployment
Prerequisite Packages
Kubernetes Packages
Cluster Initialization
Joining Nodes to the Cluster
Installing Cluster Add-ons
Network Driver
Installing Storage
Ingress Controller
Metrics Server
Exploring a Cluster
Final Thoughts
7
DEPLOYING CONTAINERS TO KUBERNETES
Pods
Deploying a Pod
Pod Details and Logging
Deployments
Creating a Deployment
Monitoring and Scaling
Autoscaling
Other Controllers
Jobs and CronJobs
StatefulSets
Daemon Sets
Final Thoughts
8
OVERLAY NETWORKS
Cluster Networking
CNI Plug-ins
Pod Networking
Cross-Node Networking
Calico Networking
WeaveNet
Choosing a Network Plug-in
Network Customization
Final Thoughts
9
SERVICE AND INGRESS NETWORKS
Services
Creating a Service
Service DNS
Name Resolution and Namespaces
Traffic Routing
External Networking
External Services
Ingress Services
Ingress in Production
Final Thoughts
10
WHEN THINGS GO WRONG
Scheduling
No Available Nodes
Insufficient Resources
Pulling Images
Running Containers
Debugging Using Logs
Debugging Using Exec
Debugging Using Port Forwarding
Final Thoughts
11
CONTROL PLANE AND ACCESS CONTROL
API Server
API Server Authentication
Client Certificates
Bootstrap Tokens
Service Accounts
Role-Based Access Controls
Roles and Cluster Roles
Role Bindings and Cluster Role Bindings
Assigning a Service Account to Pods
Binding Roles to Users
Final Thoughts
12
CONTAINER RUNTIME
Node Service
Kubelet Cluster Configuration
Kubelet Container Runtime Configuration
Kubelet Network Configuration
Static Pods
Node Maintenance
Node Draining and Cordoning
Unhealthy Nodes
Node Unreachable
Final Thoughts
13
HEALTH PROBES
About Probes
Liveness Probes
Exec Probes
HTTP Probes
TCP Probes
Startup Probes
Readiness Probes
Final Thoughts
14
LIMITS AND QUOTAS
Requests and Limits
Processing and Memory Limits
Cgroup Enforcement
Network Limits
Quotas
Final Thoughts
15
PERSISTENT STORAGE
Storage Classes
Storage Class Definition
CSI Plug-in Internals
Persistent Volumes
Stateful Sets
Volumes and Claims
Deployments
Access Modes
Final Thoughts
16
CONFIGURATION AND SECRETS
Injecting Configuration
Externalizing Configuration
Protecting Secrets
Injecting Files
Cluster Configuration Repository
Using etcdctl
Deciphering Data in etcd
Final Thoughts
17
CUSTOM RESOURCES AND OPERATORS
Custom Resources
Creating CRDs
Watching CRDs
Operators
Final Thoughts
PART III
PERFORMANT KUBERNETES
18
AFFINITY AND DEVICES
Affinity and Anti-affinity
Anti-affinity
Affinity
Service Traffic Routing
Hardware Resources
Final Thoughts
19
TUNING QUALITY OF SERVICE
Achieving Predictability
Quality of Service Classes
BestEffort
Burstable
Guaranteed
QoS Class Eviction
Choosing a QoS Class
Pod Priority
Final Thoughts
20
APPLICATION RESILIENCY
Example Application Stack
Database
Application Deployment
Pod Autoscaling
Application Service
Application and Cluster Monitoring
Prometheus Monitoring
Deploying kube-prometheus
Cluster Metrics
Adding Monitoring for Services
Final Thoughts
INDEX
ACKNOWLEDGMENTS
Thanks to the many people who have been generous with knowledge and
help in creating this book. First, thanks to my editor, Jill Franklin, my
technical reviewer, Xander Soldaat, and my copyeditor, Bob Russell, for
spotting errors I didn’t see and filling gaps in my knowledge. The remaining
mistakes are mine. They would have been much more numerous without your
help.
Thanks to my colleagues at Lockheed Martin, especially our Software
Factory team. I have learned a great deal from you, and we have built many
cool things together. Thanks to my Application Based Architecture
colleagues who explored Kubernetes with me in the early days. Thanks also
to the many people who build the open source products and the community
around containers and Kubernetes; I am humbled by the chance to contribute.
I am most grateful to my family for helping to make this book possible
and for listening patiently as I described each current challenge in writing it.
My thanks goes to all these, but Soli Deo Gloria.
INTRODUCTION
Containers and Kubernetes together are changing the way that applications
are architected, developed, and deployed. Containers ensure that software
runs reliably no matter where it’s deployed, and Kubernetes lets you manage
all of your containers from a single control plane.
This book is designed to help you take full advantage of these essential
new technologies, using hands-on examples not only to try out the major
features but also to explore how each feature works. In this way, beyond
simply being ready to deploy an application to Kubernetes, you’ll gain the
skills to architect applications to be performant and reliable in a Kubernetes
cluster, and to quickly diagnose problems when they arise.
The Approach
The biggest advantage of a Kubernetes cluster is that it hides the work of
running containers across multiple hosts behind an abstraction layer. A
Kubernetes cluster is a “black box” that runs what we tell it to run, with
automatic scaling, failover, and upgrades to new versions of our application.
Even though this abstraction makes it easier to deploy and manage
applications, it also makes it difficult to understand what a cluster is doing.
For this reason, this book presents each feature of container runtimes and
Kubernetes clusters from a “debugging” perspective. Every good debugging
session starts by treating the application as a black box and observing its
behavior, but it doesn’t end there. Skilled problem solvers know how to open
the black box, diving below the current abstraction layer to see how the
program runs, how data is stored, and how traffic flows across the network.
Skilled architects use this deep knowledge of a system to avoid performance
and reliability issues. This book provides the detailed understanding of
containers and Kubernetes that only comes from exploring not only what
these technologies do but also how they work.
In Part I, we’ll begin by running a container, but then we’ll dive into the
container runtime to understand what a container is and how we can simulate
a container using normal operating system commands. In Part II, we’ll install
a Kubernetes cluster and deploy containers to it. We’ll also see how the
cluster works, including how it interacts with the container runtime and how
packets flow from container to container across the host network. The
purpose is not to duplicate the reference documentation to show every option
offered by every feature but to demonstrate how each feature is implemented
so that all that documentation will make sense and be useful.
A Kubernetes cluster is complicated, so this book includes extensive
hands-on examples, with enough automation to allow you to explore each
chapter independently. This automation, which is available at
https://github.com/book-of-kubernetes/examples, is published under a
permissive open source license, so you can explore, experiment, and use it in
your own projects.
Running Examples
In many of this book’s example exercises, you’ll be combining multiple hosts
together to make a cluster, or working with low-level features of the Linux
kernel. For this reason, and to help you feel more comfortable with
experimentation, you’ll be running examples entirely on temporary virtual
machines. That way, if you make a mistake, you can quickly delete the
virtual machine and start over.
The example repository for this book is available at
https://github.com/book-of-kubernetes/examples. All of the instructions for
setting up to run examples are provided in a README.md file within the
setup folder of the example repository.
Terminal Windows
After you’ve used Ansible to provision your virtual machines, you’ll need to
get at least one terminal window connected to run commands. The
README.md file in each chapter will tell you how to do that. Before running
any examples, you’ll first need to become the root user, as follows:
sudo su -
This will give you a root shell and set up your environment and home
directory to match.
RUNNING AS ROOT
If you’ve worked with Linux before, you probably have a healthy
aversion to working as root on a regular basis, so it might surprise you
that all of the examples in this book are run as the root user. This is a
big advantage of using temporary virtual machines and containers;
when we act as the root user, we are doing so in a temporary, confined
space that can’t reach out and affect anything else.
As you move from learning about containers and Kubernetes to running
applications in production, you’ll be applying security controls to your
cluster that will limit administrative access and will ensure that
containers cannot break out of their isolated environment. This often
includes configuring your containers so that they run as a non-root user.
Attribute: Modular
Modularity is nothing new to application architecture. The goal has always
been high cohesion, where everything within a module relates to a single
purpose, and low coupling, where modules are organized to minimize
intermodule communication. However, even though modularity remains a
key design goal, the definition of what makes a module is different. Rather
Random documents with unrelated
content Scribd suggests to you:
“One thing I wanted to tell you, ranger man, is that Peterson and
his bunch are going to ‘get’ you, on account of that fight. I heard
Little Bill telling the boys so. He wanted them to go in on the
scheme, but they wouldn’t do it: or, at least, that’s what I
understood from what I overheard.”
“I take it your father would not object to the plan, at any rate.”
Patrick O’Neill was not smiling now.
“Father? He never would have anything to do with it! I—I happen
to know, ranger, that he has a scheme of his own for getting rid of
you.”
“Yes? And if I might ask——”
“I shouldn’t tell you, because it isn’t going to work, anyway. He
merely wrote to his brother-in-law—who is my uncle, of course—in
Washington, asking him to see that you are removed from this
district as your conduct is most obnoxious. But that doesn’t mean
anything at all, for I wrote in the very next mail to my uncle, and
told him that father is merely prejudiced against the forest service in
general, and that—that you are the most competent ranger we have
ever had here. I said he must not pay any attention to father. He
won’t, either. I lived with Uncle John and Aunt Martha while I was in
school, and they know just how cranky and unreasonable father can
be. So that’s all right. But Peterson is a different proposition. From
what Little Bill said——”
“I think,” said Ranger O’Neill, turning to his horse, “I had better
go and have a little talk with our friend Peterson.”
“You will not!” Isabelle caught him by the arm. “That’s exactly
what you must not do! I only told you so that you would be on your
guard and refuse to be drawn into any argument, as you were at
Bad Cañon the other day. Can’t you see? If you know how they feel,
you can avoid coming into contact with them until they forget about
it. It’s only because they were licked, and Peterson hates that worse
than anything else.”
“And would you have me stick close to my station, then?” O’Neill’s
eyes held a sparkle it was as well Isabelle did not see. “And what
then, if they come after me there?”
“That,” cried Isabelle, “is beside the point! They would never dare
attack you at the station. What I think they will do is probably start
another quarrel with you, and when you are silly enough to fight,
they mean to—to shoot you, for all I know! Little Bill said: ‘We’re
goin’ to get him, next time, and get him good! And you’ve got to
keep out, I tell you. All this fighting is exactly what they want.’
“And they’ll get what they’re wantin’ or my name is not Patrick
O’Neill! Leave go my arm, Queen Isabelle, and let me carry the war
to the enemy’s camp—for that’s what they taught me at West Point,
and it’s one thing they taught that I thoroughly approve!”
“Oh,” wailed Isabelle, while tears of anger stood in her eyes,
“you’re such a blithering fool! All you Irish can think of is fighting!
You’re worse than Cushman or Waller or any of the other shoot-’em-
up rangers that had to leave or get killed. You promised me you’d
win them to you with kindness and courtesy, and if you break that
promise, I hope they break your head!”
“And thank you for that same, Miss Boyce,” said Patrick O’Neill,
with icy politeness, as he sprang to the saddle. “It’s a fine example
of kindness and courtesy you’re setting me now—as like your father
as one white bean is like another! So I’ll pass it along to Peterson
and Little Bill, and crack their heads as you so sweetly wish them to
do by me!”
He lifted his hat from his thick brown hair and gave her a courtly
bow that left her furiously stamping her foot and gritting her teeth at
him as he galloped away, headed north to the Box S Range that lay
along Bad Cañon Creek, between Lodgepole Basin and Trout Creek
where the sheep had entered. That the trail led homeward as well
never once occurred to Isabelle, who saw him going foolhardily to
place his head in the jaws of the lion that roared for his bones to
crunch; in other words, to fight on their own ground Peterson and
his crowd that had boasted how they would get him.
“She’ll do me the favor to be thinking of me now,” said Patrick
O’Neill to himself, though he never once looked back.
CHAPTER V. PLOTTERS AT WORK.
He stopped to reach forward, poised for the cast, then froze in his
tracks as some one beyond the bushes spoke his name. He turned
his head and stared upward, but could see nothing save the yellow-
leaved thicket.
“Aw, that damn ranger!” came Peterson’s drawling voice. “Forget
him! Plenty of time for gettin’ him outa the way. Now we’ll settle
about the cattle for Whiskers. When will he be through gatherin’
’em?”
“We’re through now with the bunch I told yuh about,” the voice of
Little Bill made reply. “All you can git away with safe. They was
throwed in on Castle Creek yesterday. That’s the reason the old
man’s been keepin’ cattle outa Castle Creek, so the feed’ll be good
to hold his beef steers on till he gits ready to trail ’em out.”
“Somebody’ll stay with ’em, perhaps. Will you be the one, Bill?”
“Aw, they don’t need herdin’, Gus. The drift fence holds ’em from
crossin’ to Drew’s range and they won’t work back up over the ridge
the other way—not with the feed like it is in there. That’s the way
old Boyce figures on savin’ men’s wages. He’ll throw all the beef in
there fast as we gather, and make one drive out. I’m s’posed to be
huntin’ strays over here, Gus.”
Peterson grunted, and another voice which O’Neill did not
recognize spoke up, offering a few choice remarks on the subject of
Boyce’s stinginess. He was answered by yet another, and when
Peterson spoke again, a third man’s voice was raised in protest.
“If you take ’em up around Lodgepole Basin and across Squaw
Gulch and that way—why, hell! You might just as well ride up to
Boyce and tell ’em you got his steers—and what’ll he do to yuh! He’s
goin’ to miss the bunch first time any one rides to Castle Creek, an’ a
blind man could foller their trail.
“Now, what yuh want to do is take ’em out on Drew’s range, on
Limestone. We can break the drift fence there and make it look like
the cattle done it, and take the bunch out that way, on Drew’s
range, and haze some of Drew’s cattle back through the fence onto
Castle Creek. That way, old Boyce won’t miss his cattle for a week,
maybe. Neither will Drew, because he ain’t half through with his
round-up yet. When they’re ready to make their drive out, it’ll look
like the cattle got mixed up, is all. And if Boyce don’t find his steers
over on Drew’s range, let ’em lock horns over it if they want to!
They’re always fighting, anyway, over the line or some darn thing.
“That way, there ain’t any mysterious tracks across Myers Creek
and up Squaw Gulch way, and it’s about as close to where you want
to hold ’em, Gus. Time the brands is healed and you get ’em down
outa that high basin, winter’ll be on and you’re dead safe. You’ll
make a late drive this year with your beef, that’s all, and you’ll have
all Box S brands—see? If that damn O’Neill don’t go prowling around
up there-”
“Aw, what’s goin’ to take him up there? That basin is hemmed in
on all sides with young lodgepole pines, and the chances are he
don’t even know it’s there. Yeah, that scheme oughta work fine,
Gus. We’ll see yuh as far as the hideout, for five dollars a head, and
from then on you’ll have to handle it alone.”
“You fellows should help change the brands, too, for five dollars,”
Peterson objected. “A five-spot just for drivin’ the cattle is too much.
I won’t pay five dollars for just to-night’s work.”
While they wrangled over the money, Patrick O’Neill went down
the creek to where his horse was tied, mounted and urged the
animal across the creek and up the farther side of the cañon, taking
a trail that led sharply away from his objective, which was the trail
up from Bad Cañon to the Box S Ranch. He wanted very much to
see the three men whose voices he failed to recognize.
Little Bill and Peterson, the ranger could swear to, if it came to a
court trial for cattle stealing, but he would feel much easier in his
mind if he had the added evidence of meeting the group riding up
the cañon where he had heard them planning the details of the
crime.
Morenci, the horse, was sweating to his ears when O’Neill finally
reached the trail he wanted and loped along it to Bad Cañon. The
detour had been made in record time, but even so he was too late,
as he was forced to admit when he rode down to the creek at the
point where he had heard the discussion, and found the men gone.
A windowless log hut set back from the creek bank beyond the
willow thicket had been their meeting place, he discovered. There
were signs enough of their presence—cigarette stubs on the dirt
floor, burned matches, boot tracks, while farther back from the creek
he found the place where they had tied their horses.
“They went down the creek, and I missed them entirely,” he
decided ruefully, at last. “Rode straight away from them as if the
devil was after me, when all I had to do was stop where I was, at
the creek with my fishing tackle, and they’d have been atop of me
before they knew I was there—and me with the best and most
peaceful excuse any man could want! Pat, me lad, you should be
well booted for that blunder!”
That night they would make the drive, they had said. They were
wise to hurry the job, since there was little time to spare before the
winter snows would send the stolen herd down from the high basin;
and the altered brands would take some time to heal so that the
theft would not be apparent. Furthermore, it was only a matter of
days until Boyce or Drew would discover the broken drift fence and
begin to search for strayed cattle.
Ranger O’Neill rode with a cigarette gone cold from neglect
between his lips while he pondered the best manner of protecting
Boyce. He could ride to the Bar B and warn them——
“But what if those strange men are Bar B riders?” he argued the
point with himself. “Or what if Boyce is not at home, or more likely
starts his tongue wagging at me and stirs the Irish before I get out
the news? I’d ride away and let Peterson put through the steal—if
Boyce makes me mad enough. And the time is short for a ride to the
Bar B and back again to Castle Creek soon enough to stop them.
“Morenci, you’ve the mark of a good cow pony in the way you
handle yourself on range inspection, and if you work fast enough,
I’m thinking we can handle this little matter alone; though it’s little
encouragement I’ve lately received for playing the patron saint to old
Boyce. Still, there’s a way to work it that appeals to my sense of
humor, and it’s that we’re going to do. So shake a leg, Morenci!
You’ve a lot of violent exercise between you and your feed box to-
night.”
And Patrick O’Neill, for the first time that day, whistled under his
breath, as he galloped, to show how content he was with his
mission.
CHAPTER VI. A QUICK CHANGE.
Later Pat O’Neill did not whistle, though he still rode in haste. The
afternoon was older than he had suspected when he rode up out of
Bad Cañon and across the high grazing ground that lay between his
fishing place and Lodgepole Basin. He had a plan which he felt
would work beautifully, if only he had time for it; but now with the
sinking of the sun, he was not so sure. A great deal depended upon
his horse, and he had not spared the animal in his roundabout ride
to cut the homeward trail of Peterson and his men.
“First, I must be sure that Boyce’s steers are safe,” he decided,
and crossed Limestone Creek with a splash and a clatter of hoofs on
the stones. “It’s a new range the Bar B cattle are on, and if I can
read the mind of cow brutes, they have traveled as far down the
creek as they can go. They will not be satisfied to stay at the upper
end of the bottom where the grass is quite as good, but must range
farther in the vain hope of finding range that pleases them better. At
any rate, it’s worth the gamble.”
As he opened the wire gate in the drift fence which separated
Drew’s range from Boyce’s on Castle Creek just above its junction
with Limestone, the parklike basin was dusky with the coming of
night, but as he led his horse through, closed the gate and
remounted, a steer snorted dew from its nostrils not far away. O’Neill
turned and rode that way, peering down satisfiedly at the dark forms
of the Bar B beef steers bedded down on a rise of ground just back
from the creek and the mosquitoes and close to the fence.
“What did I tell you, Morenci? Now, rout them up and we’ll haze
them on down the fence toward Picket Pin. If it’s through a fence
they want to travel, they may try the other side of the fence on
Picket Pin and welcome—and the farther they drift, the safer they’ll
be, though it will make more work for the Bar B riders.”
When he had finished that job and the Bar B steers were plodding
in the dark to find another bed ground on Picket Pin, Patrick O’Neill
cautiously lighted a match in the crown of his hat and looked at his
watch.
“Eight o’clock and our work only begun! Get away from here,
Morenci, and show the stuff that’s in you!” And striking into a cow
path that wound through thickets of aspen and across little open
glades, he pelted away up Castle Creek to the steep trail where the
rim rock broke down in a great slide of boulders on the divide
between Myers Creek and Castle.
When he reached Lodgepole Basin, his watch said ten o’clock and
Ranger O’Neill had a deep crease between his eyebrows, for Morenci
was wet to his ears—and that not from splashing through creeks,
though he had crossed two—and there were more cattle to be
moved.
But these were Peterson’s and Ranger O’Neill was not so gentle.
Across Lodgepole Basin, he galloped, to where a hundred head or
more of Box S cattle ranged happily enough and had for their bed
ground a knoll not far from Squaw Gulch, which was not very distant
from the Myers Creek divide. For the Stillwater Forest Reserve, you
must know, is a network of streams and their cañons, once you are
back in the hills.
So Ranger O’Neill made a hasty gathering of Peterson’s cattle and
hazed them along at a lumbering gallop to the fenced gap in the rim
rock and so down into the Castle Creek pasture which was leased to
Boyce. Just for good measure he rode after them and threw a hastily
gathered rock or two, and the cattle went down the creek as if a full
crew rode hard at their heels.
Ranger O’Neill pulled up and listened until the last sound of
whipping brush and the clicking of cloven feet against the rocks had
died to silence. The cattle were tired after that headlong drive up
Myers Creek to the rim. It had been steep in places and only the
manner in which he had rushed them along had held them to the
trail. Morenci was standing with his feet slightly braced—the mark of
a tired horse—and his flanks palpitating with exhaustion. O’Neill
listened while the horse caught his wind, then suddenly he leaned
forward and gave the reeking neck a grateful slap.
“Not a dozen horses in the district could have done it, and that’s
the truth, Morenci!” Then he fell silent, though his thoughts went on
quite as definitely as if he were actually speaking them.
“No sound of riders down below there, so the cattle will quiet
down before Peterson comes for them—he chooses late hours for his
stealing, thank the Lord! So now let him steal his own stock, though
what he’ll think or what he’ll say when he sees their brands in the
morning, I sure would like to know. I’d like to go and collect a bit of
gratitude from Queen Isabelle and the Honorable Standish Boyce for
this night’s work, but that will have to wait until Thursday, for I’m
due at Blind Bridger to-morrow. But when I do see her, she will
admit I’m doing much to promote peace and quiet along the
Stillwater, I’m thinking.”
Wherefore Ranger Patrick O’Neill was a contented young man
although a weary one as he rode home under the cool stars of
midnight. Morenci got an extra rubdown as well as his supper before
O’Neill went away to the cabin to fill his own empty stomach. The
fish he had caught were far past their fresh toothsomeness and he
threw them away and dined upon what happened to stand ready
cooked in the cupboard. But it was a good night’s work and he
grinned over it frequently.
“Murray would appreciate that!” O’Neill chuckled, as he pulled off
his boot. He was thinking of Peterson’s slack-jawed amazement
when he recognized the cattle he had stolen away from Castle Creek
that night.
The ranger’s last thought as he put his head on the pillow was of
the peppery Bar B owner and his probable mystification when he
found his beef herd over on the Picket Pin. Some one would catch a
tongue lashing, O’Neill suspected.
“But I’ll ride over and tell him about it before he has time to
discover the change of pasture,” he comforted himself. “Peterson
was counting on a week or so before the rustling would be
suspected, and I’ll see Boyce before then. And Isabelle,” he added
sleepily, and then began to dream of all that he would have to say.
CHAPTER VII. FROM BAD TO WORSE.
“Sure and a most loyal subject bows before the queen this day!”
cried Patrick O’Neill, with his best brogue and a somewhat self-
satisfied grin on his face. “I was scarce hoping you’d ride out to
meet me, and that’s why I was taking the short cut to the Bar B this
morning. I’ve things to report that——”
“I should think you would have,” Isabelle Boyce told him sharply.
“With all this mix-up over the cattle, and the trouble it’s making, I
should think you would have something to say on the subject! Do
you know how Tod Drew’s cattle came to be on father’s best range,
and father’s beef herd over on that barren ground that wouldn’t
furnish grazing for a sheep? And the drift fence down——”
“Do I know? It’s a night’s sleep I lost in getting full knowledge of
the mystery, Queen Isabelle! I drove your father’s cattle to the Picket
Pin——”
“Indeed?” So much meaning may be crowded into one word with
a rising inflection that Patrick O’Neill felt a momentary panic. “I
hope, Mr. O’Neill, you will oblige me with your reasons for so
astounding a piece of trouble making. I am frankly curious to know
what possessed you to commit such a deed.”
“It was a good deed, of which I am proud to tell,” he informed
her, secretly pleased at the dramatic change he would presently
produce in her mood. “On last Friday afternoon I chanced to hear a
plan to steal your father’s gathering of beef steers which he was
holding on Castle Creek. Peterson was the leader, and they meant to
tear down the drift fence between your father’s range and Drew’s,
and drive out the steers that way. They would then drive as many of
Drew’s cattle as they could handily gather through the fence and
onto Castle Creek, so that it would look as though the cattle had
broken down the drift fence and were trespassing of their own
accord, and it would not be suspected at once that the beef herd
was stolen. Castle Creek Basin being brushy in the hollows, the plan
had a fair chance of success.
“I failed to see the men—and that was a bit of bad guessing, of
which I am not proud. But I recognized the voice of a Bar B rider,
among others. It was late, and though I could have waited at the
drift fence and held them up when they came, I could bring no
charge against them unless they had actually stolen the cattle. So I
thought I would play a trick on Peterson.
“I went to Castle Creek and moved the Bar B steers out of harm’s
way—regretting the poor pasturage but having little time to choose a
range for them. Then I rode back to Lodgepole, where a bunch of
Peterson’s cattle grazed, took them across Squaw Gulch to the head
of Myer’s Creek, and up over the divide and through the gap to
Castle Creek Basin. It was fast work and it was pretty work, Miss
Boyce, and I repeat that I am proud of it!”
With lips slightly parted and eyes wider than usual, Isabelle stared
at him and did not speak. So presently the grin smoothed itself from
his lips and the twinkle died in his eyes and left a puzzled look there,
which could easily turn hostile.
“Would you rather I had let them take your father’s whole beef
herd and run the fat off them getting them into some hidden place
in the mountains? Or perhaps you think I should have confronted
Peterson and fought the lot of them!”
“Of course I don’t think you should do anything so insane! But it
couldn’t be much worse. Why didn’t you come and tell father? Why
did you let days go by without saying a word? Is it possible you
don’t know that father and Tod Drew are always at sword’s points
over something, and jump at the least excuse for quarreling? You’ve
managed to stir up a pretty mess, Mr. O’Neill. You may have saved
father’s beef herd—but what is that when he and Drew have sent
each other warning that it will be shoot on sight from now on? I’ve
had all I could do to keep father from riding over and killing Drew
deliberately!”
“It couldn’t be for what I did the other night,” O’Neill protested.
“What if the fence is down and Drew’s cattle were found on your
father’s range? That’s not a shooting matter, with sane men.”
Isabelle gave him a withering look. “Oh, how can you be so
dense! Do you suppose for one minute that father could ride to
Castle Creek and discover Tod Drew’s cattle there, and his own
driven over on Picket Pin—because there was no fence broken down
there to lay the blame on the cattle!—without doing something
about it? He drove Drew’s cattle off with his six-shooter. He killed
one and crippled another so Drew had to have it shot. If Tod Drew
had been at that drift fence, Mr. O’Neill, there would have been
murder! There will be yet, if something isn’t done to stop them, for
Tod Drew shot our cattle with a shotgun! For a man who was going
to do such great things in psychology,” she cried distractedly, “and
instill both liking and respect for the forest service into the hearts of
the Stillwater men, you have promoted as bloodthirsty a feud as
ever happened anywhere! The only difference is that it is confined to
two men, so far—though the cowboys are just as likely to take it up
as not, just for the excitement of it!”
“I have received no instructions, Miss Boyce, for guarding the
morals of other men,” Patrick O’Neill said somewhat stiffly. “But since
your respected parent has not yet committed a murder as well as a
felony against his neighbor’s property, I have time enough perhaps
to curb his homicidal tendencies. A bit of an explanation will clear
the air, I’m thinking.” And he reached for Morenci’s dragging bridle
reins.
“You’re never going to face them now and tell them you did it?”
Isabelle’s voice rose to a high note of protest. “They’ll kill you!”
But Ranger O’Neill was in the saddle and away, pelting along to
Drew’s place, since that was closer than the Bar B. Isabelle watched
him out of sight, then mounted and galloped up the road in the dust
cloud he left behind him, her heart beating queerly, away up in her
throat.
It is strange how training oft will drop away from a man like a
garment of winter grown uncomfortable as summer approaches, yet
fall into place when the need of it arises again. So with Ranger
Patrick O’Neill when he pulled up his horse at Drew’s gate. In the
years since West Point he had put aside much of his military bearing
in everyday life, and he had gone rather irresponsibly out to meet
life, with his rollicky Irish manner to the front because it was easy to
wear.
Yet when he dismounted and walked up the path to the house, his
back was straight and his step was alert, his chest was out and his
belt was in and his eyes looked with keen discernment straight into
the leathery countenance of Tod Drew, who glanced cautiously out
of a near-by window before he opened the door to his insistent
knocking.
“Mr. Drew, I came to report what I know of the drift fence being
broken between your range and the Bar B lease on Castle Creek last
Friday night.” And Ranger O’Neill forthwith explained, with malice
toward none and naming no names, but making himself perfectly
clear for all that.
“I have no direct evidence upon which to convict these men, for I
failed to get a sight of them. There was little time to forestall them,
Mr. Drew, but I did what seemed to me best as a measure of
precaution. Since there has been a misunderstanding in the matter
of the cattle, I stand ready to make a fair adjustment of whatever
damages may have resulted from my removal of the Bar B herd
without due notice. I want you to go with me to call upon Mr. Boyce,
and I feel sure we can arrive at a friendly understanding.” Then, and
not until then, Drew had a glimpse of the grin that was so much a
part of Patrick O’Neill.
Drew gave O’Neill a peculiar, squinting look. “Say, me and that old
he-wolf has promised to swap lead however and wherever we meet
up with each other!” he stated emphatically, at last. “I’ll have to ride
up a-shootin’, or he’ll likely think I’m scared and plug me fer a
sheep!”
“Not if I ride with you,” urged Patrick O’Neill.
“Dern that ole pelican! he shot two steers fer me——”
“And you killed one or two for him, but if necessary I can arrange
to pay for the damages. There’s nothing like going straight out
toward trouble, Mr. Drew. Nine times in ten it backs out of sight as
you ride toward it. If you’re willing to take a chance——”
“Oh, I was goin’ to ride over there and have it out with him,”
Drew told him, with dark meaning. “I’m willin’ to meet the old coot
halfway, whether it’s shootin’ or shakin’ hands!”
“I’ve had it in mind to get you two together and see what can be
done about clearing out this rustling. You may be the next to suffer,
you know. I’m here to do whatever you two think best——”
“Well, I got an idea we might set some kinda trap——”
Shortly thereafter, Isabelle Boyce reined her horse out of the trail
to let the two riders pass. Her heart was still beating heavily in her
throat, but she would not acknowledge the smiling salute she
received from Ranger O’Neill. They were headed for her father’s
ranch, but she refused to hurry after them; instead, she waited a
while before she turned her horse toward home. Of course, with Tod
Drew talking and gesticulating in his usual manner, she could not
think that he was going to do murder. Ranger O’Neill would put a
stop to all that. But her father would rave and threaten and she
doubted whether he would stop long enough to listen to the story
which Ranger O’Neill had to tell, or believe it when it was told.
But when she rode up to the house, there stood the two horses
tied to the fence, and there were no high voices to be heard. She
stood for a minute on the porch, looking and listening. A murmur of
conversational tones floated out from the living room, and she went
in and stood just outside the closed door, eavesdropping with no
compunction whatever.
“If one of my men is involved in this nefarious spoilation of the
range,” her father’s rasping voice was saying, “I see no way of
exculpating the others until such time as the thieves are
apprehended. Mr. O’Neill, I must concur in one statement which you
have made, and that is the statement that leasers of government
property are entitled to government protection. I shall write to my
relative, who stands very close to the head of the department of
forestry in Washington——”
Isabelle gave a relieved little laugh which caught in her throat like
a strangled sob, and ran upstairs to choose a dainty dress—just in
case Ranger O’Neill was invited to stay for supper.
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.