To check things like cpu, memory, docker information, instance type and various other information about the instance.
Use these commands.
First list the instance in your ecs cluster.
$ aws ecs list-container-instances --cluster default
Then display the information using this command.
$ aws ecs describe-container-instances --cluster default --container-instances 3434323-343434-fg45-xxxxxxxxxxx
kubectl needs to have a way of talking to the kubernetes cluster on gcp.
This command adds the credentials to you config file.
$ gcloud container clusters get-credentials orion-cluster
Fetching cluster endpoint and auth data.
kubeconfig entry generated for orion-cluster.
kubectl uses Application Default Credentials to authenticate to the cluster. To authenticate with GCP.
This command will launch a web page to GCP, to log in & allow authentication.
$ gcloud auth application-default login
If all goes well you will see a web page entitles:
You are now authenticated with the Google Cloud SDK!
To authenticate with azure and start using the azure command line tools.
$ azure login
info: Executing command login
|info: To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code to authenticate.
/info: Added subscription Free Trial
info: Setting subscription "Free Trial" as default
info: login command OK
Then you can run any of the azure cli commands, eg:
$ azure vm list
info: Executing command vm list
+ Getting virtual machines
data: ResourceGroupName Name ProvisioningState PowerState Location Size
data: ----------------- ----- ----------------- -------------- ----------- ---------------
data: TRAININGENV Tools Succeeded VM deallocated northeurope Standard_DS1_v2
List VM details:
$ azure vm show TrainingEnv Tools
Main help "-h" works too.
$ oc help
This client helps you develop, build, deploy, and run your applications on any OpenShift or
Kubernetes compatible platform. It also includes the administrative commands for managing a
cluster under the 'adm' subcommand.
types An introduction to concepts and types
login Log in to a server
new-project Request a new project
new-app Create a new application
status Show an overview of the current project
project Switch to another project
projects Display existing projects
explain Documentation of resources.
cluster Start and stop OpenShift cluster
idle Idle scalable resources
Build and Deploy Commands:
rollout rollout manages a deployment
deploy View, start, cancel, or retry a deployment
rollback Revert part of an application back to a previous deployment
new-build Create a new build configuration
start-build Start a new build
cancel-build Cancel running, pending, or new builds
import-image Imports images from a Docker registry
tag Tag existing images into image streams
Application Management Commands:
get Display one or many resources
describe Show details of a specific resource or group of resources
edit Edit a resource on the server
set Commands that help set specific features on objects
label Update the labels on a resource
annotate Update the annotations on a resource
expose Expose a replicated application as a service or route
delete Delete one or more resources
scale Change the number of pods in a deployment
autoscale Autoscale a deployment config or replication controller
secrets Manage secrets
serviceaccounts Manage service accounts in your project.
Troubleshooting and Debugging Commands:
logs Print the logs for a resource.
rsh Start a shell session in a pod
rsync Copy files between local filesystem and a pod
port-forward Forward one or more local ports to a pod.
debug Launch a new instance of a pod for debugging
exec Execute a command in a container.
proxy Run a proxy to the Kubernetes API server
attach Attach to a running container.
run Run a particular image on the cluster.
adm Tools for managing a cluster
create Create a resource by filename or stdin
replace Replace a resource by filename or stdin.
apply Apply a configuration to a resource by filename or stdin
patch Update field(s) of a resource using strategic merge patch.
process Process a template into list of resources
export Export resources so they can be used elsewhere
extract Extract secrets or config maps to disk
observe Observe changes to resources and react to them (experimental)
policy Manage authorization policy
convert Convert config files between different API versions
import Commands that import applications
logout End the current server session
config Change configuration files for the client
whoami Return information about the current session
completion Output shell completion code for the given shell (bash or zsh)
help Help about any command
version Display client and server versions
Use "oc <command> --help" for more information about a given command.
Use "oc options" for a list of global command-line options (applies to all commands).
To get help on a specific sub-command.
$ oc help new-app
Create a new application by specifying source code, templates, and/or images
This command will try to build up the components of an application using images, templates,
or code that has a public repository. It will lookup the images on the local Docker installation
(if available), a Docker registry, an integrated image stream, or stored templates.
If you specify a source code URL, it will set up a build that takes your source code and converts
it into an image that can run inside of a pod. Local source must be in a git repository that has a
remote repository that the server can see. The images will be deployed via a deployment
configuration, and a service will be connected to the first public port of the app. You may either specify
components using the various existing flags or let new-app autodetect what kind of components
you have provided.
If you provide source code, a new build will be automatically triggered.
You can use 'oc status' to check the progress.
oc new-app (IMAGE | IMAGESTREAM | TEMPLATE | PATH | URL ...) [options]
# List all local templates and image streams that can be used to create an app
oc new-app --list
# Create an application based on the source code in the current git repository (with a public remote)
# and a Docker image
oc new-app . --docker-image=repo/langimage
# Create a Ruby application based on the provided [image]~[source code] combination
oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git
# Use the public Docker Hub MySQL image to create an app. Generated artifacts will be labeled with db=mysql
oc new-app mysql MYSQL_USER=user MYSQL_PASSWORD=pass MYSQL_DATABASE=testdb -l db=mysql
# Use a MySQL image in a private registry to create an app and override application artifacts' names
oc new-app --docker-image=myregistry.com/mycompany/mysql --name=private
# Create an application from a remote repository using its beta4 branch
oc new-app https://github.com/openshift/ruby-hello-world#beta4
# Create an application based on a stored template, explicitly setting a parameter value
oc new-app --template=ruby-helloworld-sample --param=MYSQL_USER=admin
# Create an application from a remote repository and specify a context directory
oc new-app https://github.com/youruser/yourgitrepo --context-dir=src/build
# Create an application based on a template file, explicitly setting a parameter value
oc new-app --file=./example/myapp/template.json --param=MYSQL_USER=admin
# Search all templates, image streams, and Docker images for the ones that match "ruby"
oc new-app --search ruby
# Search for "ruby", but only in stored templates (--template, --image-stream and --docker-image
# can be used to filter search results)
oc new-app --search --template=ruby
# Search for "ruby" in stored templates and print the output as an YAML
oc new-app --search --template=ruby --output=yaml
--allow-missing-images=false: If true, indicates that referenced Docker images that cannot be found locally or in a registry should still be used.
--allow-missing-imagestream-tags=false: If true, indicates that image stream tags that don't exist should still be used.
--as-test=false: If true create this application as a test deployment, which validates that the deployment succeeds and then scales down.
--code=: Source code to use to build this application.
--context-dir='': Context directory to be used for the build.
--docker-image=: Name of a Docker image to include in the app.
--dry-run=false: If true, show the result of the operation without performing it.
-e, --env=: Specify key-value pairs of environment variables to set into each container. This doesn't apply to objects created from a template, use parameters instead.
-f, --file=: Path to a template file to use for the app.
--grant-install-rights=false: If true, a component that requires access to your account may use your token to install software into your project. Only grant images you trust the right to run with your token.
--group=: Indicate components that should be grouped together as <comp1>+<comp2>.
--image=: Name of an image stream to use in the app. (deprecated)
-i, --image-stream=: Name of an image stream to use in the app.
--insecure-registry=false: If true, indicates that the referenced Docker images are on insecure registries and should bypass certificate checking
-l, --labels='': Label to set in all resources for this application.
-L, --list=false: List all local templates and image streams that can be used to create.
--name='': Set name to use for generated application artifacts
--no-install=false: Do not attempt to run images that describe themselves as being installable
-o, --output='': Output results as yaml or json instead of executing, or use name for succint output (resource/name).
--output-version='': The preferred API versions of the output objects
-p, --param=: Specify a list of key value pairs (e.g., -p FOO=BAR,BAR=FOO) to set/override parameter values in the template.
-S, --search=false: Search all templates, image streams, and Docker images that match the arguments provided.
--strategy='': Specify the build strategy to use if you don't want to detect (docker|source).
--template=: Name of a stored template to use in the app.
Use "oc options" for a list of global command-line options (applies to all commands).