真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

harbor基于http和https的創(chuàng)建與使用-創(chuàng)新互聯(lián)

一·http方式

 harbor項(xiàng)目現(xiàn)托管在github上面,在此處以harbor v1.7.5為例演示。
  1·將harbor的二進(jìn)制包下載到/usr/local/src目錄下
  2·解壓縮 tar xvf harbor.v.1.7.5.tar
  3·進(jìn)如到解壓harbor目錄中,修改harbor.cfg文件

10余年的柳江網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營(yíng)銷型網(wǎng)站的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整柳江建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)從事“柳江網(wǎng)站設(shè)計(jì)”,“柳江網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
 1 ## Configuration file of Harbor
  2 
  3 #This attribute is for migrator to detect the version of the .cfg fil    e, DO NOT MODIFY!
  4 _version = 1.7.0
  5 #The IP address or hostname to access admin UI and registry service.
  6 #DO NOT use localhost or 127.0.0.1, because Harbor needs to be access    ed by external clients.
  7 #DO NOT comment out this line, modify the value of "hostname" directl    y, or the installation will fail.
  8 hostname = 192.168.238.7
  9 
 10 #The protocol for accessing the UI and token/notification service, by     default it is http.
 11 #It can be set to https if ssl is enabled on nginx.
 12 ui_url_protocol = http
 13 
 14 #Maximum number of job workers in job service  
 15 max_job_workers = 10 
 ...
 58 email_server = smtp.mydomain.com
 59 email_server_port = 25
 60 email_username = sample_admin@mydomain.com
 61 email_password = abc
 62 email_from = admin 
 63 email_ssl = false
 64 email_insecure = false
 65 
 66 ##The initial password of Harbor admin, only works for the first time     when Harbor starts. 
 67 #It has no effect after the first launch of Harbor.
 68 #Change the admin password from UI after launching Harbor.
 69 harbor_admin_password = 123456

  主要修改hostname和adminpasswd。
  4·查看install.sh文件,查看安裝harbor所需環(huán)境

#!/bin/bash

#docker version: 1.11.2 
#docker-compose version: 1.7.1 
#Harbor version: 0.4.0

  此為最低版本要求,docker的安裝可以在阿里鏡像站按照步驟一步步安裝,但是docker-compose若是要安裝最新版本就需要下載python-pip一個(gè)類似yum或apt的工具,然后在使用pip install docker-compose安裝即可
  5·運(yùn)行install.sh腳本安裝,至此,安裝完成

  • 我們上傳的鏡像會(huì)存放在宿主機(jī)的docker/registry/v2/repositories/
  • 需要上傳和下載harbor鏡像的docker服務(wù)器需要在docker的啟動(dòng)腳本中添加信任不可靠的鏡像原
    vim /lib/systemd/system/docker.service
    ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry 192.168.238.12(harbor地址)
    • 重啟docker
    • 上傳鏡像時(shí)首先要登陸到harbor服務(wù)器
      docker login 192.168.238.7
      輸入賬號(hào)為admin密碼為harbor.cfg中所配置密碼登陸成功,然后對(duì)制作的鏡像重新打tag,例如
      tag nginx:laste 192.168.238.7/NGINX/nginx:5.2
      其中NGINX必須要有這個(gè)項(xiàng)目方可上傳
    • 在網(wǎng)頁(yè)打開192.168.238.7,輸入賬號(hào)密碼,創(chuàng)建NGINX項(xiàng)目
    • docker push 192.168.238.7/NGINX/nginx:5.2

        2·實(shí)現(xiàn)高可用的harbor

          1·配置同上新建一個(gè)harbor服務(wù)
          2·在docker的啟動(dòng)腳本中加上兩個(gè)harbor服務(wù)器的地址
          3·在主harbor服務(wù)器的網(wǎng)頁(yè)上做如下操作

      按照提示一步步添加另一臺(tái)harbor

二·https方式

 1·如上http方式部署。只是不用在docker的啟動(dòng)腳本中添加受信任的地址
 2.在harbor的安裝目錄下創(chuàng)建一個(gè)certs目錄
mkdir certs
 3·生成私鑰和公鑰(注:公鑰的地址要與harbor.cfg中的hostname相同)
openssl genrsa -out harbor-ca.key
touch /root/.rnd
openssl req -x509 -new -nodes -key harbor-ca.key -subj "/CN=harbor.magedu.net" -days 7120 -out harbor-ca.crt
 4·修改harbor.cfg配置文件

  1 ## Configuration file of Harbor
  2 
  3 #This attribute is for migrator to detect the version of the .cfg fil    e, DO NOT MODIFY!
  4 _version = 1.7.0
  5 #The IP address or hostname to access admin UI and registry service.
  6 #DO NOT use localhost or 127.0.0.1, because Harbor needs to be access    ed by external clients.
  7 #DO NOT comment out this line, modify the value of "hostname" directl    y, or the installation will fail.
  8 hostname = harbor.magedu.net
  9 
 10 #The protocol for accessing the UI and token/notification service, by     default it is http.
 11 #It can be set to https if ssl is enabled on nginx.
 12 ui_url_protocol = https
13 
 14 #Maximum number of job workers in job service  
 15 max_job_workers = 10 
 16 
 17 #Determine whether or not to generate certificate for the registry's     token.
 18 #If the value is on, the prepare script creates new root cert and pri    vate key 
 19 #for generating token to access the registry. If the value is off the     default key/cert will be used.
 20 #This flag also controls the creation of the notary signer's cert.
 21 customize_crt = on
 22 
 23 #The path of cert and key files for nginx, they are applied only the     protocol is set to https
 24 ssl_cert = /usr/local/src/harbor/certs/harbor-ca.crt
 25 ssl_cert_key = /usr/local/src/harbor/certs/harbor-ca.key
 26 
 *67 #It has no effect after the first launch of Harbor.
 68 #Change the admin password from UI after launching Harbor.
 69 harbor_admin_password = 123456
*

這個(gè)域名要有dns解析或者是hosts文件
 5·docker客戶端分發(fā)公鑰
mkdir -p /etc/docker/certs.d/(harbor.cfg中的hostname)
將harbor的公鑰拷貝過(guò)來(lái) /etc/docker/certs.d/(harbor.cfg中的hostname)重啟docker即可

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。


名稱欄目:harbor基于http和https的創(chuàng)建與使用-創(chuàng)新互聯(lián)
網(wǎng)站URL:http://weahome.cn/article/dsgeid.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部