Kubernetes Ingress

1)HelmClient 客户端:可以通过二进制文件或脚本方式安装。

通过二进制文件方式安装,需要从 https://github.com/kubernetes/helm/releases 下载二进制文件,解压并复制到执行目录即可。

通过脚本方式安装,执行下方脚本即可:

$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get  bash

2)TilerServer 的安装

对 TillerServer 的安装可以使用 helm init 命令进行(官方推荐),这一命令会在 kubectl 当前 context 指定集群内的 kube-system 命名空间创建一个 Deployment 和 一个 Service,运行 TillerService 服务。

Deployment 中使用的景象是 gcr.io/kubernetes-helm/tiller:v[helm-version],Helm 版本可以使用 helm version 命令获得。如果环境无法连接互联网获取该镜像,则可以先通过一台能够联网的服务器下载这个镜像保存到镜像仓库,利用 helm init 子命令的 --tiller-image 参数来指定镜像仓库中的镜像来执行初始化过程。

安装结束之后,用 helm version 命令来验证安装情况,一切正常的话,会分别显示 Tiler 和 Helm 的版本信息。一个常见的问题是,Tiler 部分显示一个错误信息:“uid:unable to do port forwarding:socat not found”,这是因为所在节点没有 socat,无法进行端口转发造成的,在主机上安装 socat 软件即可。

对 TilerServer 的安装还可以在本地进行,在服务器本地直接运行 Tiller,这种安装方式需要让 Helm 指定要连接的服务地址,有以下两种方式。

需要注意的是,Tiller 仍会使用 kubectl 配置中的 context 连接 Kubernetes 集群。

MacOS 执行结果如下:

$ helm init

Creating /Users/shilei/.helm/repository/repositories.yaml

Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com

Adding local repo with URL: http://127.0.0.1:8879/charts

$HELM_HOME has been configured at /Users/shilei/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Happy Helming!

或者指定服务器名称

$ helm init --service-account tiller

使用其他镜像可以执行此命令:

$ helm init --upgrade -i registry.aliyuncs.com/slzcc/tiller:v2.8.1

$HELM_HOME has been configured at /Users/shilei/.helm.

Tiller (the Helm server-side component) has been upgraded to the current version.

Happy Helming!

正常状态:

$ helm version

Client: &version.Version{SemVer:"v2.8.1", GitCommit:"6af75a8fd72e2aa18a2b278cfe5c7a1c5feca7f2", GitTreeState:"clean"}

Server: &version.Version{SemVer:"v2.8.1", GitCommit:"6af75a8fd72e2aa18a2b278cfe5c7a1c5feca7f2", GitTreeState:"clean"}

Helm 使用

下面介绍 Helm 的常见用法,包括搜索 Chart、安装 Chart、自定义 Chart 配置、更新或回滚 Release、删除 Release、创建自定义 Chart、搭建私有仓库等。

Helm search 搜索可用的 Chart

Helm 初始化完成之后,默认配置为使用官方的 Kubernetes Chart 仓库。官方仓库包含大量的警告组织和持续维护的 Chart,这个仓库通常命名为 stable。

$ helm search

NAME                            CHART VERSION   APP VERSION     DESCRIPTION

stable/acs-engine-autoscaler    2.1.1           2.1.1           Scales worker nodes within agent pools

stable/aerospike                0.1.6           v3.14.1.2       A Helm chart for Aerospike in Kubernetes

stable/anchore-engine           0.1.3           0.1.6           Anchore container analysis and policy evaluatio...

stable/artifactory              7.0.1           5.8.3           Universal Repository Manager supporting all maj...

stable/aws-cluster-autoscaler   0.3.2                           Scales worker nodes within autoscaling groups.

stable/buildkite                0.2.1           3               Agent for Buildkite

...

在没有进行过滤的情况下,helm search 会显示所有可用 chart,可以使用参数进行过滤:

$ helm search mysql

NAME                            CHART VERSION   APP VERSION DESCRIPTION

stable/mysql                    0.3.4                       Fast, reliable, scalable, and easy to use open-...

stable/percona                  0.3.0                       free, fully compatible, enhanced, open source d...

stable/percona-xtradb-cluster   0.0.1           5.7.19      free, fully compatible, enhanced, open source d...

stable/gcloud-sqlproxy          0.2.3                       Google Cloud SQL Proxy

stable/mariadb                  2.1.4           10.1.31     Fast, reliable, scalable, and easy to use open-...

为什么列表会有 MariaDB?因为 MariaDB 的描述信息中包含了 mysql 关键字。可以使用命令查看 Chart 的详细信息:

$ helm inspect stable/mariadb

appVersion: 10.1.31

description: Fast, reliable, scalable, and easy to use open-source relational database

  system. MariaDB Server is intended for mission-critical, heavy-load production systems

  as well as for embedding into mass-deployed software.

engine: gotpl

home: https://mariadb.org

icon: https://bitnami.com/assets/stacks/mariadb/img/mariadb-stack-220x234.png

keywords:

- mariadb

- mysql

- database

- sql

- prometheus

maintainers:

- email: containers@bitnami.com

  name: bitnami-bot

name: mariadb

sources:

- https://github.com/bitnami/bitnami-docker-mariadb

- https://github.com/prometheus/mysqld_exporter

version: 2.1.4

---

## Bitnami MariaDB image version

## ref: Docker Hub

##

## Default: none

image: bitnami/mariadb:10.1.31-r0

## Specify an imagePullPolicy (Required)

## It's recommended to change this to 'Always' if the image tag is 'latest'

## ref: Images | Kubernetes

imagePullPolicy: IfNotPresent

## Use password authentication

usePassword: true

## Specify password for root user

## Defaults to a random 10-character alphanumeric string if not set and usePassword is true

## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#setting-the-root-password-on-first-run

##

# mariadbRootPassword:

## Create a database user

## Password defaults to a random 10-character alphanumeric string if not set and usePassword is true

## ref: 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值