Skip to content

Release kubectl-hns plugin and a krew manifest. #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Release files
releases/
dist/

# Binaries for programs and plugins
*.exe
Expand Down
64 changes: 64 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,39 @@ builds:
- -a
ldflags:
- -s -w -X github.com/pfnet/hierarchical-namespaces/cmd.Version={{.Version}} -X github.com/pfnet/hierarchical-namespaces/cmd.Revision={{.ShortCommit}} -extldflags "-static"
- id: kubectl-hns
env:
- CGO_ENABLED=0
- GO111MODULE=on
main: ./cmd/kubectl/main.go
binary: kubectl-hns
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
flags:
- -a
ldflags:
- -s -w -X github.com/pfnet/hierarchical-namespaces/internal/version.Version={{.Version}} -extldflags "-static"

archives:
- id: manager
ids: # builds IDs
- manager
name_template: 'hnc-manager_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
- id: kubectl-hns
ids: # builds IDs
- kubectl-hns
name_template: 'kubectl-hns_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'

release:
extra_files:
- glob: "releases/hrq.yaml"
- glob: "dist/krew/hns.yaml"
name_template: 'kubectl-hns_{{ .Version }}.krew.yaml'

dockers:
- image_templates: ["ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}-amd64"]
Expand Down Expand Up @@ -61,3 +91,37 @@ docker_manifests:
image_templates:
- ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}-arm64v8

krews:
- name: hns
ids: # archives IDs
- kubectl-hns
short_description: Manage hierarchical namespaces (part of HNC)
skip_upload: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting appears to skip uploading to the krew-index repo rather than skipping uploading as release artifacts. Since it is acceptable to upload as release artifacts, it seems that this setting can be deleted.

Suggested change
skip_upload: true

description: |
Manipulates hierarchical namespaces provided by the Hierarchical Namespace
Controller (HNC).

HNC allows you to arrange your namespaces into hierarchies, which enables
two key benefits:
* Owners of parent namespaces can create policies that are enforced on
all descendant namespaces.
* Users without cluster-level permissions to create namespaces can create
restricted "subnamespaces" instead.

HNC is controlled via regular Kubernetes objects, but this plugin makes it
easy to create subnamespaces, arrange regular (full) namespaces into
hierarchies, and configure HNC to propagate different kinds of objects.
caveats: |
This plugin works best if you have the most recent minor version of HNC on
your cluster. Get the latest version of HNC, as well as prior versions of
this plugin, at:

https://github.com/pfnet/hierarchical-namespaces

Watch out for the following common misconceptions when using HNC:

* Not all child namespaces are subnamespaces!
* Only RBAC Roles and RoleBindings are propagated by default, but you can configure more.

The user guide contains much more information.