未加星标

Using Halyard To Deploy Spinnaker From Windows

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二04 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏

Those of us who work from windows laptops sometimes don’t the the same love when it comes to tooling that linux and macOS users receive. The Windows Subsystem for Linux has certainly helped a lot, but it isn’t perfect. A case in point is Halyard , the Linux tool designed to manage and deploy Spinnaker . While it could probably be run on WSL, I personally chose a different approach because of the need to use Kubernetes credentials from my Windows profile folder. Also, I just don’t like installing things on my computer when Docker can serve instead.

Prerequisites Docker for Windows Share your drives with Docker Register the Module

To make the use of Halyard more transparent, I’ve created a PowerShell module which makes the use of Halyard from Windows largely transparent. The https://www.powershellgallery.com/packages/SpinnakerHalyard module is available for installation from the PowerShell Gallery.

# Install the module, you just need to do this once Install-Module SpinnakerHalyard -Scope CurrentUser # Import the module into your Powershell session Import-Module SpinnakerHalyard Startup Halyard

Halyard functions using a background service that must be running, and the “hal” command communicates with that service. To that end, the next step is to startup Halyard.

There are some useful tools missing from the image, such as Vim, so these will be installed during the startup process.

PS > Start-Halyard Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB] Ign:2 http://deb.debian.org/debian stretch InRelease Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB] Get:4 http://deb.debian.org/debian stretch Release [118 kB] Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [414 kB] Lots more fun stuff I'm skipping here... Id Name -- ---- 3e1dac1690f5e905641b8f4c691fe5b37d360d630674928ac0e51e0b011a0725 halyard

This will start the Halyard service and leave it ready to execute commands. Optionally, the -Pull argument can be used to ensure that Docker has downloaded the latest version of Halyard, or -Version can select a specific version from the Docker registry .

Run Commands!

At this point, hal commands can be run freely, including copying and pasting from examples.

PS> hal config version edit --version 1.9.3 + Get current deployment Success + Edit Spinnaker version Success + Spinnaker has been configured to update/install version "1.9.3". Deploy this version of Spinnaker with `hal deploy apply`. PS> hal deploy apply But What About Editing Files?

Running hal commands works great for most basic configuration, but a lot of more advanced configuration involves manually editing configuration files.

PS > Connect-Halyard spinnaker@85057be1061c:~/.hal$ cd default/profiles spinnaker@85057be1061c:~/.hal/default/profiles$ vim gate-local.yml spinnaker@85057be1061c:~/.hal/default/profiles$ exit exit

The Connect-Halyard command will open a bash prompt within the Halyard container, allowing access to files with Vim.

Want to script commands inside the container? Connect-Halyard has that power, too! Non-zero exit codes will be converted to PowerShell exceptions.

PS > Connect-Halyard mv default/service-settings/gate.yml default/service-settings/gate.bak Backing Up Halyard Configuration

Halyard configuration is persisted using a Docker volume named halyard . However, there is always the risk that the volume may be lost. It’s therefore advisable to regularly backup the Halyard configuration.

Normally, backups are performed using hal backup create . However, when working using the PowerShell module the Backup-Halyard command is recommended.

PS > Backup-Halyard - Create backup + Create backup Success + Successfully created a backup at location: /home/spinnaker/halbackup-Fri_Sep_14_19-21-56_UTC_2018.tar

Backups will be found in the .halbackups folder of your user profile. They may be restored later using the Restore-Halyard command.

PS > Restore-Halyard ${HOME}\.halbackups\halbackup-Fri_Sep_07_14-13-34_UTC_2018.tar Stopping The Service

When not in use, the Halyard service can be shutdown.

PS > Stop-Halyard Conclusion

As an added bonus for users like me who prefer Docker images to installing software, this should work for Linux/macOS users as well. Just install PowerShell Core!

Also, check out the https://github.com/brantburnett/halyard-powershell . Enjoy Halyarding your Spinnaker!

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

tags: Halyard,debian,PS,hal,gt,version,Docker,Spinnaker
分页:12
转载请注明
本文标题:Using Halyard To Deploy Spinnaker From Windows
本站链接:https://www.codesec.net/view/597107.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(11)