This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- To align with hello example plugin, restruct and add missing part - Add admin plugin maintainer in OWNERS
- Loading branch information
Gong Zhang
committed
Apr 19, 2020
1 parent
b01f0ad
commit 47f710a
Showing
1,772 changed files
with
34,257 additions
and
3,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ approvers: | |
- rhuss | ||
- maximilien | ||
- navidshaikh | ||
- zhanggbj | ||
# TOC members as a fallback | ||
- mattmoor | ||
- evankanderson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
## kn-admin | ||
|
||
A kn plugin for Knative cluster management. | ||
|
||
`kn hello` prints out a friendly message to the user. | ||
|
||
### Description | ||
|
||
This kn-admin plugin is designed to help administrators and operators better manage a Knative platform installation with kn CLI. | ||
The plugin’s main objective is to make administration and operation workflows easier, for instance by making it easy to accomplish | ||
tasks such as feature flags enablement or disablement with one command, instead of many manual steps like modifying ConfigMaps or yaml files. | ||
|
||
### Usage | ||
|
||
---- | ||
A plugin of kn client to manage Knative for administrators. | ||
For example: | ||
kn admin domain set - to set Knative route domain | ||
kn admin private-registry enable - to enable deployment from the private registry | ||
Usage: | ||
kn admin [command] | ||
Available Commands: | ||
domain Manage route domain | ||
help Help about any command | ||
private-registry Manage private-registry | ||
Flags: | ||
--config string config file (default is $HOME/.config/kn/plugins/kn-admin.yaml) | ||
-h, --help help for admin | ||
-t, --toggle Help message for toggle | ||
Use "admin [command] --help" for more information about a command. | ||
---- | ||
|
||
#### `kn admin domain` | ||
|
||
---- | ||
Set default route domain or route domain for Service with selectors. For example: | ||
kn admin domain set - to set Knative route domain | ||
Usage: | ||
kn admin domain [flags] | ||
kn admin domain [command] | ||
Available Commands: | ||
set set route domain | ||
Flags: | ||
-h, --help help for domain | ||
Global Flags: | ||
--config string config file (default is $HOME/.config/kn/plugins/admin.yaml) | ||
Use "admin domain [command] --help" for more information about a command. | ||
---- | ||
|
||
#### `kn admin private-registry` | ||
|
||
---- | ||
Manage Service deployment from a private registry | ||
For example: | ||
kn admin private-registry enable \ | ||
--secret-name=[SECRET_NAME] | ||
--docker-server=[PRIVATE_REGISTRY_SERVER_URL] \ | ||
--docker-email=[PRIVATE_REGISTRY_EMAIL] \ | ||
--docker-username=[PRIVATE_REGISTRY_USER] \ | ||
--docker-password=[PRIVATE_REGISTRY_PASSWORD] | ||
Usage: | ||
kn admin private-registry [command] | ||
Available Commands: | ||
enable enable Service deployment from a private registry | ||
Flags: | ||
-h, --help help for private-registry | ||
Global Flags: | ||
--config string config file (default is $HOME/.config/kn/plugins/admin.yaml) | ||
Use "admin private-registry [command] --help" for more information about a command. | ||
---- | ||
|
||
### Examples | ||
|
||
#### As a Knative administrator, I want to update Knative route domain with my custom domain. | ||
|
||
|
||
.Update the default route domain if --selector no specified | ||
==== | ||
---- | ||
$ kn admin domain set --custom-domain mydomain.com | ||
Updated Knative route domain mydomain.com | ||
---- | ||
==== | ||
|
||
.Update a custom domain with --selector and Service with a label app=v1 will use test.com | ||
==== | ||
---- | ||
$ kn admin domain set --custom-domain test.com --selector app=v1 | ||
Updated Knative route domain test.com | ||
---- | ||
==== | ||
|
||
#### As a Knative administrator, I want to enable deploying from private registry. | ||
|
||
.Enable a private registry with given credentials for Service creation | ||
===== | ||
----- | ||
$ kn admin private-registry enable \ | ||
--secret-name=[SECRET_NAME] | ||
--docker-server=[PRIVATE_REGISTRY_SERVER_URL] \ | ||
--docker-email=[PRIVATE_REGISTRY_EMAIL] \ | ||
--docker-username=[PRIVATE_REGISTRY_USER] \ | ||
--docker-password=[PRIVATE_REGISTRY_PASSWORD] | ||
----- | ||
===== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright © 2020 The Knative Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"knative.dev/client-contrib/plugins/admin/core" | ||
) | ||
|
||
func main() { | ||
if err := core.NewAdminCommand().Execute(); err != nil { | ||
fmt.Println("failed to execute admin command:", err) | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module knative.dev/client-contrib/plugins/admin | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/google/go-cmp v0.3.1 // indirect | ||
github.com/googleapis/gnostic v0.2.2 // indirect | ||
github.com/imdario/mergo v0.3.8 // indirect | ||
github.com/mitchellh/go-homedir v1.1.0 | ||
github.com/pkg/errors v0.8.1 // indirect | ||
github.com/spf13/cobra v0.0.5 | ||
github.com/spf13/viper v1.6.2 | ||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect | ||
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect | ||
google.golang.org/appengine v1.6.2 // indirect | ||
gotest.tools v2.2.0+incompatible | ||
k8s.io/api v0.17.3 | ||
k8s.io/apimachinery v0.17.3 | ||
k8s.io/client-go v0.17.0 | ||
k8s.io/utils v0.0.0-20200124190032-861946025e34 // indirect | ||
) |
Oops, something went wrong.