Basic Q-and-A surrounding Kubernetes technology


PART 1:

Q1: What does "cURL" command do?

A: curl command is a tool to download or transfer files/data from or to a server using FTP, HTTP, HTTPS, SCP, SFTP, SMB and other supported protocols on Linux or Unix-like system. One can easily install and use the curl command on a Ubuntu Linux using the "apt" command or "apt-get" command to use the curl.

>>> Once installed, you can use it as follows to see the headers:
$ curl -I https://www.google.co.in/
$ curl -I https://www.cyberciti.biz/

Sample outputs:

HTTP/2 200 
date: Mon, 29 Jul 2019 13:13:08 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=d5292058141c28e3cda2d9501688cff531564405988; expires=Tue, 28-Jul-20 13:13:08 GMT; path=/; domain=.cyberciti.biz; HttpOnly; Secure
vary: Accept-Encoding
strict-transport-security: max-age=15552000
x-whome: l-cbz02
cf-cache-status: HIT
age: 102433
x-content-type-options: nosniff
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 4fdf59334ab9dcb5-MAA

>>> To download a file from a server using curl itself:
curl -o output.file http://server1.cyberciti.biz/bar.foo.txt

curl download file
The syntax is as follows to grab (download) files from remote http/ftp server:
curl -o output.file http://server1.cyberciti.biz/file.tar.gz
curl -O http://server1.cyberciti.biz/file.tar.gz
curl --remote-name http://server1.cyberciti.biz/file.tar.gz

You can download a web page and store in a local file as follows:
curl -o nixcraft.html https://www.cyberciti.biz/low.html

You can grab or download multiple files as follows:
curl -O http://www.cyberciti.biz/low.html -O http://bash.cyberciti.biz/dl/581.sh.zip

---

Q2: What is the difference between cURL and wget?

A: The main differences are:

- wget's major strong side compared to curl is its ability to download recursively.
- wget is command line only. There's no lib or anything, but curl's features are powered by libcurl.
- curl supports FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP. wget supports HTTP, HTTPS and FTP.
- curl builds and runs on more platforms than wget.
- wget is released under a free software copyleft license (the GNU GPL). curl is released under a free software permissive license (a MIT derivate).
- curl offers upload and sending capabilities. wget only offers plain HTTP POST support.

---

Q3: What is Docker?

A3.1: Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they're running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.

And importantly, Docker is open source. This means that anyone can contribute to Docker and extend it to meet their own needs if they need additional features that aren't available out of the box.

URL: https://opensource.com/resources/what-docker

...

A3.2: Docker helps you create and deploy software within containers. It’s an open source collection of tools that help you “Build, Ship, and Run any App, Anywhere”. Yes, it really is as magic as it sounds.

With Docker, you create a special file called a Dockerfile. Dockerfiles define a build process, which, when fed to the ‘docker build’ command, will produce an immutable docker image. You can think of this as a snapshot of your application, ready to be brought to life at any time. When you want to start it up, just use the ‘docker run’ command to run it anywhere the docker daemon is supported and running. It can be on your laptop, your production server in the cloud, or on a raspberry pi. Regardless of where your image is running, it will behave the same way.

URL: https://blog.containership.io/k8svsdocker/

---

Q4: What is the difference between Docker and Kubernetes?

A4.1: While Docker provided an open standard for packaging and distributing containerized applications, there arose a new problem. How would all of these containers be coordinated and scheduled? How do all the different containers in your application communicate with each other? How can container instances be scaled?

Solutions for orchestrating containers soon emerged. Kubernetes, Mesos, and Docker Swarm are some of the more popular options for providing an abstraction to make a cluster of machines behave like one big machine, which is vital in a large-scale environment.

When most people talk about “Kubernetes vs. Docker,” what they really mean is “Kubernetes vs. Docker Swarm.” The latter is Docker’s own native clustering solution for Docker containers, which has the advantage of being tightly integrated into the ecosystem of Docker, and uses its own API. Like most schedulers, Docker Swarm provides a way to administer a large number of containers spread across clusters of servers. Its filtering and scheduling system enables the selection of optimal nodes in a cluster to deploy containers.

Kubernetes is the container orchestrator that was developed at Google which has been donated to the CNCF and is now open source. It has the advantage of leveraging Google’s years of expertise in container management. It is a comprehensive system for automating deployment, scheduling and scaling of containerized applications, and supports many containerization tools such as Docker.

For now, Kubernetes is the market leader and the standardized means of orchestrating containers and deploying distributed applications. Kubernetes can be run on a public cloud service or on-premises, is highly modular, open source, and has a vibrant community. Companies of all sizes are investing into it, and many cloud providers offer Kubernetes as a service. 

URL: https://www.sumologic.com/blog/kubernetes-vs-docker/

...

A4.2: Manage Containers with Kubernetes
Once you’ve recovered from the excitement of spinning up your first few Docker containers, you’ll realize that something is missing. If you want to run multiple containers across multiple machines - which you’ll need to do if you’re using microservices - there is still a lot of work left to do.

You need to start the right containers at the right time, figure out how they can talk to each other, handle storage considerations, and deal with failed containers or hardware. Doing all of this manually would be a nightmare. Luckily, that’s where Kubernetes comes in.

Kubernetes is an open source container orchestration platform, allowing large numbers of containers to work together in harmony, reducing operational burden. It helps with things like:

- Running containers across many different machines
- Scaling up or down by adding or removing containers when demand changes
- Keeping storage consistent with multiple instances of an application
- Distributing load between the containers
- Launching new containers on different machines if something fails

URL: https://blog.containership.io/k8svsdocker/

---

Q5: What is a container?

A: At their core, containers are a way of packaging software. What makes them special is that when you run a container, you know exactly how it will run - it’s predictable, repeatable and immutable. There are no unexpected errors when you move it to a new machine, or between environments. All of your application’s code, libraries, and dependencies are packed together in the container as an immutable artifact. You can think of running a container like running a virtual machine, without the overhead of spinning up an entire operating system. For this reason, bundling your application in a container vs. a virtual machine will improve startup time significantly.

---

PART 2:

Q1: What is Kubernetes?
A:
Kubernetes is a vendor-agnostic cluster and container management tool, open-sourced by Google in 2014. It provides a “platform for automating deployment, scaling, and operations of application containers across clusters of hosts”. Above all, this lowers the cost of cloud computing expenses and simplifies operations and architecture.

...

Kubernetes is a cluster and container management tool. It lets you deploy containers to clusters, meaning a network of virtual machines. It works with different containers, not just Docker.
The basic idea of Kubernetes is to further abstract machines, storage, and networks away from their physical implementation. So it is a single interface to deploy containers to all kinds of clouds, virtual machines, and physical machines.

...

Kubernetes is an orchestration tool for containers. What are containers? They are small virtual machines that run ready-to-run applications on top of other virtual machines or any host OS. They greatly simplify deploying applications. And they make sure machines are fully-utilized. All of this lowers the cost of cloud subscriptions, further abstracts the data center, and simplifies operations and architecture.

Q2: What is a Container?
A: 
A container is a mini-virtual machine. It is small, as it does not have device drivers and all the other components of a regular virtual machine. Docker is by far the most popular container and it is written in Linux. Microsoft also has added containers to Windows as well, because they have become so popular.

Q3: What is Docker Hub?
A:
There are thousands of preconfigured Docker images at the Dockerhub public repository. There, people have taken the time to assemble opensource software configurations that might take someone else hours or days to put together. People benefit from that because they can install nginx or even far more complicated items simply by downloading them from there.

Q4: What is the need for Orchestration?
A:
There is an inherent problem with containers, that is the need to keep track of them. When public cloud companies bill a CPU time or storage then you need to make sure you do not have any orphaned machines spinning out there doing nothing. Plus there is the need to automatically spin up more when a machine needs more memory, CPU, or storage, as well as shut them down when the load lightens.
Orchestration tackles these problems. This is where Kubernetes comes in.

Q5: What are Pods?
A:
A pod is a one or more containers that logically go together. Pods run on nodes. Pods run together as a logical unit. So they have the same shared content. They all share the share IP address but can reach other other via localhost. And they can share storage. But they do not need to all run on the same machine as containers can span more than one machine. One node can run multiple pods.

Q6: What is a Deployment?
A:
A set of pods is a deployment. A deployment ensures that a sufficient number of pods are running at one time to service the app and shuts down those pods that are not needed. It can do this by looking at, for example, CPU utilization.

No comments:

Post a Comment