0%

k8s-Cluster Maintenance

OS Upgrades

For example,you have a cluster with a few nodes and pods serving applications.If one of these nodes go down,the pods on that node are not accessible.

If the node came back online immediately,then the kubectl process starts and the pods come back.However,if the node was down for more than 5 mins,then the pods are terminated from that node.

Read more »

Working with ETCDCTL

etcdctl is a command line client for etcd.

In all our Kubernetes Hands-on labs, the ETCD key-value database is deployed as a static pod on the master. The version used is v3.

To make use of etcdctl for tasks such as back up and restore, make sure that you set the ETCDCTL_API to 3.

You can do this by exporting the variable ETCDCTL_API prior to using the etcdctl client. This can be done as follows:

1
export ETCDCTL_API=3
Read more »

Kubernetes の基礎

Kubernetes は、Kubernetes Master と Kubernetes Node の 2 種類のノードから成り立っています。

CLI ツールのkubectl はマニフェストファイル(.yaml,.yml,.json)の情報を元にKubernetes Master が持つ API にリクエストを送ることで Kubernetes を操作します。

また、Kubernetes Master の API は、一般的な RESTful API として実装されているので、各種プログラム言語の RESTful API ライブラリや curl などのコマンドラインツールを利用して、直接 API を呼び出して Kubernetes を操作することも可能です。

Read more »

kind(Kubernetes in Docker)

kindの仕組み:

Docker コンテナを複数個起動し、そのコンテナを Kubernetes Node として利用することで、複数台構成の Kubernetes クラスタを構築します。

kindのインストール

1
2
3
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind
Read more »

Go Context

《Go语言实战》读书笔记,未完待续,欢迎扫码关注公众号flysnow_org或者网站http://www.flysnow.org/,第一时间看后续笔记。觉得有帮助的话,顺手分享到朋友圈吧,感谢支持。

控制并发有两种经典的方式,一种是WaitGroup,另外一种就是Context,今天我就谈谈Context。

什么是WaitGroup

WaitGroup以前我们在并发的时候介绍过,它是一种控制并发的方式,它的这种方式是控制多个goroutine同时完成。

Read more »

Imperative vs Declarative

Certification Tips - Imperative Commands with Kubectl

While you would be working mostly the declarative(声明式) way - using definition files, imperative(命令式) commands can help in getting one time tasks done quickly, as well as generate a definition template easily. This would help save a considerable amount of time during your exams.

Before we begin, familiarize with the two options that can come in handy while working with the below commands:

Read more »

ETCD - Commands (Optional)

(Optional) Additional information about ETCDCTL Utility

ETCDCTL is the CLI tool used to interact with(与…相互作用) ETCD.

ETCDCTL can interact with ETCD Server using 2 API versions - Version 2 and Version 3. By default its set to use Version 2. Each version has different sets of commands.

Read more »

Microservices Architecture

Example

首先创建Pod

  • 投票app 的pod

    voting-app-pod.yaml

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    apiVersion: v1
    kind: Pod
    metadata:
    name: voting-app-pod #pod name
    labels:
    name: voting-app-pod
    app: demo-voting-app
    spec:
    containers:
    - name: voting-app #container name
    image: kodekloud/examplevotingapp_vote:v1
    ports:
    - containerPort: 80 #the port on which the application listens for this voting app

    我们需要用containerPort属性为voting application明确指定port

    Read more »

Service

Services Types

  • NodePort
  • ClusterIP: the service create a virtual IP inside the cluster enable communication between different services such as a set of frontend services and a set of backend services.
  • LoadBalancer
Read more »