kubernetes 包管理器 helm

helm

(https://helm.sh/docs/intro/quickstart/)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
wget https://get.helm.sh/helm-v3.6.0-linux-amd64.tar.gz

# https://artifacthub.io/packages/helm/keyporttech/gogs#installing-the-chart
[root@master ~]# helm search hub gogs
URL CHART VERSION APP VERSION DESCRIPTION
https://artifacthub.io/packages/helm/mhio/gogs 0.9.2 0.12.3 Gogs: Go Git Service
https://artifacthub.io/packages/helm/keyporttech/gogs 0.1.3 0.12.3 Gogs is a painless self-hosted Git service
[root@master ~]# kubectl create namespace gogs
namespace/gogs created
[root@master ~]# helm install gogs --namespace gogs keyporttech/gogs
NAME: gogs
LAST DEPLOYED: Mon Jun 14 21:45:32 2021
NAMESPACE: gogs
STATUS: deployed
REVISION: 1
NOTES:
1. Connect to your Gogs web URL by running:

export POD_NAME=$(kubectl get pods --namespace gogs -l "app=gogs-gogs" -o jsonpath="{.items[0].metadata.name}")

kubectl port-forward $POD_NAME 8080:3000
echo http://127.0.0.1:8080/

2. Connect to your Gogs ssh port:

export POD_NAME=$(kubectl get pods --namespace gogs -l "app=gogs-gogs" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 8022:22
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8022:22

[root@master ~]# kubectl get pods --namespace gogs -l "app=gogs-gogs" -o jsonpath="{.items[0].metadata.name}"
gogs-gogs-54bcf8fc54-h8bbx
[root@master ~]# kubectl port-forward gogs-gogs-54bcf8fc54-h8bbx -n gogs 8080:3000
Forwarding from 127.0.0.1:8080 -> 3000
Forwarding from [::1]:8080 -> 3000
[root@master ~]# kubectl port-forward gogs-gogs-54bcf8fc54-h8bbx -n gogs --address 0.0.0.0 8080:3000
Forwarding from 0.0.0.0:8080 -> 3000

浏览器访问http://192.168.1.2:8080

reference

Kubernetes1.18实践及踩坑(之六)部署Helm