Send feedback
Setting up the command-line environment
Stay organized with collections
Save and categorize content based on your preferences.
Configure the command-line tools to connect to and interact with
Knative serving.
These steps assume you are using a Mac or Linux operating system. If you
are using Microsoft Windows, you need to adjust the commands.
Although you can choose to use the
Google Cloud console to manage
Knative serving, there are some tasks that require the command-line
tools.
To install and configure the command-line tools for Knative serving:
Install and initialize the Google Cloud CLI .
Configure the Google Cloud CLI defaults :
Set your default Google Cloud project:
gcloud config set project PROJECT_ID
Replace PROJECT_ID with the ID of your Google Cloud project.
Set the
target platform :
gcloud config set run/platform kubernetes
Set the location of your cluster:
gcloud config set run/cluster_location ZONE_REGION
Replace ZONE_REGION with the
zone or region
of your cluster.
If you created and use a new namespace other than the default
namespace,
you can set that namespace as the default in Google Cloud CLI so that it's
used each time you run a command:
gcloud config set run/namespace NAMESPACE
Replace NAMESPACE with the name of the namespace that you want
the gcloud CLI tool to use by default.
Install the kubectl
command-line tool:
gcloud components install kubectl
Optional: Ensure that all previously installed components are up-to-date:
gcloud components update
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-26 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-26 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-26 UTC."]]