Quickstart: Deploy to Knative serving on VMware
Learn how to enable Knative serving on Google Distributed Cloud and deploy a prebuilt sample container to the cluster.
Before you begin
- This quickstart assumes you have active Google Distributed Cloud
with Knative serving enabled. To create one, see
Setting up
Knative serving on VMware.
For information about GKE Enterprise, see GKE Enterprise Pricing.
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
- To send a request to the deployed sample service, install cURL.
- To ensure you have the latest version of the Google Cloud CLI, either install or update the Google Cloud CLI:
- Install and initialize the Google Cloud CLI.
- If you've already installed the gcloud CLI, update the
installed components:
gcloud components update
Setting up the command-line environment
Set up the gcloud CLI and kubectl
for Knative serving on VMware:
Set the default Google Cloud project that is used by the Google Cloud CLI to the Google Cloud project that you just created:
gcloud config set project PROJECT-ID
Replace PROJECT_ID with the ID of your Google Cloud project.
Install the
kubectl
command-line tool:gcloud components install kubectl
Update installed gcloud CLI components:
gcloud components update
Deploying a sample container
To deploy a container to the cluster you just created:
Run the command:
gcloud run deploy SERVICE --image IMAGE_URL
- Replace SERVICE with the name of the service you are deploying to. You can omit this parameter entirely, but you will be prompted for the service name if you omit it.
- Replace IMAGE_URL with a reference to the container image, for
example,
gcr.io/myproject/my-image:latest
.
Wait for the deployment to finish. Upon successful completion, a success message is displayed with the URL of the deployed service.
Accessing your deployed service
After deploying your service, you can use cURL to send a request and verify the service is working, using the external IP address of the Load Balancer service created for the Istio ingress controller:
Get and note the IP address using the
kubectl
command line:kubectl get svc istio-ingress -n gke-system --output 'jsonpath={.status.loadBalancer.ingress[0].ip}'
Get and note the domain using the
kubectl
command line:kubectl get route SERVICE --output jsonpath='{.status.url}' | sed 's/https\?:\/\///'
Replace SERVICE with the name of the service.
Invoke cURL with the
DOMAIN
andIP_ADDRESS
of your service:curl -v -H "Host: DOMAIN" http://IP_ADDRESS
Replace:
- DOMAIN with the domain that you previously obtained.
- IP_ADDRESS with the IP address you obtained in previous steps.
Clean up
Delete your Knative serving on VMware service by executing:
gcloud run services delete SERVICE
Replace SERVICE with the name of the service.
What's next
To learn how to build a container from code source, push to Container Registry, and deploy, refer to: