Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

Getting Started with Kubernetes 2nd

Edition Baier
Visit to download the full and correct content document:
https://textbookfull.com/product/getting-started-with-kubernetes-2nd-edition-baier/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Getting Started With Angular 2nd Edition Stephen Adams

https://textbookfull.com/product/getting-started-with-
angular-2nd-edition-stephen-adams/

Getting Started with PhantomJS Beltran Aries

https://textbookfull.com/product/getting-started-with-phantomjs-
beltran-aries/

Getting Started with R: An Introduction for Biologists


2nd Edition Andrew Beckerman

https://textbookfull.com/product/getting-started-with-r-an-
introduction-for-biologists-2nd-edition-andrew-beckerman/

Getting Started with Gulp - Second Edition Travis


Maynard

https://textbookfull.com/product/getting-started-with-gulp-
second-edition-travis-maynard/
Make Getting Started with Processing py Allison Parrish

https://textbookfull.com/product/make-getting-started-with-
processing-py-allison-parrish/

Getting Started with EEG Neurofeedback John N. Demos

https://textbookfull.com/product/getting-started-with-eeg-
neurofeedback-john-n-demos/

Getting Started with Advanced C# 1st Edition Vaskaran


Sarcar [Sarcar

https://textbookfull.com/product/getting-started-with-
advanced-c-1st-edition-vaskaran-sarcar-sarcar/

Getting Started with Microsoft System Center Operations


Manager Kevin Greene

https://textbookfull.com/product/getting-started-with-microsoft-
system-center-operations-manager-kevin-greene/

Getting Started with Natural Language Processing MEAP


V06 Ekaterina Kochmar

https://textbookfull.com/product/getting-started-with-natural-
language-processing-meap-v06-ekaterina-kochmar/
Title Page
Getting Started with Kubernetes

Second Edition
Harness the power of Kubernetes to manage Docker deployments
with ease
Jonathan Baier

BIRMINGHAM - MUMBAI
Copyright
Getting Started with Kubernetes

Second Edition
Copyright © 2017 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
author, nor Packt Publishing, and its dealers and distributors will be held
liable for any damages caused or alleged to be 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.

First published: December 2015

Second edition: May 2017

Production reference: 1300517

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78728-336-7

www.packtpub.com
Credits

Author Copy Editor

Jonathan Baier Tom Jacob

Reviewer Project Coordinator

Jay Payne Kinjal Bari

Commissioning Editor Proofreader

Pratik Shah Safis Editing

Acquisition Editor Indexer


Prachi Bisht Mariammal Chettiyar

Content Development Editor Graphics

Monika Sangwan Kirk D'Penha

Technical Editor Production Coordinator

Devesh Chugh Aparna Bhagat


About the Author
J onathan Baier is an emerging technology leader living in Brooklyn, New
York. He has had a passion for technology since an early age. When he was
14 years old, he was so interested in the family computer (an IBM PCjr)
that he pored over the several hundred pages of BASIC and DOS manuals.
Then, he taught himself to code a very poorly-written version of Tic-Tac-
Toe. During his teen years, he started a computer support business. Since
then, he has dabbled in entrepreneurship several times throughout his life.

He currently enjoys working for Moody's as Vice President of Global Cloud


Engineering. He has over a decade of experience delivering technology
strategies and solutions for both public and private sector businesses of all
sizes. He has a breadth of experience working with a wide variety of
technologies and he enjoys helping organizations and management embrace
new technology to transform their businesses.

Working in the areas of architecture, containerization, and cloud security, he


has created strategic roadmaps to guide and help mature the overall IT
capabilities of various enterprises. Furthermore, he has helped organizations
of various sizes build and implement their cloud strategy and solve the
many challenges that arise when "designs on paper" meet reality.
Acknowledgement
I'd like to give a tremendous thank you to my wonderful wife, Tomoko, and
my playful son, Nikko. You both gave me incredible support and motivation
during the writing process for both editions of this book. There were many
early morning, long weekend and late night writing sessions that I could not
have done without you both. You're smiles move mountains I could not on
my own. You are my True north and guiding light in the storm.

I'd also like to give a special thanks to all my colleagues and friends at
Cloud Technology Partners. Many of whom provided the encouragement
and support for the original inception of this book. I'd like to especially
thank Mike Kavis, David Linthicum, Alan Zall, Lisa Noon, Charles Radi
and also the amazing CTP marketing team (Brad Young, Shannon Croy, and
Nicole Givin) for guiding me along the way!
About the Reviewer
Jay Payne has been a database administrator 5 at Rackspace for over 10
years, working on the design, development, implementation, and operation
of storage systems.

Previously, Jay worked on billing and support systems for hosting


companies. For the last 20 years, he has primarily focused on the data life
cycle from database architecture, administration, operations, reporting,
disaster recovery, and compliance. He has domain experience in hosting,
finance, billing, and customer support industries.
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktP
ub.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.comand 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.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you full
access to all Packt books and video courses, as well as industry-leading
tools to help you plan your personal development and advance your career.

Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the heart of
our editorial process. To help us improve, please leave us an honest review
on this book's Amazon page at https://www.amazon.com/dp/1787283364.

If you'd like to join our team of regular reviewers, you can e-mail us at
customerreviews@packtpub.com. We award our regular reviewers with free
eBooks and videos in exchange for their valuable feedback. Help us be
relentless in improving our products!
Table of Contents
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to Kubernetes
A brief overview of containers
What is a container?
Why are containers so cool?
The advantages of Continuous Integration/Continuous Deploymen
t
Resource utilization
Microservices and orchestration
Future challenges
The birth of Kubernetes
Our first cluster
Kubernetes UI
Grafana
Command line
Services running on the master
Services running on the minions
Tear down cluster
Working with other providers
Resetting the cluster
Modifying kube-up parameters
Alternatives to kube-up.sh
Starting from scratch
Cluster setup
Installing Kubernetes components (kubelet and kubeadm)
Setting up a Master
Joining nodes
Networking
Joining the cluster
Summary
References
2. Pods, Services, Replication Controllers, and Labels
The architecture
Master
Node (formerly minions)
Core constructs
Pods
Pod example
Labels
The container's afterlife
Services
Replication controllers and replica sets
Our first Kubernetes application
More on labels
Replica sets
Health checks
TCP checks
Life cycle hooks or graceful shutdown
Application scheduling
Scheduling example
Summary
References
3. Networking, Load Balancers, and Ingress
Kubernetes networking
Networking options
Networking comparisons
Docker
Docker user-defined networks
Weave
Flannel
Project Calico
Canal
Balanced design
Advanced services
External services
Internal services
Custom load balancing
Cross-node proxy
Custom ports
Multiple ports
Ingress
Migrations, multicluster, and more
Custom addressing
Service discovery
DNS
Multitenancy
Limits
A note on resource usage
Summary
References
4. Updates, Gradual Rollouts, and Autoscaling
Example set up
Scaling up
Smooth updates
Testing, releases, and cutovers
Application autoscaling
Scaling a cluster
Autoscaling
Scaling up the cluster on GCE
Scaling up the cluster on AWS
Scaling manually
Summary
5. Deployments, Jobs, and DaemonSets
Deployments
Scaling
Updates and rollouts
History and rollbacks
Autoscaling
Jobs
Other types of jobs
Parallel jobs
Scheduled jobs
DaemonSets
Node selection
Summary
References
6. Storage and Running Stateful Applications
Persistent storage
Temporary disks
Cloud volumes
GCE persistent disks
AWS Elastic Block Store
Other storage options
PersistentVolumes and StorageClasses
StatefulSets
A stateful example
Summary
References
7. Continuous Delivery
Integrating with continuous delivery pipeline
Gulp.js
Prerequisites
Gulp build example
Kubernetes plugin for Jenkins
Prerequisites
Installing plugins
Configuring the Kubernetes plugin
Bonus fun
Summary
8. Monitoring and Logging
Monitoring operations
Built-in monitoring
Exploring Heapster
Customizing our dashboards
FluentD and Google Cloud Logging
FluentD
Maturing our monitoring operations
GCE (StackDriver)
Sign-up for GCE monitoring
Alerts
Beyond system monitoring with Sysdig
Sysdig Cloud
Detailed views
Topology views
Metrics
Alerting
The sysdig command line
The csysdig command-line UI
Prometheus
Summary
References
9. Cluster Federation
Introduction to federation
Setting up federation
Contexts
New clusters for federation
Initializing the federation control plane
Adding clusters to the federation system
Federated resources
Federated configurations
Other federated resources
True multi-cloud
Summary
10. Container Security
Basics of container security
Keeping containers contained
Resource exhaustion and orchestration security
Image repositories
Continuous vulnerability scanning
Image signing and verification
Kubernetes cluster security
Secure API calls
Secure node communication
Authorization and authentication plugins
Admission controllers
Pod security policies and context
Enabling beta APIs
Creating a PodSecurityPolicy
Creating a pod with a PodSecurityContext
Clean up
Additional considerations
Securing sensitive application data (secrets)
Summary
References
11. Extending Kubernetes with OCP, CoreOS, and Tectonic
The importance of standards
The Open Container Initiative
Cloud Native Computing Foundation
Standard container specification
CoreOS
rkt
etcd
Kubernetes with CoreOS
Tectonic
Dashboard highlights
Summary
References
12. Towards Production Ready
Ready for production
Ready, set, go
Third-party companies
Private registries
Google Container Engine
Azure Container Service
ClusterHQ
Portworx
Shippable
Twistlock
AquaSec
Mesosphere (Kubernetes on Mesos)
Deis
OpenShift
Where to learn more?
Summary
Preface
This book is a guide to getting started with Kubernetes and overall
container management. We will walk you through the features and functions
of Kubernetes and show how it fits into an overall operations strategy.
You’ll learn what hurdles lurk in moving a container off the developer's
laptop and managing them at a larger scale. You’ll also see how Kubernetes
is the perfect tool to help you face these challenges with confidence.
What this book covers
Chapter 1,Introduction to Kubernetes, is a brief overview of containers and
the how, what, and why of Kubernetes orchestration, exploring how it
impacts your business goals and everyday operations.

Chapter 2, Pods, Services, Replication Controllers, and Labels, uses a few


simple examples to explore core Kubernetes constructs, namely pods,
services, replication controllers, replica sets, and labels. Basic operations
including health checks and scheduling will also be covered.

Chapter 3, Networking, Load Balancers, and Ingress, covers cluster


networking for Kubernetes and the Kubernetes proxy. It also takes a deeper
dive into services, finishing up, it shows a brief overview of some higher
level isolation features for mutli-tenancy.

Chapter 4,Updates, Gradual Rollouts, and Autoscaling, is a quick look at


how to roll out updates and new features with minimal disruption to uptime.
We will also look at scaling for applications and the Kubernetes cluster.

Chapter 5,Deployments, Jobs, and DaemonSets, covers both long-running


application deployments as well as short-lived jobs. We will also look at
using DaemonSets to run containers on all or subsets of nodes in the cluster.

Chapter 6, Storage and Running Stateful Applications, covers storage


concerns and persistent data across pods and the container life cycle. We
will also look at new constructs for working with stateful application in
Kubernetes.

Chapter 7,Continuous Delivery, explains how to integrate Kubernetes into


your continuous delivery pipeline. We will see how to use a k8s cluster with
Gulp.js and Jenkins as well.
Chapter 8, Monitoring and Logging, teaches how to use and customize built-
in and third-party monitoring tools on your Kubernetes cluster. We will look
at built-in logging and monitoring, the Google Cloud Monitoring/Logging
service, and Sysdig.

Chapter 9, Cluster Federation, enables you to try out the new federation
capabilities and explains how to use them to manage multiple clusters
across cloud providers. We will also cover the federated version of the core
constructs from previous chapters.

Chapter 10, Container Security, teaches the basics of container security from
the container runtime level to the host itself. It also explains how to apply
these concepts to running containers and some of the security concerns and
practices that relate specifically to running Kubernetes.

Chapter 11, Extending Kubernetes with OCP, CoreOS, and Tectonic,


discovers how open standards benefit the entire container ecosystem. We’ll
look at a few of the prominent standards organizations and cover CoreOS
and Tectonic, exploring their advantages as a host OS and enterprise
platform.

Chapter 12, Towards Production Ready, the final chapter, shows some of the
helpful tools and third-party projects that are available and where you can
go to get more help.
What you need for this book
This book will cover downloading and running the Kubernetes project.
You’ll need access to a Linux system (VirtualBox will work if you are on
Windows) and some familiarity with the command shell.

Additionally, you should have a Google Cloud Platform account. You can
sign up for a free trial here:

https://cloud.google.com/

Also, an AWS account is necessary for a few sections of the book. You can
sign up for a free trial here:

https://aws.amazon.com/
Who this book is for
Whether you’re heads down in development, neck deep in operations, or
looking forward as an executive, Kubernetes and this book are for you.
Getting Started with Kubernetes will help you understand how to move
your container applications into production with best practices and step by
step walk-throughs tied to a real-world operational strategy. You’ll learn
how Kubernetes fits into your everyday operations, which can help you
prepare for production-ready container application stacks.

Having some familiarity with Docker containers, general software


developments, and operations at a high-level will be helpful.
Conventions
In this book, you will find a number of text styles that distinguish between
different kinds of information. Here are some examples of these styles and
an explanation of their meaning.

Code words in text, folder names, filenames, file extensions, and pathnames
are shown as follows: "Do a simple curl command to the pod IP."

URLs are shown as follows:

http://swagger.io/

If we wish you to replace a portion of the URL with your own values it will
be shown like this:

https://<your master ip>/swagger-ui/

Resource definition files and other code blocks are set as follows:

apiVersion: v1
kind: Pod
metadata:
name: node-js-pod
spec:
containers:
- name: node-js-pod
image: bitnami/apache:latest
ports:
- containerPort: 80

When we wish you to replace a portion of the listing with your own value,
the relevant lines or items are set in bold between less than and greater than
symbols:

subsets:
- addresses:
- IP: <X.X.X.X>
ports:
- name: http
port: 80
protocol: TCP

Any command-line input or output is written as follows:

$ kubectl get pods

New terms and important words are shown in bold. Words that you see on
the screen, for example, in menus or dialog boxes, appear in the text like
this: "Clicking the Add New button moves you to the next screen."

There are several areas where the text refers to key-value pairs or to input
dialogs on the screen. In these case the key or input label will be shown in
bold and the value will be shown in bold italics. For example: "In the box
labelled Timeout enter 5s."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.


Reader feedback
Feedback from our readers is always welcome. Let us know what you think
about this book-what you liked or disliked. Reader feedback is important
for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail feedback@packtpub.com, and


mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either
writing or contributing to a book, see our author guide at www.packtpub.com/a
uthors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of
things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files for this book from your account
at http://www.packtpub.com. If you purchased this book elsewhere, you can
visit http://www.packtpub.com/support and register to have the files e-mailed
directly to you.

You can download the code files by following these steps:

1. Log in or register to our website using your e-mail address and


password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this book
from.
7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the
folder using the latest version of:

WinRAR / 7-Zip for Windows


Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.co
m/PacktPublishing/Getting-Started-with-Kubernetes-Second-Edition. We also
have other code bundles from our rich catalog of books and videos
available at https://github.com/PacktPublishing/. Check them out!
Downloading the color images
of this book
We also provide you with a PDF file that has color images of the
screenshots/diagrams used in this book. The color images will help you
better understand the changes in the output. You can download this file
from

https://www.packtpub.com/sites/default/files/downloads/GettingStartedwithKub
ernetesSecondEdition_ColorImages.pdf.
Another random document with
no related content on Scribd:
in South Africa, and to produce what, thank God! he had failed
in producing—a racial war." Mr. Chamberlain retorted that Sir
William Harcourt's attitude was unpatriotic and injurious to
the cause of peace. He denied aggressiveness in the policy of
the government, asserting that the South African Republic had
been spending millions on armaments imported from abroad, in
view of which the strengthening of the British garrison at the
Cape by an additional regiment and three batteries was no
unreasonable measure. Mr. Balfour, also, begged the House and
the country to believe that the troops were sent only as a
measure of precaution, to maintain admitted rights.

{478}

SOUTH AFRICA: The Transvaal: A. D. 1897 (May-October).


The British assertion of suzerainty and declination of
proposal to arbitrate disagreements.

On the 7th of May, 1897, the Acting State Secretary of the


South African Republic addressed to the British Agent at
Pretoria a communication of great length, reviewing the
positions taken by Mr. Chamberlain in his several arraignments
of the government of the Republic for alleged violation of the
London Convention of 1884, and proposing an arbitration of the
questions involved. "The complaint," he wrote, "which Her
British Majesty's Government has advanced in an unmistakably
pronounced manner over an actual or possible breach of the
Convention has deeply grieved this Government, as it thinks
that it has fulfilled its obligations. It sees in the
fulfilment of the mutual obligations under the Convention one
of the best guarantees for the maintenance of a mutual good
understanding and for the promotion of reciprocal confidence.
To this good understanding and that confidence, however,
severe shocks have been given by events which cannot be
lightly forgotten. And if it were not that this Government
wishes to guard itself against adopting a recriminating tone,
it might put the question whether, for example, the incursion
of Dr. Jameson, whether considered as a breach of the
Convention or a grievance, is not of immeasurably greater
importance than the various matters adduced by Her British
Majesty's Government would be, even if the contention that
they constitute breaches of the Convention could be accepted.
There should, in the view of this Government, be a strong
mutual endeavour to restore the shocked confidence and to calm
the excited spirit which this Government with sincere regret
sees reigning throughout almost the whole of South Africa.
This Government is anxious to co-operate for this end, for the
desire of the Republic, with the maintenance of its
independence and rights, is for peace, and where for the
reasons given it has been unable to entertain the proposal of
Her British Majesty's Government in the matter of the Aliens
Law,—and it appears very difficult to arrive at a solution of
the question by means of correspondence,—it wishes to come to
a permanent good understanding along a peaceful course, not
only with respect to its undisturbed right to make an alien
law, but also with regard to all points touching the
Convention which are referred to in the two Despatches under
reply by Her British Majesty's Government. While it respects
the opinion of Her British Majesty's Government, it takes the
liberty, with full confidence in the correctness of its own
views, to propose to Her British Majesty's Government the
principle of arbitration with which the honourable the First
Volksraad agrees, in the hope that it will be taken in the
conciliatory spirit in which it is made. …

"Although this Government is firmly convinced that a just and


impartial decision might be obtained even better in South
Africa than anywhere else, it wishes, in view of the
conflicting elements, interests, and aspirations, which are
now apparent in South Africa, and in order to avoid even the
appearance that it would be able or desire to exercise
influence in order to obtain a decision favourable to it, to
propose that the President of the Swiss Bondstate, who may be
reckoned upon as standing altogether outside the question, and
to feel sympathy or antipathy neither for the one party nor
for the other, be requested to point out a competent jurist,
as has already oftener been done in respect of international
disputes. The Government would have no objection that the
arbitrator be subject to a limitation of time, and gives the
assurance now already that it will willingly subject itself to
any decision if such should, contrary to its expectation, be
given against it. The Government repeats the well-meant wish
that this proposal may find favour with Her British Majesty's
Government, and inasmuch as the allegations of breaches of the
Convention find entrance now even in South Africa, and bring
and keep the feelings more and more in a state of suspense,
this Government will be pleased if it can learn the decision
of Her Majesty's Government as soon as possible."

Mr. Chamberlain's reply to this proposal was not written until


the 16th of the following October, when he, in turn, reviewed,
point by point, the matters dealt with, in the despatch of Mr.
Van Boeschoten. With reference to the Jameson raid he said: "Her
Majesty's Government note with satisfaction that the
Government of the South African Republic see in the fulfilment
of the mutual obligations under the London Convention one of
the best guarantees for the maintenance of a mutual
understanding and for the promotion of reciprocal confidence.
Her Majesty's Government have uniformly fulfilled these
obligations on their part, and they must strongly protest
against what appears to be an implication in the Note under
consideration that the incursion of Dr. Jameson can be
considered as either a breach of the Convention by Her
Majesty's Government or a grievance against them. That
incursion was the act of private individuals unauthorised by
Her Majesty's Government, and was repudiated by them
immediately it became known. The immense importance to the
Government of the South African Republic of that repudiation,
and of the proclamation issued by the High Commissioner under
instructions from Her Majesty's Government, is recognised
throughout South Africa. Her Majesty's Government maintain
strongly that since the Convention of 1881 there has never
been any breach or even any allegation of a breach on their
part of that or the subsequent Convention, and, as the subject
has been raised by the implied accusation contained in the
Note under consideration, Her Majesty's Government feel
constrained to contrast their loyal action in the case of the
Jameson raid with the cases in which they have had cause to
complain that the Government of the South African Republic
failed to interfere with, if they did not countenance,
invasions of the adjacent territories by its burghers in
violation of the Convention, and they feel bound to remind the
Government of the Republic that in one of these cases Her
Majesty's Government were compelled to maintain their rights
by an armed expedition at the cost of about one million
sterling, for which no compensation has ever been received by
them."

Concerning the proposal of arbitration, the reply of the


British colonial secretary was as follows: "In making this
proposal the Government of the South African Republic appears
to have overlooked the distinction between the Conventions of
1881 and 1884 and an ordinary treaty between two independent
Powers, questions arising upon which may properly be the
subject of arbitration.
{479}
By the Pretoria Convention of 1881 Her Majesty, as Sovereign
of the Transvaal Territory, accorded to the inhabitants of
that territory complete self-government subject to the
suzerainty of Her Majesty, her heirs and successors, upon
certain terms and conditions and subject to certain
reservations and limitations set forth in 33 articles, and by
the London Convention of 1884 Her Majesty, while maintaining
the preamble of the earlier instrument, directed and declared
that certain other articles embodied therein should be
substituted for the articles embodied in the Convention of
1881. The articles of the Convention of 1881 were accepted by
the Volksraad of the Transvaal State, and those of the
Convention of 1884 by the Volksraad of the South African
Republic. Under these Conventions, therefore, Her Majesty
holds towards the South African Republic the relation of a
suzerain who has accorded to the people of that Republic
self-government upon certain conditions, and it would be
incompatible with that position to submit to arbitration the
construction of the conditions on which she accorded
self-government to the Republic. One of the main objects which
Her Majesty's Government had in view was the prevention of the
interference of any foreign Power between Her Majesty and the
South African Republic, a matter which they then held, and
which Her Majesty's present Government hold, to be essential
to British interests, and this object would be defeated by the
course now proposed. The clear intention of Her Majesty's
Government at the time of the London Convention, that
questions in relation to it should not be submitted to
arbitration, is shown by the fact that when the delegates of
the South African Republic, in the negotiations which preceded
that Convention, submitted to Her Majesty's Government in the
first instance (in a letter of the 26th of November, 1883,
which will be found on page 9 of the Parliamentary Paper C.
3947 of 1884) the draft of a treaty or convention containing
an arbitration clause, they were informed by the Earl of Derby
that it was neither in form nor in substance such as Her
Majesty's Government could adopt."

Great Britain, Papers by Command.


C.—8721, 1898.

SOUTH AFRICA: Natal: A. D. 1897 (December).


Annexation of Zululand.

See (in this volume)


AFRICA: A. D. 1897 (ZULULAND).

SOUTH AFRICA: Cape Colony: A. D. 1898.


The position of political parties.
The Progressives and the Afrikander Bund.

"The present position of parties at the Cape is as unfortunate


and as unwarranted as any that the severest critic of
Parliamentary institutions could have conjured up. … The Cape
has always had the curse of race prejudice to contend with.
Time might have done much to soften, if not to expunge it, if
home-made stupidities had not always been forthcoming to goad
to fresh rancour. The facts are too well known to need
repetition. It is true not only of the Transvaalers that 'the
trek has eaten into their souls,' and up to the time of
emancipation and since, every conceivable mistake has been
committed by those in authority. Thus, when the breach was, to
all appearances, partly healed, the fatal winter of 1895 put
back the hands of the clock to the old point of departure. As
Englishmen, our sympathies are naturally with the party that
is prevalently English, and against the party that is
prevalently Dutch; but to find a real line of political
difference between them other than national sentiment requires
fine drawing. … According to our lines of cleavage both
Bondsmen [Afrikander Bund] and Progressives are Conservatives
of a decided type. Practically they are agreed in advocating
protective duties on sea-borne trade, although in degree they
differ, for whilst the Bond would have imposts as they are,
the Progressives wish to reduce the duties on food stuffs to
meet the grievance of the urban constituencies, and might be
induced to accord preferential treatment to British goods. On
the native question neither party adopts what would in England
be considered an 'advanced' programme, for education is not
made a cardinal point, and they would equally like, if
possible, to extend the application of the Glen Grey Act,
which, by levying a tax on the young Kaffirs who have not a
labour certificate, forces them to do some service to the
community before exercising their right of 'putting the
spoon,' as the phrase is, 'into the family pot.' Neither party
wishes to interfere with the rights of property or the
absolute tenure of land under the Roman-Dutch law. A tax on
the output of diamonds at Kimberley has been advocated by some
members of the Bond as a financial expedient, but it is
understood to have been put forward rather as a threat against
Mr. Rhodes personally than as a measure of practical politics.
Questions of franchise are tacitly left as they are, for no
responsible politicians wish to go back upon the enactment
which restricted the Kaffir vote to safe and inconsiderable
limits. The redistribution of seats was the subject of a Bill
upon which the last House was dissolved, after the rebuff that
the Ministry received upon a crucial division, but it has been
dealt with rather for practical than theoretical reasons. Two
schemes of redistribution have been formulated, and each has
been proposed and opposed with arguments directed to show the
party advantage to be derived. For political reform, in the
abstract, with or without an extension of the suffrage, there
is no sort of enthusiasm in any quarter. Railway
administration furnishes, no doubt, an occasional battle-field
for the two sides of the House. Roughly, the Progressives
favour the northern extension, and are willing to make
concessions in rates and charges to help on the new trade with
Rhodesia; whilst the Bond declare themselves against special
treatment of the new interests, and would spend all the money
that could be devoted to railway construction in the farming
districts of the colony itself. Mr. Rhodes, however, has
warned the Cape that any hostile action will be counteracted
by a diversion of traffic to the East, and it is unlikely that
any line of policy will be pursued that is likely to injure
the carrying trade of the southern ports. Between the
followers of Mr. Rhodes and the followers of Mr. Hofmeyr there
is no wide divergence of principle on public affairs of the
near future, so far as they have been or are to be the subject
of legislation; where the difference comes in is in the
attitude they severally assume towards the two republics and
the territories of the north, but when talk has to yield to
action it is improbable that there will be much in their
disagreement."
N. L. W. Lawson,
Cape Politics and Colonial Policy
(Fortnightly Review, November 1898).

{480}

SOUTH AFRICA: The Transvaal: A. D. 1898 (January-February).

Re-election of President Kruger.


Renewed conflict of the Executive with the Judiciary.
Dismissal of Chief-Justice Kotze.

The Presidential election in the South African Republic was


held in January and February, the polls being open from the 3d
of the former month until the 4th of the latter. President
Kruger was re-elected for a fourth term of five years, by
nearly 13,000 votes against less than 6,000 divided between
Mr. Schalk Burger and General Joubert, who were opposing
candidates. Soon afterwards, the conflict of 1897 between the
Judiciary and the Executive (see above: A. D. 1897,
JANUARY-MARCH), was reopened by a communication in which
Chief-Justice Kotze, of the High Court, called the attention
of the President to the fact that nothing had been done in
fulfilment of the agreement that the independence of the Court
and the stability of the Grondwet should both be protected by
law against arbitrary interference, and giving notice that he
considered the compromise then arranged to be ended. Thereupon
(February 16) President Kruger removed the judge from his
office and placed the State Attorney in his seat. Justice
Kotze denied the legality of the removal, and adjourned his
court sine die. In a speech at Johannesburg, some weeks
afterwards, he denounced the action of President Kruger with
great severity, saying: "I charge the President, as head of
the State, with having violated both the constitution and the
ordinary laws of the land; with having interfered with the
independence of the High Court; and invaded and imperilled the
rights and liberties of everyone in the country. The
guarantees provided by the constitution for the protection of
real and personal rights have disappeared, and these are now
dependent on the 'arbitrium' of President Kruger."

SOUTH AFRICA: Rhodesia and the British South Africa Company:


A. D. 1898 (February).
Reorganization.

In February, the British government announced the adoption of


plans for a reorganization of the British South Africa Company
and of the administration of its territories. The Company,
already deprived of military powers, was to give up, in great
part, but not wholly, its political functions. It was still to
appoint an Administrator for Rhodesia south of the Zambesi,
and to name the majority of members in a council assisting
him, so long as it remained responsible for the expenses of
administration; but, by the side of the Administrator was to
be placed a Resident Commissioner, appointed by the Crown, and
over both was the authority of the High Commissioner for South
Africa, to whom the Resident Commissioner made reports. At
home the status of the Board of Directors was to be
considerably altered. The life directorships were to be
abolished, and the whole Board of Directors in future to be
elected by the shareholders,—any official or director removed
by the Secretary of State not being eligible without his
consent. The Board of Directors was to communicate all
minutes, etc., to the Secretary of State, and he to have the
power of veto or suspension. Finally, the Secretary of State
was to have full powers to inspect and examine all documents;
Colonial Office officials named by him were, in effect, to
exercise powers like those of the old Indian Board of Control.

SOUTH AFRICA: Cape Colony: A. D. 1898 (March-October).

Election in favor of the Afrikander Bund.


Change in the government.
Elections to the Upper House of the Cape Parliament, in March,
gave the party called the Progressives, headed by Mr. Rhodes, a
small majority over the Afrikander Bund—more commonly called
the Bond. The Parliament opened in May, and the Progressive
Ministry, under Sir Gordon Sprigg, was defeated in the Lower
House in the following month, on a bill to create new
electoral divisions. The Ministry dissolved Parliament and
appealed to the constituencies, with the result of a defeat on
that appeal. The Bond party won in the elections by a majority
of two, which barely enabled it to carry a resolution of want
of confidence in the government when Parliament was
reassembled, in October. The Ministry of Sir Gordon Sprigg
resigned, and a new one was formed with Mr. Schreiner at its
head.

SOUTH AFRICA: The Transvaal: A. D. 1898-1899.


Continued dispute with the British Government
concerning Suzerainty.

During 1898 and half of 1899, a new dispute, raised by Mr.


Chamberlain's emphatic assertion of the suzerainty of Great
Britain over the South African Republic, went on between the
British Colonial Office and the government at Pretoria.
Essentially, the question at issue seemed to lie between a
word and a fact and the difference between the disputants was
the difference between the meanings they had severally drawn
from the omission of the word "suzerainty" from the London
Convention of 1884. On one side could be quoted the report
which the Transvaal deputation to London, in 1884, had made to
their Volksraad, when they brought the treaty back, and
recommended that it be approved. The treaty, they reported,
"is entirely bilateral [meaning that there were two sides in
the making of it] whereby your representatives were not placed
in the humiliating position of merely having to accept from a
Suzerain Government a one-sided document as rule and
regulation, but whereby they were recognized as a free
contracting party. It makes, then, also an end of the British
suzerainty, and, with the official recognition of her name,
also restores her full self-government to the South African
Republic, excepting one single limitation regarding the
conclusion of treaties with foreign powers (Article 4). With
the suzerainty the various provisions and limitations of the
Pretoria Convention which Her Majesty's Government as suzerain
had retained have also, of course, lapsed."

On the other side, Mr. Chamberlain could quote with effect


from a speech which Lord Derby, then the British Colonial
Secretary, who negotiated the Convention of 1884 with the Boer
envoys, made on the 17th of March, that year, in the House of
Lords. As reported in Hansard, Lord Derby had then dealt with
the very question of suzerainty, as involved in the new
convention, and had set forth his own understanding of the
effect of the latter in the following words: "Then the noble
Earl (Earl Cadogan) said that the object of the Convention had
been to abolish the suzerainty of the British Crown. The word
'suzerainty' is a very vague word, and I do not think it is
capable of any precise legal definition.
{481}
Whatever we may understand by it, I think it is not very easy
to define. But I apprehend, whether you call it a
protectorate, or a suzerainty, or the recognition of England
as a paramount Power, the fact is that a certain controlling
power is retained when the State which exercises this
suzerainty has a right to veto any negotiations into which the
dependent State may enter with foreign Powers. Whatever
suzerainty meant in the Convention of Pretoria, the condition
of things which it implied still remains; although the word is
not actually employed, we have kept the substance. We have
abstained from using the word because it was not capable of
legal definition, and because it seemed to be a word which was
likely to lead to misconception and misunderstanding."

Great Britain,
Papers by Command: C. 9507, 1899, pages 24 and 34.
SOUTH AFRICA: The Transvaal: A. D. 1899 (March).
Petition of British subjects to the Queen.

A fresh excitement of discontent in the Rand, due especially


to the shooting of an Englishman by a Boer policeman, whom the
Boer authorities seemed disposed to punish lightly or not at
all, led to the preparation of a petition to the British
Queen, from her subjects in the South African Republic,
purporting to be signed in the first instance by 21,684, and
finally by 23,000. The genuineness of many of the signatures
was disputed by the Boers, but strenuously affirmed by those
who conducted the circulation of the petition. It set forth
the grievances of the memorialists at length, and prayed Her
Majesty to cause them to be investigated, and to direct her
representative in South Africa to take measures for securing
from the South African Republic a recognition of their rights.
The petition was forwarded to the Colonial Office on the 28th
of March.

Great Britain, Papers by Command: 1899, C. 9345.

SOUTH AFRICA: The Transvaal: A. D. 1899 (May-June).


The Bloemfontein Conference between President Kruger and
the British High Commissioner, Sir Alfred Milner.

There seems to be no mode in which the questions at issue


between the British and the Boers, and the attitude of the two
parties, respectively, in their contention with each other,
can be represented more accurately than by quoting essential
parts of the official report of a formal conference between
President Kruger and the British High Commissioner in South
Africa, Sir Alfred Milner, which was held at Bloemfontein, the
capital of the Orange Free State, during five days, May
31-June 5, 1899. The meeting was arranged by President Steyn,
of the Orange Free State, with a view to bringing about an
adjustment of differences by a free and full discussion of
them, face to face. In the official report of the
conversations that occurred, from which we shall quote, the
remarks of President Kruger are given as being made by the
"President," and those of the High Commissioner as by "His
Excellency." The latter, invited by the President to speak
first, said:

"There are a considerable number of open questions between Her


Majesty's Government and the Government of the South African
Republic on which there is at present no sign of agreement. On
the contrary, disagreements seem to increase as time goes on.
… In my personal opinion the cause of many of the points of
difference, and the most serious ones, arises out of the
policy pursued by the Government of the South African Republic
towards the Uitlander population of that Republic among whom
many thousands are British subjects. This policy, the bitter
feeling it engenders between the Government and a section of
Uitlanders, and the effect of the resulting tension in South
Africa, and the feeling of sympathy in Great Britain, and even
throughout the British Empire generally, with the Uitlander
population, creates an irritated state of public opinion on
both sides, which renders it much more difficult for the two
Governments to settle their differences amicably. It is my
strong conviction that if the Government of the South African
Republic could now, before things get worse, of its own motion
change its policy towards the Uitlanders, and take measures
calculated to content the reasonable people among them, who,
after all, are a great majority, such a course would not only
strengthen the independence of the Republic but it would make
such a better state of feeling all round that it would become
far easier to settle outstanding questions between the two
Governments. … The President, in coming here, has made a
reservation as to the independence of the Republic. I cannot
see that it is in any way impairing the independence of the
Republic for Her Majesty's Government to support the cause of
the Uitlanders as far as it is reasonable. A vast number of
them are British subjects. If we had an equal number of
British subjects and equally large interests in any part of
the world, even in a country which was not under any
conventional obligations to Her Majesty's Government we should
be bound to make representations to the Government in the
interests of Her Majesty's subjects, and to point out that the
intense discontent of those subjects stood in the way of the
cordial relations which we desire to exist between us. I know
that the citizens of the South African Republic are intensely
jealous of British interference in their internal affairs.
What I want to impress upon the President is that if the
Government of the South African Republic of its own accord,
from its own sense of policy and justice, would afford a more
liberal treatment to the Uitlander population, this would not
increase British interference, but enormously diminish it. If
the Uitlanders were in a position to help themselves they
would not always be appealing to us under the Convention. …

"President.—I shall be brief. I have come with my commission,


in the trust that Your Excellency is a man capable of
conviction, to go into all points of difference. … I should
like His Excellency to go point by point in this discussion,
so that we can discuss each point that he thinks requires
attention, not with a view to at once coming to a decision,
but to hear each side, and we can go back on any point if
necessary, and see if we can arrive at an understanding. I
would like to give concessions as far as is possible and
practicable, but I want to speak openly, so that His
Excellency may be able to understand. I should like to say
that the memorials placed before Her Majesty's Government came
from those who do not speak the truth. I mean to convey that
we do give concessions wherever we think it practicable to do
so, and after we have discussed it in a friendly way Your
Excellency will be able to judge whether I or the memorialists
are right. I have said that if there are any mistakes on our
side, we are willing to discuss them. Even in any matter
concerning internal affairs I would be willing to listen to
his advice if he said it could be removed in this way or that
way. But when I show him that by the point we may be
discussing our independence may be touched, I trust he will be
open to conviction on that subject. …

{482}

"His Excellency.—I think the point which it would be best to


take first, if the President agrees, … would be the Franchise.
… There are a number of questions more or less resting upon
that. … I should like to know a little more about the
President's views. I want to know more because if I were to
begin and say I want this, that, and the other, I know I
should be told this was dictation. I do not want to formulate
a scheme of my own, but I can, if necessary.

"President.—As long as I understand that it is meant in a


friendly manner, and you mean to give hints, I won't take it
that they are commands. It has already been arranged that you
give me friendly hints and advice, and I will not take it as
dictation, even though it should be on points on which I
should consider you have no right to interfere. … I would like
you to bear one point in view, namely, that all kinds of
nations and languages, of nearly all powers, have rushed in at
the point where the gold is to be found. In other countries …
there are millions of old burghers, and the few that come in
cannot out-vote the old burghers, but with us, those who
rushed in to the gold fields are in large numbers and of all
kinds, and the number of old burghers is still insignificant;
therefore we are compelled to make the franchise so that they
cannot all rush into it at once, and as soon as we can assure
ourselves by a gradual increase of our burghers that we can
safely do it, our plan was to reduce the time for anyone there
to take up the franchise, and that is also my plan. … As His
Excellency doubtless knows, I have proposed to the Volksraad
that the time should be reduced by five years, and gradually
as more trusted burghers join our numbers, we can, perhaps, go
further. There are a number who really do not want the
franchise, but they use it as pretext to egg on people with
Her Majesty. … You must remember, also, on this subject, that
the burghers in our Republic are our soldiers, who must
protect the land, and that we have told these men to come and
fight when we have had difficulties with the Kaffirs. They
wanted the vote, but they would not come and fight. Those who
were willing to help obtained the franchise, but it appears
that many do not want to have it.

"His Excellency.—They did not want to take the obligations


without the rights of citizenship, and in that I sympathize
with them. If they should obtain that right, then naturally
they would have to take those burdens upon them.

"President.—Those who want the franchise should bear the


burdens.

"His Excellency.—Yes. Immediately they get the franchise they


take upon themselves the obligations connected therewith."

[From this the talk wandered to the subject of commandeering,


until the High Commissioner brought it back to the franchise
question.]

"His Excellency.—If I made a proposal to admit strangers under


such conditions as to swamp the old burghers it would be
unreasonable. But the newcomers have, at present, no influence
on the legislation of the Republic, which makes an enormous
difference. They haven't got a single representative. The
First Volksraad consists of 28 members, and not one member
represents the feelings of the large Uitlander population.

"President.—Men from any country could after two years vote


for the Second Volksraad, and after two years more sit in the
Second Raad. There are Englishmen who have obtained the full
franchise in that way, and are eligible for the Volksraad. And
now I have proposed to shorten the last ten years of the
period required for the full franchise and make it five years.

"His Excellency.—There are a great many objections of the


gravest kind to the process by which men may now obtain
burgher rights. First of all, before he can begin the process
of gradually securing burgher rights—which will be completed
in 14 years at present, and in 9 years according to the
President—he has to forswear his own allegiance. Take the case
of a British subject, which interests me most. He takes the
oath, and ceases to be a British subject by the mere fact of
taking that oath; he loses all the rights of a British
subject, and he would still have to wait for 12 years, and
under the new plan 7 years, before he can become a full
citizen of the Republic. British subjects are discouraged by
such a law from attempting to get the franchise. Even if they
wanted to become citizens, they would not give up their
British citizenship on the chance of becoming in 12 years
citizens of the Republic.

"President.—The people are the cause of that themselves. In


1870 anyone being in the land for one year had the full
franchise.

"His Excellency.—That was very liberal.

"President.—In 1881, after the war of independence, some of


our officials and even members of our Raad then said that they
were still British subjects, although they had taken the oath
of allegiance, and I had to pay back, out of the £250,000,
what I had commandeered from them. That was the reason the
oath had to be altered. …

"His Excellency.—In 1882, after all this had happened, there


was a franchise law in the Transvaal, which demanded five
years' residence, but it did not require the oath that is now
taken. It required a simple declaration of allegiance to the
State, though all this that the President refers to happened
before. Why was not it necessary to introduce this alteration
then?

"President.—The people who, before the annexation, had taken


that oath, but had not forsworn their nationality, 1887, sent
a lying memorial, as they are sending lying memorials now, to
say that everybody was satisfied, as they now say that
everybody is dissatisfied.

"His Excellency.—I think I must just explain a little more


clearly my views on the point we are now discussing. … I think
it is unreasonable to ask a man to forswear one citizenship
unless in the very act of giving up one he gets another, and I
think it is also unnecessary to ask him to do more than take
an oath of fealty to the new State, of willingness to obey its
laws and to defend its independence, when it is known and
certain that the taking of that oath deprives him of his
existing citizenship. I think the oath should be a simple oath
of allegiance, and that it should not be required of a man
until the moment he can get full rights in a new State. Now
that was the position under the law of 1882, and all these
reasons which the President has been giving are based on what
happened before that.
{483}
Why were they not considered and acted upon when the law of
1882 was made? … As for the period required to qualify for the
full franchise, I do not see why the length of time should be
longer in the South African Republic than in any other South
African State. They are all new countries. In the new country
which is springing up in the north, and which is getting a new
Constitution this year, the period is one year. The people who
have conquered that country for the white race may find that
the newcomers are more numerous than they are. But I do not
expect that anything like that will be done in the South
African Republic; something far short of that would be
reasonable. What I do think and desire, and that is the object
of my suggestion, is this: that the numerous foreign population
engaged in commerce and industry—to which the country, after
all, owes its present great position in wealth and influence—
should have a real share in the government of the Republic,
not to over-rule the old burghers—not at all—but to share the
work of Government with them, to give them the benefit of
their knowledge and experience, which is in many cases greater
than that of the old burghers, so that through their gradual
co-operation a time may come when, instead of being divided
into two separate communities they will all be burghers of the
same State. It is not enough that a few people should be let
in. It is obvious, however, that you could not let in the
whole crowd, without character or anything—I do not ask
it—but you want such a substantial measure that in elections
of members of the Volksraad the desires of the new industrial
population should have reasonable consideration. They have not
got it now, and when the questions that interest them come
before the Volksraad it is too evident that they are discussed
from an outside point of view. The industrial population are
regarded as strangers. … I do not want to swamp the old
population, but it is perfectly possible to give the new
population an immediate voice in the legislation, and yet to
leave the old burghers in such a position that they cannot
possibly be swamped.

"President.—I hope you will be open to conviction on that


point. I would like to convince you on the subject, and to
show you that it would be virtually to give up the
independence of my burghers. In the Republic the majority of
the enfranchised burghers consider they are the masters. Our
enfranchised burghers are probably about 30,000, and the
newcomers may be from 60,000 to 70,000, and if we give them
the franchise to-morrow we may as well give up the Republic. I
hope you will clearly see that I shall not get it through with
my people. We can still consult about the form of oath, but we
cannot make the time too short, because we would never get it
through with the people—they have had bitter experience. I
hope His Excellency will think about what I have said, and
weigh it well.

"His Excellency.—I see your point, and want to meet it.

"President.—I will think over what has been said, and will try
and meet every difficulty.

At the opening of the Conference on the second day the


President spoke of reports of an increase of British forces in
South Africa, which the High Commissioner assured him were
untrue. The latter in turn referred to accounts that had
appeared of an extensive purchase of arms in the Transvaal;
and was assured by the President that the armament of the
burghers was only for their proper preparation to deal with
the surrounding natives. The President then produced a
memorial purporting to be signed by 21,000 Uitlanders,
contradictory of the representations contained in the memorial
sent to the Queen in March (see above). After discussion upon
this, the conversation returned to the question of the
franchise.

"His Excellency.—What makes this whole discussion so difficult


is the intense prejudice on the side of the present burghers,
and their intense suspicion of us. They think Her Majesty's
Government wants to get their country back in one way or
another. Her Majesty's Government does not; but what it does
desire is that it should have such a state of rest in the
country as will remove causes of friction and difficulty
between the Republic and Her Majesty's possessions in South
Africa, and the whole of the British Empire, and my
suggestions here are directed to that end. I do not want to
say it over and over again, I say it once for all. …

"President.—I should like to make a slight explanation to His


Excellency. His Excellency yesterday mentioned that in some
States those going in from outside speedily got burgher
rights, but he must not forget, as I said before, they are

You might also like