问题描述

用helm安装微服务包时出现以下错误提示

1
2
3
4
5
6
$helm version
Client: &version.Version{SemVer:"v2.7.2", GitCommit:"8478fb4fc723885b155c924d1c8c410b7a9444e6", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.7.2", GitCommit:"8478fb4fc723885b155c924d1c8c410b7a9444e6", GitTreeState:"clean"}

$helm install stable/nginx-lego
Error: User "system:serviceaccount:kube-system:default" cannot list configmaps in the namespace "kube-system". (get configmaps)

解决方法

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
$ kubectl delete deployment tiller-deploy --namespace=kube-system
deployment "tiller-deploy" deleted
$rm -rf ~/.helm
$vi helm.yml
apiVersion: v1
kind: ServiceAccount
metadata:
name: helm
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: helm
namespace: kube-system
$ kubectl create -f helm.yml
serviceaccount "helm" created
clusterrolebinding "helm" created

$helm init --service-account helm
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.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 /root/.helm.

$helm install stable/nginx-lego --name nginx-lego --set lego.configmap.email=xxx@qq.com
NAME: nginx-lego
LAST DEPLOYED: Mon Dec 18 10:51:02 2017
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
nginx-lego-nginx-lego 7 <invalid>

==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-lego-nginx-lego-default-backend ClusterIP 10.254.20.103 <none> 80/TCP <invalid>
nginx-lego-nginx-lego LoadBalancer 10.254.132.179 <pending> 80:30124/TCP,443:31209/TCP <invalid>

==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
nginx-lego-nginx-lego-default-backend 1 1 1 0 <invalid>
nginx-lego-nginx-lego 1 1 1 0 <invalid>

==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
nginx-lego-nginx-lego-default-backend-1577262746-0ds17 0/1 ContainerCreating 0 <invalid>
nginx-lego-nginx-lego-578830873-g8wfk 0/1 ContainerCreating 0 <invalid>


NOTES:
################################################################################
#### This chart has been deprecated as of version 0.2.1 and will not be updated.
#### Please use the nginx-ingress and (optional) kube-lego charts instead.
################################################################################

This chart runs an nginx-ingress-controller adding the ability to use ingress resources to route in your cluster.

EXAMPLE INGRESS YAML:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: foo
annotations:
# Add to route through the nginx service
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: www.example.com
http:
paths:
- backend:
serviceName: exampleService
servicePort: 80
path: /

参考文章

最后更新: 2023年08月27日 03:06

原始链接: https://blog.icanwen.com/2017/12/18/helm/