日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

OpenShift helm的安装

發(fā)布時(shí)間:2023/12/18 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 OpenShift helm的安装 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.安裝過(guò)程

下載addons的代碼

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

因?yàn)閔elm的tiller要求訪問(wèn)gcr的地址,必然被墻,因此把地址替換成ericnie2017/tiller:latest 后建立

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.1echo "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-refreshecho "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 alreadye.g.helm init -cSearch for an application:e.g.helm searchAnd now deploy an applicatione.g.helm versionTo delete helm tilleroc delete sa/helm deployment/tiller-deploy svc/tiller -n kube-system --as=system:admin

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

?

2.客戶端安裝

設(shè)置環(huán)境變量

ericdeMacBook-Pro:~ ericnie$ export HELM_HOST="$(minishift ip):$(oc get svc/tiller -o jsonpath='{.spec.ports[0].nodePort}' -n kube-system --as=system:admin)" ericdeMacBook-Pro:~ ericnie$ export MINISHIFT_ADMIN_CONTEXT="default/$(oc config view -o jsonpath='{.contexts[?(@.name=="minishift")].context.cluster}')/system:admin" ericdeMacBook-Pro:~ ericnie$ echo $HELM_HOST 192.168.99.100:30417 ericdeMacBook-Pro:~ ericnie$ echo $MINISHIFT_ADMIN_CONTEXT default/192-168-99-100:8443/system:admin

下載helm客戶端

去到網(wǎng)址,找到對(duì)應(yīng)版本下載?

https://github.com/helm/helm/releases?after=v2.8.0

注意需要翻墻 :(

https://storage.googleapis.com/kubernetes-helm/helm-v2.8.1-darwin-amd64.tar.gz

下載然后解壓,加入.bash_profile

ericdeMacBook-Pro:~ ericnie$ cat .bash_profile export CLICOLOR=1 #export PATH=/Users/ericnie/minishift/minishift-1.24.0-darwin-amd64:/Users/ericnie/minishift:$PATH #export PATH="/Users/ericnie/.minishift/cache/oc/v3.10.0/darwin:$PATH"export PATH=/Users/ericnie/bin:$PATH export PATH="/Users/ericnie/.minishift/cache/oc/v3.9.31/darwin:/Users/ericnie/minishift/helm/darwin-amd64:$PATH"export MINISHIFT_USERNAME=eric.nie@163.com export MINISHIFT_PASSWORD=Welcome1$

?

ericdeMacBook-Pro:~ ericnie$ helm version Client: &version.Version{SemVer:"v2.8.1", GitCommit:"6af75a8fd72e2aa18a2b278cfe5c7a1c5feca7f2", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.8.1", GitCommit:"6af75a8fd72e2aa18a2b278cfe5c7a1c5feca7f2", GitTreeState:"clean"}

能連上server,會(huì)顯示server的版本

?

3.驗(yàn)證

helm create hello-svc

然后把deployment.yaml, service.yaml和values.yaml修改掉

ericdeMacBook-Pro:hello-svc ericnie$ cat templates/deployment.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata:name: {{.Values.deployment_name}} spec:replicas: {{.Values.replicas}}template:metadata:labels:tomcat-app: {{.Values.deployment_name}}version: "1"spec:containers:- name: {{.Values.deployment_name}}image: 172.30.1.1:5000/s2i-tomcat/openshift-tomcat:{{.Values.imageversion}}ports:- containerPort: {{.Values.port}}name: tomcatport

?

ericdeMacBook-Pro:hello-svc ericnie$ cat templates/service.yaml apiVersion: v1 kind: Service metadata:name: {{.Values.service_name}}labels:tomcat-app: hellotomcat spec:ports:- port: {{.Values.port}}protocol: TCPtargetPort: 8080name: httptype: NodePortselector:tomcat-app: hellotomcat

?

ericdeMacBook-Pro:hello-svc ericnie$ cat values.yaml replicas: 1 deployment_name: hellotomcat service_name: hellotomcat port: 8080 imageversion: latest

然后安裝

ericdeMacBook-Pro:hello-svc ericnie$ helm install ./ --namespace s2i-tomcat NAME: austere-mastiff LAST DEPLOYED: Sat Oct 13 11:12:06 2018 NAMESPACE: s2i-tomcat STATUS: DEPLOYEDRESOURCES: ==> v1/Service NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hellotomcat NodePort 172.30.214.212 <none> 8080:30982/TCP 1s==> v1beta1/Deployment NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE hellotomcat 1 0 0 0 0s

?

?

4.遇到的問(wèn)題

minishift ip無(wú)法出來(lái)

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

?之前遇到過(guò)幾次,每次狀況不一樣,這次重新啟動(dòng)以后就可以了。

?

轉(zhuǎn)載于:https://www.cnblogs.com/ericnie/p/9781281.html

總結(jié)

以上是生活随笔為你收集整理的OpenShift helm的安装的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。