Skip to content

Commit a7a2923

Browse files
authored
Release kubectl-hns plugin and a krew manifest. (#22)
1 parent 1c7def2 commit a7a2923

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Release files
22
releases/
3+
dist/
34

45
# Binaries for programs and plugins
56
*.exe

.goreleaser.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,39 @@ builds:
2020
- -a
2121
ldflags:
2222
- -s -w -X github.com/pfnet/hierarchical-namespaces/cmd.Version={{.Version}} -X github.com/pfnet/hierarchical-namespaces/cmd.Revision={{.ShortCommit}} -extldflags "-static"
23+
- id: kubectl-hns
24+
env:
25+
- CGO_ENABLED=0
26+
- GO111MODULE=on
27+
main: ./cmd/kubectl/main.go
28+
binary: kubectl-hns
29+
goos:
30+
- linux
31+
- darwin
32+
- windows
33+
goarch:
34+
- amd64
35+
- arm64
36+
flags:
37+
- -a
38+
ldflags:
39+
- -s -w -X github.com/pfnet/hierarchical-namespaces/internal/version.Version={{.Version}} -extldflags "-static"
40+
41+
archives:
42+
- id: manager
43+
ids: # builds IDs
44+
- manager
45+
name_template: 'hnc-manager_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
46+
- id: kubectl-hns
47+
ids: # builds IDs
48+
- kubectl-hns
49+
name_template: 'kubectl-hns_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
50+
2351
release:
2452
extra_files:
2553
- glob: "releases/hrq.yaml"
54+
- glob: "dist/krew/hns.yaml"
55+
name_template: 'kubectl-hns_{{ .Version }}.krew.yaml'
2656

2757
dockers:
2858
- image_templates: ["ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}-amd64"]
@@ -61,3 +91,37 @@ docker_manifests:
6191
image_templates:
6292
- ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}-amd64
6393
- ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}-arm64v8
94+
95+
krews:
96+
- name: hns
97+
ids: # archives IDs
98+
- kubectl-hns
99+
short_description: Manage hierarchical namespaces (part of HNC)
100+
skip_upload: true
101+
description: |
102+
Manipulates hierarchical namespaces provided by the Hierarchical Namespace
103+
Controller (HNC).
104+
105+
HNC allows you to arrange your namespaces into hierarchies, which enables
106+
two key benefits:
107+
* Owners of parent namespaces can create policies that are enforced on
108+
all descendant namespaces.
109+
* Users without cluster-level permissions to create namespaces can create
110+
restricted "subnamespaces" instead.
111+
112+
HNC is controlled via regular Kubernetes objects, but this plugin makes it
113+
easy to create subnamespaces, arrange regular (full) namespaces into
114+
hierarchies, and configure HNC to propagate different kinds of objects.
115+
caveats: |
116+
This plugin works best if you have the most recent minor version of HNC on
117+
your cluster. Get the latest version of HNC, as well as prior versions of
118+
this plugin, at:
119+
120+
https://github.com/pfnet/hierarchical-namespaces
121+
122+
Watch out for the following common misconceptions when using HNC:
123+
124+
* Not all child namespaces are subnamespaces!
125+
* Only RBAC Roles and RoleBindings are propagated by default, but you can configure more.
126+
127+
The user guide contains much more information.

0 commit comments

Comments
 (0)