码迷,mamicode.com
首页 > 其他好文 > 详细

OpenShift helm的安装

时间:2018-10-13 02:40:27      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:过程   open   epo   local   图片   docke   min   iss   成功   

1.安装过程

下载addons的代码

$ git clone https://github.com/jorgemoralespou/minishift-addons
$ cd minishift-addons

因为helm的tiller要求访问gcr的地址,因此把地址替换成ericnie2017后建立

ericdeMacBook-Pro:helm ericnie$ cat helm.addon
# Name: helm
# Description: Installs helm

# Pull the image
echo "pull start"
docker pull lachlanevenson/k8s-helm:v2.8.1

echo "deploy start"
# Deploy helm
docker run --rm -v /home/docker:/root:z -v /var/lib/minishift/openshift.local.config:/var/lib/minishift/openshift.local.config:z --net=host --env KUBECONFIG=/var/lib/minishift/openshift.local.config/master/admin.kubeconfig --env HELM_HOST=localhost:8443 lachlanevenson/k8s-helm:v2.8.1 init --upgrade -i ericnie2017/tiller:latest  --skip-refresh

echo "deploy finish"

# Create serviceaccounts and add the permissions to it. Then make the deployment use it
oc create serviceaccount helm -n kube-system
oc patch deployment/tiller-deploy -p {"spec":{"template":{"spec":{"serviceAccountName":"helm"}}}} -n kube-system
oc adm policy add-cluster-role-to-user cluster-admin -z helm -n kube-system

# Expose helm as nodePort
oc expose deployment/tiller-deploy --target-port=tiller --type=NodePort --name=tiller -n kube-system

 

 

ericdeMacBook-Pro:add-ons ericnie$ minishift addons install helm
Addon helm installed
ericdeMacBook-Pro:add-ons ericnie$ minishift addons apply helm
-- Applying addon helm:
"pull start".
"deploy start".
"deploy finish"....
Add into your ~/.bashrc this lines:

  eval "$(minishift oc-env)"
  export HELM_HOST="$(minishift ip):$(oc get svc/tiller -o jsonpath=‘{.spec.ports[0].nodePort}‘ -n kube-system --as=system:admin)"
  export MINISHIFT_ADMIN_CONTEXT="default/$(oc config view -o jsonpath=‘{.contexts[?(@.name=="minishift")].context.cluster}‘)/system:admin"

Initialize the helm client, if not done already

e.g.
  helm init -c

Search for an application:

e.g.
  helm search

And now deploy an application

e.g.
  helm version

To delete helm tiller
  oc delete sa/helm deployment/tiller-deploy svc/tiller -n kube-system --as=system:admin

以admin:admin登录后看到tiller部署成功

技术分享图片

 

2.遇到问题

minishift ip无法出来

ricdeMacBook-Pro:helm ericnie$ minishift ip
Error getting IP: ssh command error:
command : ip addr show
err     : exit status 255
output  :

 

OpenShift helm的安装

标签:过程   open   epo   local   图片   docke   min   iss   成功   

原文地址:https://www.cnblogs.com/ericnie/p/9781281.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!