OpenShift helm的安装

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  :

猜你喜欢

转载自www.cnblogs.com/ericnie/p/9781281.html
今日推荐