一、新特性
1. 產品延續了1.0.0已有的功能,增加了最大頭的功能便是"訪問K8s-POD終端"功能,同時遷移FreeRDP至2.0。(傳送門:http://guacamole.apache.org/releases/1.1.0/)
相信以后對Win的支持會更好,新增加K8的支持,也是應了現在的普遍需求。
二、場景驗證
1. Guaca對K8s-POD終端遠程的效果
三、基礎架構說明 (官方傳送門: http://guacamole.apache.org/doc/gug/guacamole-architecture.html#guacamole-protocol-architecture)
四、 Guacamole部署
1) 基於容器部署Guaca, 官方三件套:
- Guacamole https://hub.docker.com/r/guacamole/guacamole
- Guacd https://hub.docker.com/r/guacamole/guacd
- Postgres https://hub.docker.com/_/postgres
2) 安裝循序, Guacamole需要依賴前兩者
Guacd --> Postgres --> Guacamole
3) Guacd安裝
docker run --name some-guacd -d -p 4822:4822 guacamole/guacd
解釋:
run 啟動一個容器
--name 容器名稱,可以通過docker ps 查看已經啟動的容器
-d 采用后台模式運行
-p 端口映射,Guacd本身的端口4822, 映射到服務器上我們也采用4822; 前者是服務器端口, 后者是Guacd服務端口。
guacamole/guacd 默認從dockerhub的guacamole拉取guacd服務,最后可以跟版本,什么都不寫就是latest。
這里的latest版本就是1.1.0, 如圖:
4) Postgres安裝
docker run --name some-postgres -e POSTGRES_PASSWORD=guaca123 -d postgres
啟動一個名字為"some-postgres"的Postgres容器。
5) 初始化Guacamole表結構至Postgres
通過docker ps 先獲取Postgres容器的ID, docker ps | grep post
然后從Guacamole容器中拉一份Postgres用的initdb.sql
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > initdb.sql
解釋:
--rm 鏡像用完之后直接銷毀。
這時候當前目錄會生產出一份 initdb.sql的文件,將他拷貝至Postgres容器的根目錄下:
docker cp initdb.sql 0650b8ece837:/
現在進入Postgres容器終端:
docker exec -it 0650b8ece837 /bin/bash
su - postgres
psql
create database guacamole_db; # 創建guacamole_db數據庫
create user guacamole_user with password 'some_password'; # 創建guacamole_user用戶
grant all privileges on database guacamole_db to guacamole_user; # 將guacamole_db的最大權限給guacamole_user一份
\q # 退出數據庫
-------------------------------------------------------------------------------------------
psql -d guacamole_db -U guacamole_user -f initdb.sql # 導入數據至guacamole_db數據庫
解釋:
-d 數據庫名稱
-U 用戶名稱
-f 要導入的SQL文件
6) Guacamole安裝
docker run --name some-guacamole --link some-guacd:guacd \
--link some-postgres:postgres \
-e POSTGRES_DATABASE=guacamole_db \
-e POSTGRES_USER=guacamole_user \
-e POSTGRES_PASSWORD=some_password \
-d -p 8989:8080 guacamole/guacamole
解釋:
--link 用來關聯guacd和Postgres兩個容器
-e 配置參數需要與剛剛創建Postgres的信息對應上
等待安裝過程就好,最后會得到三個容器
7) 訪問Guacamole
http://xxx.xxx.xxx.xxx:8989/guacamole
默認用戶名, 密碼: guacadmin