Download ebooks file Deploy Container Applications Using Kubernetes: Implementations with microk8s and AWS EKS Shiva Subramanian all chapters
Download ebooks file Deploy Container Applications Using Kubernetes: Implementations with microk8s and AWS EKS Shiva Subramanian all chapters
com
https://ebookmass.com/product/deploy-container-applications-
using-kubernetes-implementations-with-microk8s-and-aws-eks-
shiva-subramanian/
OR CLICK HERE
DOWLOAD NOW
https://ebookmass.com/product/a-complete-guide-to-devops-with-aws-
deploy-build-and-scale-services-with-aws-tools-and-techniques-osama-
mustafa/
ebookmass.com
https://ebookmass.com/product/decision-making-in-veterinary-practice-
barry-kipperman/
ebookmass.com
Russia's Interventions in Ethnic Conflicts: The Case of
Armenia and Azerbaijan 1st ed. Edition James J. Coyle
https://ebookmass.com/product/russias-interventions-in-ethnic-
conflicts-the-case-of-armenia-and-azerbaijan-1st-ed-edition-james-j-
coyle/
ebookmass.com
https://ebookmass.com/product/lantre-des-viperes-french-edition-
knight/
ebookmass.com
https://ebookmass.com/product/the-second-age-of-computer-science-from-
algol-genes-to-neural-nets-1st-edition-subrata-dasgupta/
ebookmass.com
https://ebookmass.com/product/teach-me-daddy-an-age-play-mafia-daddy-
romance-mafia-daddies-nyc-book-5-zack-wish/
ebookmass.com
E-book Catatan Faidah Ilmu di Bulan Ramadhan (Revisi) Abu
Ubaidah Yusuf Sidawi
https://ebookmass.com/product/e-book-catatan-faidah-ilmu-di-bulan-
ramadhan-revisi-abu-ubaidah-yusuf-sidawi/
ebookmass.com
CHAPTER 1
Dependency Hell
Anyone who has installed Microsoft runtime libraries on a Windows VM running
multiple applications or had to upgrade a package system in Linux can tell you how
complex this can be.
Ever since computers made it into the business applications’ world, supporting
real-world applications and problem solving, there has always been the problem of
dependencies among the various components, both hardware and software, that
comprise the application stack.
The technical stack the application software is written on, for example, Java, has
versions; this Java version is designed to run on top of a specified set of runtime libraries,
which in turn run on top of an operating system; this specified operating system runs
on top of a specified hardware device. Any changes and updates for security and feature
enhancements must take into account the various interconnects, and when one breaks
compatibility, we enter the dependency hell.
1
© Shiva Subramanian 2023
S. Subramanian, Deploy Container Applications Using Kubernetes,
https://doi.org/10.1007/978-1-4842-9277-8_1
Chapter 1 From VMs to Containers
This task of updating system components was even more complicated when IT
systems were vertically scaled, where there was one underlying operating system and
many applications that ran on top of it. Each application might come with its own runtime
library requirements; an OS upgrade might not be compatible with the dependencies of
some applications running on top, creating technical debt and operational complexity.
The VM Way
Task: Suppose the developers have developed a static website which they have asked
you to host in your production environment.
As a seasoned systems engineer or administrator, you know how to do this. Easy!, you
say. I’ll create a VM, deploy a web server, and voilà! But what’s the fun in that? However,
let us still deploy the static website the traditional way and the container way. This way,
we will learn the similarities and differences between the two approaches. Thus
2
Chapter 1 From VMs to Containers
Note There are several virtual machine technologies available, such as the cloud,
ESXi host, VMware Workstation, Parallels, KVM, etc. Instructions for installing the
Linux operating system will vary widely depending on the virtualization software in
use; thus, we assume that the systems engineer/administrator is familiar with their
workstation setup.
lsb_release -s -d
Note The author has chosen to list plain command(s) only at the top of the listings
and the executed output and results right below it, making it easy to differentiate
between the command and the author’s illustrated outputs as shown in Listing 1-1.
3
Chapter 1 From VMs to Containers
lsb_release -s -d
shiva@wks01:~$ lsb_release -s -d
Ubuntu 22.04 LTS
shiva@wks01:~$
The package name for nginx is just nginx; thus, we will install
nginx using the standard package manager command as shown in
Listing 1-3.
4
Chapter 1 From VMs to Containers
Note <SNIP> in the output section indicates the sections of the output snipped
out of the listing to maintain brevity; it does not impact the concepts we are
learning.
5
Chapter 1 From VMs to Containers
Please note that your mileage may vary with respect to the
output messages due to variations in installed editions of the
operating system.
This marks the end of step 2, which is installing the web server;
now on to step 3.
Listing 1-5. Browsing to the nginx default website using the command line
curl localhost
6
Chapter 1 From VMs to Containers
Enter Containers
Welcome to the wonderful world of containers.
Containers solve both of the major problems associated with the VM way:
7
Chapter 1 From VMs to Containers
Here, the term image refers to the binary format or artifact of the
technology container.
1
https://cloud.google.com/containers
8
Chapter 1 From VMs to Containers
each application in its own container as the resource required to run a container is
very minimal; you will not be conserving any resources and will be reintroducing the
dependency management complexity that got us here in the first place!
Summary
In this chapter, we learned about two of the major problems associated with deploying
and managing an application and how containers promise to solve both the problems,
enabling systems engineers to reduce complexity while increasing efficiency, scalability,
and reliability of hosting applications via containers.
In the next chapter, we will deploy a simple static application via container
technology, realizing for ourselves how easy it is to deploy and manage applications
deployed via containers.
9
CHAPTER 2
Container Hello-World
Continuing from where we left off in the VM world, the goal of this chapter is to set up
container technology in our workstation and run our first container, hello-world, and
nginx web server, using docker with the intent to learn the basics of containers.
Docker Technology
When we say containers, for many, Docker comes to mind, and with a good reason.
Docker is a popular container technology that allows for users and developers to
build and run containers. Since it is a good starting point and allows us to understand
containers better, let us build and run a few containers based on docker technology
before branching out into the world of Kubernetes.
11
© Shiva Subramanian 2023
S. Subramanian, Deploy Container Applications Using Kubernetes,
https://doi.org/10.1007/978-1-4842-9277-8_2
Chapter 2 Container Hello-World
The astute reader will notice and ask: Why do we need a VM still? I thought we were
going with containers. The short answer is, yes, we still need a host machine to provide
compute, that is, the CPU, memory, and disk, for the containers to run; however, the
VM can be replaced with special-purpose host OSes that can be stripped down to a bare
minimum; we will learn more about compute nodes and observe these in later chapters.
First, let us install the docker package onto our workstation as shown in Listing 2-1.
12
Chapter 2 Container Hello-World
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
shiva@wks01:~$
The Docker package is installed; to confirm the same, run the command shown in
Listing 2-2.
dpkg -l docker.io
Note Highlights in the output show the key elements we are looking for in the
output section.
13
Chapter 2 Container Hello-World
shiva@wks01:~$
Notice docker is in active (running) state; this is good. We can now set this user up
for using docker.
14
Chapter 2 Container Hello-World
Note Unless noted otherwise, remarks starting with # are NOT part of the system
output; it is used by the author to highlight something being present or not present
as a form of explanation.
For this to take effect, you can log out and log back in or add the newly added group
to the current session by using the command shown in Listing 2-5.
Listing 2-5. Changing the acting primary group for the regular user
newgrp docker
Before proceeding, we need to verify the group docker shows up in our session; we
can do that by executing the command shown in Listing 2-6.
id
shiva@wks01:~$ id
uid=1000(shiva) gid=112(docker) groups=112(docker),4(adm),24(cdrom),
27(sudo),30(dip),46(plugdev),110(lxd),1000(shiva)
shiva@wks01:~$
15
Chapter 2 Container Hello-World
At this point, we have met the first prerequisite of installing and running the CRI.
Now that we have installed the container runtime and the service is running,
we need an image to run. This act of running an image using a container runtime is
generally known as container, and the process of packaging an application to run inside
the container is generally known as containerizing an application. More on that later.
A simple hello-world application exists for the container world also; let us run that to
make sure our setup is working properly before moving ahead.
Container Hello-World
Run the command to start our first container as shown in Listing 2-7. What this
command does is it instructs docker to find and run a container named hello-world; not
to worry, if this image is not present, docker is smart enough to download this image
from its default container repository and then run it. More on container repositories in
later chapters.
16
Chapter 2 Container Hello-World
4. The Docker daemon streamed that output to the Docker client, which sent
it to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
shiva@wks01:~$
Notice, right below the status: line, the output says “Hello from Docker!”. This
confirms our docker setup is functioning correctly. The description from the output
further elaborates what happened in the background. Docker service pulled the image
from Docker Hub and ran it. Container images are stored in container repos and are
“pulled” by the runtime as necessary. More on container repos later.
Congratulations! You just ran your first container!
Now that we have our workstation set up, we can now run the nginx container using
the command shown in Listing 2-8. In this command, first we are stopping the nginx
that’s running on the Linux workstation we started in Chapter 1, then we are asking
docker to run the nginx container and map localhost port 80 to container port 80.
If the container image is not locally found, docker automatically downloads it and
then runs it.
The port 80 mapping is so we can access container port 80 from the localhost,
meaning our Linux workstation, on port 80.
Currently, we are just using all defaults; we can change the mapped ports, etc.; more
on this later.
Have two terminal windows open and run the command in one window; run the
sudo and docker commands shown in Listing 2-8 in one window and run the curl
command shown in Listing 2-9 in another window.
17
Chapter 2 Container Hello-World
18
Chapter 2 Container Hello-World
Notice how the docker launched the nginx container; the container then started the
nginx worker threads; docker would have also mapped port 80 so that we can access the
default website. We can do that using curl on terminal 2, which we opened earlier, as
shown in Listing 2-9.
Notice how easy that was; in one command, we were able to deploy the static
website, the task that required a full VM install as we did in the previous chapter. The
memory and disk footprint is also very small when compared to a full VM. You can now
press CTRL+C on the terminal running the docker run command.
19
Chapter 2 Container Hello-World
Summary
In this chapter, you learned how to set up your workstation to begin working with
containers, installed Docker, and ran your first two container applications – the hello-
world container and a web server – using the stock nginx container image, as well as
how to map a port on the container to your local workstation so that you can access the
services the container is providing.
In the next chapter, we’ll begin building on what you have learned so far, expanding
on learning more container basic commands and concepts using Docker.
Your Turn
Whatever your workstation flavor is, ensure docker is set up and running like we have
done here as well as run the two sample containers and ensure we receive the expected
results. The next chapters build on what we have set up here.
20
CHAPTER 3
21
© Shiva Subramanian 2023
S. Subramanian, Deploy Container Applications Using Kubernetes,
https://doi.org/10.1007/978-1-4842-9277-8_3
Chapter 3 Container Basics Using Docker
Note You are welcome to sign up for a free account (free for personal use).
Type in nginx at the top-left search bar; select the first result “nginx” under verified
content, which will bring you to the dialog shown in Figure 3-2.
Security Note As with any public repository, anyone can publish images;
please exercise caution when downloading and running images from unknown
sources. In the docker repository, known good images have the “DOCKER OFFICIAL
IMAGE” badge.
22
Chapter 3 Container Basics Using Docker
Notice the badge next to the nginx name field; this is the docker official image and
thus is more safe than an unofficial image. Select the “Tags” tab, as shown in Figure 3-3.
23
Chapter 3 Container Basics Using Docker
You will see all the different flavors this image is available in, for example, you
can see the various OS/ARCH in the middle column. To pull a particular image; the
command shortcut is shown next to the container image; you can copy that shortcut to
the clipboard and paste in your terminal when we are ready to download. Right now,
we do not have to download this image yet - as we are only identifying the various nginx
container images available at hub.docker.com.
Notice the naming convention of the container images; stable-<something>, which
is typical in the container world, it indicates whether the image is experimental, beta
branch, stable, etc., and the alpine indicates the container was built with the Alpine
Linux as the base OS.
24
Chapter 3 Container Basics Using Docker
Let us now look at another container image that has the nginx application built-in. This
time it is from the Ubuntu software vendor. Now search again by typing “ubuntu/nginx” on
the search bar at the top left of the page, and select the result under “Verified Content” as
shown in Figure 3-4.
Select the ubuntu/nginx shown on the search bar; we land on the official ubuntu/
nginx image page as shown in Figure 3-5.
25
Chapter 3 Container Basics Using Docker
This is another container image built and published by Ubuntu. We will use this
image since this nginx container is built on top of the familiar Ubuntu operating system.
Similar to what you did previously, select the “Tags” tab, as shown in Figure 3-6, to
check out the container flavors available to us.
26
Chapter 3 Container Basics Using Docker
Figure 3-6. Image showing all the available tags for ubuntu/nginx
Notice the middle column, OS/ARCH; we see the architecture we need, which is
linux/amd64. Recall that from Chapter 1, our process architecture is x86_64. This is the
one we will be using.
27
Chapter 3 Container Basics Using Docker
The output indicates docker found the image and pulled them in chunks; when all
the chunks are “Pull complete,” docker computes the Digest to confirm the image has
not been corrupted during the download process, then confirms the status with us and
exits without errors.
All we have done at this point is downloaded the container image to our workstation.
We can verify the image is present in our local workstation by running the code shown in
Listing 3-2, which gives us pertinent information toward the container images stored on
this workstation.
28
Chapter 3 Container Basics Using Docker
Note Both nginx images are different; the plain nginx image is built and
maintained by the nginx vendor, while the ubuntu/nginx image is built and
maintained by Ubuntu. While in the previous chapter we used the nginx image
by nginx.com, in this chapter we are using the ubuntu/nginx image. There is no
preference with one over the other; as a systems engineer, you get to choose
which image you’d like to use; we have opted to continue with ubuntu/nginx. As
mentioned in the earlier SECURITY NOTE, care must be taken as to the source
of the image; here, both nginx.com and Ubuntu are well-established software
vendors.
Pay attention to the REPOSITORY column – it indicates the name of the container
image; the TAG column indicates the version, either a number or latest available; IMAGE
ID is the unique identifier (hash); CREATED indicates when the container was originally
created (not when it was locally created on our workstation); and SIZE indicates the size
of the container image.
Notice that the entire nginx container based off of the Ubuntu OS is ONLY
140MB. Compare that with the VM that we created in Chapter 2, which was several GB in
size – see the compactness of the containers!
An astute reader would have noticed that we cannot run the container yet, unlike the
hello-world container we ran, because hello-world did not provide any running service/
port. Here, as is typical with a web server, we need to expose a port that the web server
can run on. As shown in Figure 3-7, the “Usage” section on the “Overview” page provides
the information on how to pass the port number to the container.
29
Chapter 3 Container Basics Using Docker
Figure 3-7. Usage instructions on how to expose the port on the container
30
Chapter 3 Container Basics Using Docker
docker run
Before running this command, let us check and ensure if 8080 is free on the local
machine; the command in Listing 3-3 lists all the listening ports on the Linux machine.
If we find 8080 here, then that means some other process is using that port; if we don’t
see 8080, then it is available for us to use. Since we do not see 8080 in the output in
Listing 3-3, we are free to use it for our container.
Listing 3-3. Confirming port 8080 is not in use using the ss command
ss -ntl
shiva@wks01:~$ ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
Process
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
31
Chapter 3 Container Basics Using Docker
lsof is another popular way to see if any process is using port 8080; run it as shown
in Listing 3-4. The lack of output from the command indicates that no other process is
using port 8080, so we can utilize this port.
Listing 3-4. Confirming port 8080 is not in use via the lsof command
lsof -i:8080
Finally, when we launch our container, we will be connecting to port 8080, where our
nginx will be running; before making any changes, let us document the before picture by
connecting to port 8080 with the curl command as shown in Listing 3-5. The expected
output is an error, since nothing should be running on 8080 at this time.
curl localhost:8080
We have confirmed nothing is running on 8080, and thus it is free to use; we also
confirmed curl is not able to connect to 8080 yet.
Now we are ready to launch the container and expose the ports; run the command
we just learned including all the command-line options to name the container and pass
the port to be exposed, the image to be run, and any optional parameters like timezone
as shown in Listing 3-6.
32
Chapter 3 Container Basics Using Docker
The command in Listing 3-6 exited showing the a hash value (this is the CONTAINER
ID) and without any other errors, meaning it completed successfully. We can now
confirm if the container is running as expected using the docker ps command, as shown
in Listing 3-7, which shows information about all the running containers.
docker ps
shiva@wks01:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
b51b6f4a5934 ubuntu/nginx:latest "/docker-entrypoint...." 26 seconds
ago Up 25 seconds 0.0.0.0:8080->80/tcp, :::8080->80/tcp nginx01
shiva@wks01:~$
Here, we can see the container we launched is UP for 25 seconds, and we have
mapped 8080 on the localhost to 80 on the container, where the web server is running.
We can also confirm this is the container we launched by comparing the output hash
value displayed when we launched the container with the CONTAINER ID column on
the docker ps output, though the CONTAINER ID column is truncated due to display
space constraints, up to the characters displayed - they match.
Notice that this time around, we do see something listening on port 8080, which is
what we asked docker to do – map localhost port 8080 to the container port 80; that’s
what is shown in the output of the docker ps command:
0.0.0.0:8080->80/tcp
We have confirmed the container process is listening on port 8080; now, we can
conduct an end-to-end test by connecting to port 8080 via CURL. If the web server is
running on the container, then we should see the website’s default landing page, which
we can do using our familiar curl command as shown in Listing 3-9.
Listing 3-9. Accessing the nginx container web server via curl
curl localhost:8080
34
Chapter 3 Container Basics Using Docker
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
shiva@wks01:~$
Curl connected to port 8080, which docker redirected to port 80 on the nginx
container it is running, which in turn served the web page which was then provided to
curl, which is what we see as the output in Listing 3-9!
Want to launch another web server instance? Easy. Let us name our container
instance nginx02, map 8081 to 80, and launch – the following command accomplishes
this; we are just changing the name and port number to be unique; thus, the command
then becomes
We can run it on our system as shown in Listing 3-10; notice how easy it is to launch
another instance of the nginx web server, one command.
The command completed successfully; let us confirm with docker ps that the second
container is running as shown in Listing 3-11.
35
Chapter 3 Container Basics Using Docker
docker ps
shiva@wks01:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
5e25f3c059ec ubuntu/nginx:latest "/docker-entrypoint...." 18 seconds
ago Up 17 seconds 0.0.0.0:8081->80/tcp, :::8081->80/tcp nginx02
b51b6f4a5934 ubuntu/nginx:latest "/docker-entrypoint...." 5 minutes
ago Up 5 minutes 0.0.0.0:8080->80/tcp, :::8080->80/tcp nginx01
shiva@wks01:~$
We now see two instances running; both are UP and docker is exposing the ports we
requested for it to map.
Let us confirm both ports 8080 and 8081 are listening on the localhost with the
command shown in Listing 3-12.
Listing 3-13. Confirming we can access a website on both service ports via curl
curl localhost:8080
curl localhost:8081
36
Chapter 3 Container Basics Using Docker
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
[SNIP]
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Both web servers are running; no reinstall of OS or anything, just run the container.
The astute reader would be wondering, I can do this in an OS too, launching nginx as
separate processes under various ports and scaling out that way. While that is possible,
we will read more about the benefits of containers as we go along further in the chapters.
For one, if one container crashes, it is not going to impact the other containers; if you
would like to patch the underlying OS and need to reboot, if you run all the nginx
processes in a single VM, you will have to reboot all the web servers at once. However, in
containers, you can restart containers individually on a rolling basis; thus, downtime is
low, just to name a few.
37
Chapter 3 Container Basics Using Docker
Summary
In this chapter, we have learned how to find a prebuilt containers we would like to run
from hub.docker.com, how to identify the correct architecture, and how to formulate
runtime parameters for an image and run them under docker.
We also met our goal of launching the static website under docker, in a containerized
fashion.
In the next chapter, I’ll show you how to build your container image and run it.
Your Turn
Another popular web server is Apache HTTPD – very similar to nginx. The image name
is ubuntu/apache2. Try running this inside your docker setup.
38
CHAPTER 4
• A containerized base OS
A Containerized Base OS
As we saw in the previous chapters, we go to https://hub.docker.com and search
for Ubuntu 22.04. Search for “Ubuntu” in the top-left search bar and hit enter
(Figure 4-1).
40
Random documents with unrelated
content Scribd suggests to you:
bond to unite the body of the Church with its Head[578],” will perhaps
be admitted. According to the same author, St Paul teaches that “by
Baptism man is incorporated with Christ, and puts on Christ, so that
the sacramental washing does away with all natural distinctions or
race;—Greek and Jew, slave and free, men and women, are one in
Christ, members of His body, children of God and of the seed of
Abraham[579].” He tells us also that the same Apostle “not only
divides man into body and spirit, but distinguishes in the bodily
nature, the gross, visible, bodily frame, and a hidden, inner, ‘spiritual’
body not subject to limits of space or cognizable by the senses; this
last, which shall hereafter be raised, is alone fit for and capable of
organic union with the glorified body of Christ, of substantial
incorporation with it[580].” If Döllinger in the XIXth century could thus
interpret St Paul’s words, is it extraordinary that the author of the
Pistis Sophia should put the same construction on similar statements
some sixteen centuries earlier? So the late Dr Hatch, writing of
baptism in this connection, says: “The expressions which the more
literary ages have tended to construe metaphorically were taken
literally. It was a real washing away of sins; it was a real birth into a
new life; it was a real adoption into a divine sonship[581].”
If this be so, it seems to follow that the Mystery of the Ineffable One
must be the other and the greatest of the Christian sacraments.
Jesus tells His disciples that it is the “One and unique word,” and
that the soul of one who has received it “after going forth from the
body of matter of the Archons” will become “a great flood of light”
and will fly into the height, no power being able to restrain it, nor
even to know whither it goes. He continues:
“It shall pass through all the Places of the Archons and all the
Places of the emanations of light, nor shall it make any
announcement nor defence nor give in any symbol; for no Power
of the Archons nor of the emanations of light can draw nigh to
that soul. But all the Places of the Archons and of the
emanations of light shall sing praises, being filled with fear at the
flood of light which clothes that soul, until it shall have passed
through them all, and have come into the Place of the
inheritance of the mystery which it has received, which is the
mystery of the sole Ineffable One, and shall have become united
with his members[582].”
“Jesus said: When the time set by the Sphere of Destiny[637] for a
man that is a persistent slanderer to go forth from the body is
fulfilled, there come unto him Abiuth and Charmon, the receivers
of Ariel[638], and lead forth his soul from the body, that they may
take it about with them for three days, showing it the creatures of
the world. Thereafter they drag it into Amenti unto Ariel that he
may torment it in his torments for eleven months and twenty-one
days. Thereafter they lead it into Chaos unto Jaldabaoth and his
forty-nine demons, that each of his demons may set upon it for
eleven months and twenty-one days with whips of smoke.
Thereafter they lead it into rivers of smoke and seas of fire that
they may torment it therein eleven months and twenty-one days.
Thereafter they lead it on high into the Middle Way that each of
the Archons of the Middle Way may torment it with his own
torments another eleven months and twenty-one days. And
thereafter they lead it unto the Virgin of Light who judges the
righteous and the sinners, and she shall judge it. And when the
Sphere is turned round, she delivers it to her receivers that they
may cast it forth among the Aeons of the Sphere. And the
servants of the Sphere lead it into the water which is below the
Sphere, that the boiling steam may eat into it, until it cleanse it
thoroughly. Then Jaluha the receiver of Sabaoth Adamas,
bearing the cup of oblivion delivers it to the soul, that it may drink
therein and forget all the places and the things therein through
which it has passed[639]. And it is placed in an afflicted body
wherein it shall spend its appointed time[640].”
The object of the cup of oblivion is obviously that the wicked man
may learn nothing from the torments he has endured. In the case of
the righteous but uninitiated dead, the baleful effect of this cup will
be annulled by “the Little Sabaoth the Good” who will administer to
him another cup “of perception and understanding and wisdom”
which will make the soul seek after the mysteries of light, on finding
which it will inherit light eternal.
It would be easy to see in these features of the Texts of the Saviour
the work of Marcus the magician who, as was said in a former
chapter, taught, according to the Fathers, a corrupted form of the
doctrine of Valentinus for his own interested purposes[641]. The
distinguishing feature about his celebration of the Eucharist is the
same as that given in the Texts of the Saviour, and as Clement of
Alexandria was acquainted with a sect in his day which substituted
water for wine therein[642], it is probable that Marcosians were to be
found during the latter part of the IInd century in Egypt. It is also to
be noted that the annotator has written upon the blank leaf which
separates the first and second books of the Pistis Sophia a
cryptogram concealing, apparently, the names of the Ineffable One
and the other higher powers worshipped by Valentinus, and this
seems to be constructed in much the same way as the isopsephisms
and other word-puzzles attributed by Irenaeus to Marcus[643]. The
mixture of Hebrew names and words with Egyptian ones in the
prayer of Jesus given in the Texts of the Saviour would agree well
with what the last-named Father says about Marcus being a Jew,
and a prayer which he represents Marcus as making over the head
of a convert baptized into his sect is couched in a jargon of the same
character[644]. On the other hand, the opening sentence of the book
calls Jesus “our Lord,” which Irenaeus tells us the Valentinians
carefully abstained from doing[645], and the long and detailed
description of the different hells and their tortures is much more
Egyptian than Jewish[646]. The remark attributed to Basilides as to
one in a thousand and two in ten thousand being worthy to take the
higher mysteries is here put into the mouth of Jesus, and perhaps it
would be safer to attribute for the present the Texts of the Saviour
not to Marcus himself, but to some later Gnostic who fused together
his teaching with that of the earlier and more disinterested
professors of Egyptian Gnosticism.
The same remarks apply with but little modification to some other
fragments of Gnostic writings which have come down to us. In the
Bodleian Library at Oxford is to be seen a MS. written on papyrus,
which was brought to this country by the Abyssinian traveller, Bruce.
This also is in the Sahidic dialect of Coptic, and although it has been
badly damaged and the ink is rapidly disappearing in the damp
climate of Oxford, yet a copy taken nearly a century ago by Woide
makes its decipherment possible in most places. The Bruce
Papyrus, like the British Museum parchment MS., contains more
than one document. Unfortunately the arrangement of the leaves is
by no means certain, and the two scholars who have studied it most
thoroughly differ almost as widely as possible as to the order of its
contents. M. Amélineau, a celebrated Egyptologist and Coptic
scholar, who published in 1882 a copy of the text with a French
translation in the Notices et Extraits of the Académie des
Inscriptions, considers that the treatises contained in it are only two
in number, the first being called by the author in what seems to be its
heading The Book of the Knowledge of the Invisible God and the
second The Book of the Great Word in Every Mystery. Dr Carl
Schmidt, of the University of Berlin, on the other hand, who, like M.
Amélineau, has studied the Papyrus at Oxford, thinks that he can
distinguish in the Bruce Papyrus no less than six documents, of
which the first two are according to him the two books of Jeû referred
to in the Pistis Sophia, two others, fragments of Gnostic prayers, the
fifth a fragment on the passage of the soul through the Archons of
the Middle Way, and the sixth, an extract from an otherwise unknown
Gnostic work which he does not venture to identify further[647]. To
enter into the controversy raised by this diversity of opinion would
take one outside the limits of the present work; but it may be said
that at least one, and that the most important, of the documents in
question must be later than the Pistis Sophia. Not only does this—
which M. Amélineau calls the Book of the Knowledge of the Invisible
God and Dr Schmidt “Unbekanntes Altgnostisches Werk”—quote the
opening words of St John’s Gospel: “In the beginning was the Word
and the Word was with God, and the Word was God without whom
nothing was made[648],” which, as has been said, the author of the
Pistis Sophia was unable to do; but it mentions in briefer form than
this last the heavenly origin of the souls of the Twelve Apostles[649].
There is also in the same document a description of what appears to
be the “emanation of the universe,” in which the following passage
occurs:
“When you have gone forth from the body and come into the
First Aeon, the Archons of that Aeon will come before you. Then
stamp upon yourselves this seal AA, the name of which is
zôzesê. Utter this once only. Take in your two hands this number,
1119. When you have stamped upon yourselves this seal and
have uttered its name once only, speak these defences; ‘Back!
Protei Persomphôn Chous, O Archons of the First Aeon, for I
invoke Êazazêôzazzôzeôz.’ And when the Archons of the First
Aeon shall hear that name, they will be filled with great fear, they
will flee away to the West, to the Left Hand, and you will enter
in[663]”:
The priests took care that such a picture did not fade from want of
reproduction and, true to the genius of their nation, elaborated it until
its main features are almost lost to us under the mass of details[665].
Especially was this the case with the religion of the Sun-God Ra,
who after his fusion with Amon of Thebes at the establishment of the
New Empire came to overshadow all the Egyptian cults save that of
Osiris. The tombs of the kings at Thebes are full of pictures of the
land of this Amenti or the West, in which horror is piled upon horror,
and book after book was written that there should be no mistake
about the fate lying in wait for the souls of men[666]. In these we see
the dead wandering from one chamber to another, breathing a heavy
and smoke-laden air[667], and confronted at every step by frightful
fiends compounded from the human and bestial forms, whose office
is to mutilate, to burn, and to torture the soul. The means of escape
open to the dead was, under the XXth dynasty, neither the
consciousness of a well-spent life nor the fatherly love of the gods,
but the knowledge of passwords and mysterious names[668]. Every
chamber had a guardian who demanded of the dead his own name,
without repeating which the soul was not allowed to enter[669]. Every
fiend had to be repelled by a special exorcism and talisman[670], and
every “circle” through which the dead passed had its own song and
“mystery,” which it behoved the dead to know[671]. Only thus could he
hope to win through to the Land of Osiris, where he might enjoy a
relative beatitude and be free to go about and visit the other
heavenly places[672]. For this purpose, the map, so to speak, of the
route was engraved on the walls of the tombs of those who could
afford it, and the necessary words to be said written down. Those
who were not so rich or so lucky were thought to be parcelled out,
like the fellahin of that day, or the villeins of feudal times, in colonies
among the different districts of the lower world, where they flourished
or perished according to the number of talismans or “protections”
that they possessed[673]. “If ever,” says M. Maspero, “there were in
Pharaonic Egypt mysteries and initiates, as there were in Greece
and in Egypt under the Greeks, these books later than the Book of
the Other World and the Book of the Gates are books of mystery and
of initiates[674].” Thereafter, he goes on to say, the ancient popular
religion disappeared more and more from Egypt, to give place to the
overmastering sense of the terrors of death[675] and the magical
means by which it was sought to lighten them.
It is to the survival of these ideas that books like the Texts of the
Saviour and those in the Papyrus Bruce must be attributed. The
Gnostic Christianity of Valentinus, direct descendant as it was of the
amalgam of Christianity with pre-Christian faiths which the Ophites
had compounded, no sooner reached the great mass of the Egyptian
people than it found itself under their influence. In this later Gnostic
literature we hear no more of the Supreme Father of Valentinus,
“who alone” in his words, “is good”; no more weight is laid upon the
Faith, Hope, and Love who were the first three members of his
Heavenly Man; and the Jesus in whom were summed up all the
perfections of the Godhead becomes transformed into a mere
mystagogue or revealer of secret words and things. All expectation
of the immediate arrival of the Parusia or Second Coming, when the
world is to be caught up and all wickedness to be destroyed, has
passed into the background, as has also the millennium in which the
faithful were, in accordance with a very early belief in Egypt, to share
the felicity of those who had been kings on earth[676]. Instead we
have only appeals to the lowest motives of fear and the selfish desire
to obtain higher privileges than ordinary men. Even the avoidance of
crime has no other sanction, and complete withdrawal from the world
is advocated on merely prudential grounds; while rejection of the
mysteries is the unpardonable sin:
“When I have gone unto the light” (says the Jesus of the Texts of
the Saviour to His disciples) “preach unto the whole world,
saying: Renounce the whole world and the matter that is therein,
all its cares, its sins, and in a word all its conversation, that ye
may be worthy of the mysteries of the light, that ye may be saved
from all the torments which are in the judgments. Renounce
murmuring, that ye may be worthy of the mysteries of the light,
that ye may escape the judgment of that dog-faced one....
Renounce wrath, that ye may be worthy of the mysteries of the
light, that ye may be saved from the fire of the seas of the
dragon-faced one.... Renounce adultery, that ye may be worthy
of the mysteries of the kingdom of light, that ye may be saved
from the seas of sulphur and pitch of the lion-faced one.... Say
unto them that abandon the doctrines of truth of the First Mystery
‘Woe unto you, for your torment shall be worse than that of all
men, for ye shall dwell in the great ice and frost and hail in the
midst of the Dragon of the Outer Darkness, and ye shall escape
no more from the world from that hour unto evermore, but ye
shall be as stones therein, and in the dissolution of the universe
ye shall be annihilated, so that ye exist no more for ever[677]’.”
The priests who engraved the horrors of the next world on the walls
of the royal tombs at Thebes would probably have written no
differently.
Gnosticism then, in Egypt soon relapsed into the magic from which it
was originally derived; and we can no longer wonder that the Fathers
of the Church strove as fiercely against it as they did. In the age
when books like the Texts of the Saviour and the fragments in the
Papyrus Bruce could be written, the methods of Clement of
Alexandria, who treated Valentinus and his school as Christians bent
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookmass.com