forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make naming of kubectl subcommands consistent
- Loading branch information
Sam Ghods
committed
Apr 2, 2015
1 parent
620af16
commit ca18e86
Showing
22 changed files
with
235 additions
and
48 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
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
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,57 @@ | ||
###How To | ||
For our example, Jenkins is set up to have one build step in bash: | ||
|
||
`Jenkins "Bash" build step` | ||
``` | ||
#!/bin/bash | ||
cd $WORKSPACE | ||
source bin/jenkins.sh | ||
source bin/kube-rolling.sh | ||
``` | ||
|
||
Our project's build script (`bin/jenkins.sh`), is followed by our new kube-rolling script. Jenkins already has `$BUILD_NUMBER` set, but we need a few other variables that are set in `jenkins.sh` that we reference in `kube-rolling.sh`: | ||
|
||
``` | ||
DOCKER_IMAGE="path_webteam/public" | ||
REGISTRY_LOCATION="dockerreg.web.local/" | ||
``` | ||
|
||
Jenkins builds our container, tags it with the build number, and runs a couple rudimentary tests on it. On success, it pushes it to our private docker registry. Once the container is pushed, it then executes our rolling update script. | ||
|
||
`kube-rolling.sh` | ||
``` | ||
#!/bin/bash | ||
# KUBERNETES_MASTER: Your Kubernetes API Server endpoint | ||
# BINARY_LOCATION: Location of pre-compiled Binaries (We build our own, there are others available) | ||
# CONTROLLER_NAME: Name of the replicationController you're looking to update | ||
# RESET_INTERVAL: Interval between pod updates | ||
export KUBERNETES_MASTER="http://10.1.10.1:8080" | ||
BINARY_LOCATION="https://build.web.local/kubernetes/" | ||
CONTROLLER_NAME="public-frontend-controller" | ||
RESET_INTERVAL="10s" | ||
echo "*** Time to push to Kubernetes!"; | ||
#Delete then graba kubecfg binary from a static location | ||
rm kubecfg | ||
wget $BINARY_LOCATION/kubecfg | ||
echo "*** Downloaded binary from $BINARY_LOCATION/kubecfg" | ||
chmod +x kubecfg | ||
# Update the controller with your new image! | ||
echo "*** ./kubecfg -image \"$REGISTRY_LOCATION$DOCKER_IMAGE:$BUILD_NUMBER\" -u $RESET_INTERVAL rollingupdate $CONTROLLER_NAME" | ||
./kubecfg -image "$REGISTRY_LOCATION$DOCKER_IMAGE:$BUILD_NUMBER" -u $RESET_INTERVAL rollingupdate $CONTROLLER_NAME | ||
``` | ||
|
||
Though basic, this implementation allows our Jenkins instance to push container updates to our Kubernetes cluster without much trouble. | ||
|
||
### Notes | ||
When using a private docker registry as we are, the Jenkins slaves as well as the Kubernetes minions require the [.dockercfg](https://coreos.com/docs/launching-containers/building/customizing-docker/#using-a-dockercfg-file-for-authentication) file in order to function properly. | ||
|
||
### Questions | ||
twitter @jeefy | ||
|
||
irc.freenode.net #kubernetes jeefy |
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
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
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,52 @@ | ||
## kubectl api-versions | ||
|
||
Print available API versions. | ||
|
||
### Synopsis | ||
|
||
|
||
Print available API versions. | ||
|
||
``` | ||
kubectl api-versions | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help=false: help for api-versions | ||
``` | ||
|
||
### Options inherrited from parent commands | ||
|
||
``` | ||
--alsologtostderr=false: log to standard error as well as files | ||
--api-version="": The API version to use when talking to the server | ||
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https. | ||
--certificate-authority="": Path to a cert. file for the certificate authority. | ||
--client-certificate="": Path to a client key file for TLS. | ||
--client-key="": Path to a client key file for TLS. | ||
--cluster="": The name of the kubeconfig cluster to use | ||
--context="": The name of the kubeconfig context to use | ||
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. | ||
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. | ||
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace | ||
--log_dir=: If non-empty, write log files in this directory | ||
--log_flush_frequency=5s: Maximum number of seconds between log flushes | ||
--logtostderr=true: log to standard error instead of files | ||
--match-server-version=false: Require server version to match client version | ||
--namespace="": If present, the namespace scope for this CLI request. | ||
--password="": Password for basic authentication to the API server. | ||
-s, --server="": The address and port of the Kubernetes API server | ||
--stderrthreshold=2: logs at or above this threshold go to stderr | ||
--token="": Bearer token for authentication to the API server. | ||
--user="": The name of the kubeconfig user to use | ||
--username="": Username for basic authentication to the API server. | ||
--v=0: log level for V logs | ||
--validate=false: If true, use a schema to validate the input before sending it | ||
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging | ||
``` | ||
|
||
### SEE ALSO | ||
* [kubectl](kubectl.md) | ||
|
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
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,52 @@ | ||
## kubectl cluster-info | ||
|
||
Display cluster info | ||
|
||
### Synopsis | ||
|
||
|
||
Display addresses of the master and services with label kubernetes.io/cluster-service=true | ||
|
||
``` | ||
kubectl cluster-info | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help=false: help for cluster-info | ||
``` | ||
|
||
### Options inherrited from parent commands | ||
|
||
``` | ||
--alsologtostderr=false: log to standard error as well as files | ||
--api-version="": The API version to use when talking to the server | ||
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https. | ||
--certificate-authority="": Path to a cert. file for the certificate authority. | ||
--client-certificate="": Path to a client key file for TLS. | ||
--client-key="": Path to a client key file for TLS. | ||
--cluster="": The name of the kubeconfig cluster to use | ||
--context="": The name of the kubeconfig context to use | ||
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. | ||
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. | ||
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace | ||
--log_dir=: If non-empty, write log files in this directory | ||
--log_flush_frequency=5s: Maximum number of seconds between log flushes | ||
--logtostderr=true: log to standard error instead of files | ||
--match-server-version=false: Require server version to match client version | ||
--namespace="": If present, the namespace scope for this CLI request. | ||
--password="": Password for basic authentication to the API server. | ||
-s, --server="": The address and port of the Kubernetes API server | ||
--stderrthreshold=2: logs at or above this threshold go to stderr | ||
--token="": Bearer token for authentication to the API server. | ||
--user="": The name of the kubeconfig user to use | ||
--username="": Username for basic authentication to the API server. | ||
--v=0: log level for V logs | ||
--validate=false: If true, use a schema to validate the input before sending it | ||
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging | ||
``` | ||
|
||
### SEE ALSO | ||
* [kubectl](kubectl.md) | ||
|
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
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
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
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
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
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
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
Oops, something went wrong.