We recently had the idea to create a VNC Desktop APB that would deploy a pod running VNC. The idea was that this might be useful for troubleshooting connectivity issues within the cluster by including a web browser along with the bind-utils and net-tools packages.
As with most APB's we've developed, there were several iterations before we ended up with something we were satisfied with sharing. The earliest version of the APB created a deployment config for a pod running a VNC server and an associated service. But this meant you had to manually configure a standard VNC viewer to connect to the pod. The service also wasn't accessible from outside of the cluster, which could make connecting to it difficult.
At this point, we decided it would be much easier to use if we had noVNC running so that we could connect to the VNC server by pointing a web browser at a route. Once we got noVNC working we realized we had something interesting. Whether troubleshooting, trying out different desktops, or maybe even setting up kiosks by launching multiple instances in different namespaces this APB shows some potential.
The Containers
With most APB's there are at least 2 containers to think about creating. The first is the application container that will run the service you want to deploy and the second is the APB container that will handle the logic for deploying the container. As mentioned this is how we started with the VNC APB. As we moved on we added a second VNC container using a different version of Fedora as the base and the noVNC container to make connecting easier, for a total of four containers.
The vnc-desktop Containers
Running VNC within a container actually proved to be very easy. By using the -fg
flag vncserver remains in the foreground. The remainder of the logic in the entry point script deals with arbitrary UID support and configuring the environment based on choices made by the user.
By changing just the FROM statement in the Dockerfile we were able to create containers for both Fedora 27 and Fedora 28.
The vnc-client Container
This container was very easy to create thanks to a launch script that was recently added to noVNC. Aside from installing dependency packages all we needed to do is clone the git repository, link the vnc.html file, and set the entry point to start the script.
RUN git clone https://github.com/novnc/novnc
RUN ln -sf /novnc/vnc.html /novnc/index.html
ENTRYPOINT /novnc/utils/launch.sh --vnc vnc-desktop:5901
The APB Container
The VNC Desktop APB is pretty standard. Right now we have included two plans, with each plan being tied to a version of Fedora.
One of the first questions that came up when developing the APB was which desktop to use. But since APB's make choices easy we decided to make several available. Right now we have nine options available and would like to add Gnome and Cinnamon if we can figure out how to get them running in a container.
As you might imagine users will also probably prefer one shell and initial resolution combination over others so we made multiple options available for each. Each of these parameters are passed into the container as environment variables on the vnc-desktop pod where they are acted on by the entry point script.
- name: de
title: Desktop Environment
type: enum
enum: ['fvwm', 'i3', 'KDE', 'LXDE', 'LXQt', 'MATE', 'Sugar', 'twm', 'Xfce']
default: 'Xfce'
updatable: true
- name: deshell
title: Shell
type: enum
enum: ['bash', 'csh', 'ksh', 'sh']
default: 'bash'
updatable: true
- name: resolution
title: Desktop Resolution
type: enum
enum: ['800x600', '1024x768', '1280x1024', '1360x768', '1440x900', '1920x1080']
default: '1360x768'
updatable: true
These parameters are exposed in the UI as drop downs where users can make their selections.
Connecting
Once choices are made and the APB completes provisioning you will be left with two pods and a route.
Clicking on the link will open a new window. When you press connect you'll be prompted for a password.
You should now have a VNC session running in your browser:
Updating Your Choices
You may have noticed in the snippet above that each of the parameters included a line, updatable: true
. We have also included the updates_to
option on each plan. By doing so users can now edit the provisioned service and switch between distributions and desktop environments, resolutions, and shell combinations at will until they find something that suits their needs. The YouTube demo linked below demonstrates this functionality.
YouTube
Code Links
VNC Desktop APB
https://github.com/fusor/dockerfiles/tree/master/vnc-desktop:f28
Fedora 27 Container
noVNC Container
저자 소개
유사한 검색 결과
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.