Skip to content

Commit

Permalink
Add cilium&Hubble supported (#378)
Browse files Browse the repository at this point in the history
Change-Id: Ib4a6b986be5ed3b0a9d0f6fe78f014098483aca6
  • Loading branch information
caoyingjunz authored Dec 31, 2023
1 parent e8d3326 commit fbfbb38
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Learn about Kubez Ansible by reading the documentation online [kubez-ansible](ht
- [Dashboard](docs/apply/dashboard.md)
- [Metrics Server](docs/apply/metrics.md)
- [MetalLB](docs/apply/metallb.md)
- [Cilium&Hubble](docs/apply/cilium.md)
- 日志监控
- [Loki](docs/apply/loki.md)
- [Grafana](docs/apply/grafana.md)
Expand Down
24 changes: 24 additions & 0 deletions ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ dashboard_namespace: "{{ kubez_namespace }}"
dashboard_vip_address: ""
dashboard_node_port: 30001

################
# Cilium Options
################
enable_cilium: "no"
cilium_chart_version: 1.14.5
cilium_namespace: kube-system

##########################
# Helm Chart Applications
##########################
Expand Down Expand Up @@ -469,6 +476,8 @@ enable_charts:
enabled: "{{ enable_fluentd | bool }}"
- name: chaos-mesh
enabled: "{{ enable_chaos_mesh | bool }}"
- name: cilium
enabled: "{{ enable_cilium | bool }}"

charts:
prometheus:
Expand Down Expand Up @@ -754,3 +763,18 @@ charts:
chaosDaemon.runtime: "{{ runtime }}"
chart_extra_flags:
- create-namespace

cilium:
name: cilium
namespace: "{{ cilium_namespace }}"
repository:
name: cilium
url: https://helm.cilium.io/
chart:
path: cilium/cilium
version: "{{ cilium_chart_version }}"
chart_extra_vars:
hubble.relay.enabled: 'true'
hubble.ui.enabled: 'true'
chart_extra_flags:
- reuse-values
37 changes: 37 additions & 0 deletions docs/apply/cilium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Cilium & Hubble

## 依赖条件

- 运行正常的 `kubernetes` ( v1.21+ )环境。安装手册参考 [高可用集群](https://github.com/gopixiu-io/kubez-ansible/blob/master/docs/install/multinode.md)[单节点集群](https://github.com/gopixiu-io/kubez-ansible/blob/master/docs/install/all-in-one.md)
- Linux kernel >= 4.9.17

## 开启 Cilium 组件

1. 编辑 `/etc/kubez/globals.yml`

2. 取消 `enable_cilium: "no"` 的注释,并设置为 `"yes"`,设置Cilium的版本 `cilium_chart_version: "1.16.1"`

```yaml
################
# Cilium Options
################
enable_cilium: "yes"
cilium_chart_version: "1.14.5"
```
3. 执行安装命令(根据实际情况选择)
```shell
# 单节点集群场景
kubez-ansible apply
# 高可用集群场景
kubez-ansible -i multinode apply
```

4. 部署完验证

```shell
[root@VM-16-11-centos ~]# kubectl get pods -n Cilium-system
NAME READY STATUS RESTARTS AGE
Ciliumd-5b86c45f48-mjzsd 1/1 Running 0 2m49s
```
9 changes: 9 additions & 0 deletions etc/kubez/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,12 @@ s3:
#chaos_mesh_namespace: "{{ kubez_namespace }}"
#socket_path: /var/run/docker.sock
#runtime: docker


################
# Cilium Options
################
# https://docs.cilium.io/en/stable/overview/intro/
#enable_cilium: "no"
#cilium_chart_version: 1.14.5
#cilium_namespace: kube-system

0 comments on commit fbfbb38

Please sign in to comment.