An ip address such as www google com is the text version of a domain name

An ip address such as www google com is the text version of a domain name

Pricing Contact Login Support Request a Demo

  • Solutions
    • Use Cases
      • Threat Intelligence
      • Phishing and Fraud Prevention
      • Threat Hunting
      • Brand Protection
      • Forensics & Incident Response
      • Application Enrichment

  • Products
    • Iris Platform
      • Iris Detect 
      • Iris Enrich
      • Iris Investigate
    • Farsight DNSDB
    • Threat Intelligence Feeds
      • Predictive Risk Scoring
      • Hosting IP Risk Feed & Hotlist
      • Domain Risk Feed & Hotlist
      • Domain Visibility Feed
      • Domain Discovery Feed
      • Farsight Newly Active Domains
      • Farsight Newly Observed Hostnames
      • Farsight Newly Observed Domains
    • DomainTools Monitors

  • Integrations
    • SIEM
    • SOAR
    • Threat Intelligence
    • Anomali
    • Cortex XSOAR
    • CrowdStrike
    • Elastic
    • IBM QRadar
    • IBM Resilient
    • Maltego
    • MISP
    • Splunk
    • Splunk SOAR
    • TheHive and Cortex

  • Partners
    • Reseller Partner
    • Technology Partners
    • MSSP Partners
    • OEM Partners
    • Partner Portal
  • Company
    • Leadership
    • Careers
    • Pressroom

  • Resources
    • Resource Center
      • API Documentation
      • Events
    • Support and Learning

  • Rss
  • Facebook
  • Twitter
  • Linkedin

© 2022 DomainTools

DomainTools® and DomainTools™ are owned by DomainTools, all rights reserved.

Privacy Policy    |    California Privacy
Do Not Sell My Personal Information    |    Terms of Service    |    Sitemap

This tutorial demonstrates how to use Google Kubernetes Engine (GKE) to expose your web application to the internet on a and configure a domain name to point to your application.

This tutorial assumes you own a registered domain name, such as

gcloud container clusters create domain-test
6. You can register a domain name through Google Domains or another domain registrar of your choice if you do not have one.

Note: This tutorial uses the built-in GKE Ingress Controller and does not apply to the NGINX Ingress Controller.

Objectives

This tutorial demonstrates the following steps:

  • Reserve a static external IP address for your application
  • Configure either Service or Ingress resources to use the static IP
  • Update DNS records of your domain name to point to your application

Costs

This tutorial uses the following billable components of Google Cloud:

  • GKE

To generate a cost estimate based on your projected usage, use the pricing calculator.New Google Cloud users might be eligible for a free trial.

When you finish this tutorial, you can avoid continued billing by deleting the resources you created. For more information, see .

Before you begin

Take the following steps to enable the Kubernetes Engine API:
  1. Visit the Kubernetes Engine page in the Google Cloud console.
  2. Create or select a project.
  3. Wait for the API and related services to be enabled. This can take several minutes.
  4. Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.

Install the following command-line tools used in this tutorial:

  • gcloud container clusters create domain-test
    7 is used to create and delete Kubernetes Engine clusters.
    gcloud container clusters create domain-test
    7 is included in the
    gcloud container clusters create domain-test
    7 CLI.
  • 
    # Copyright 2021 Google LLC
    #
    # 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.
    
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: helloweb
      labels:
        app: hello
    spec:
      selector:
        matchLabels:
          app: hello
          tier: web
      template:
        metadata:
          labels:
            app: hello
            tier: web
        spec:
          containers:
          - name: hello-app
            image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
            ports:
            - containerPort: 8080
            resources:
              requests:
                cpu: 200m
    ---
    
    0 is used to manage Kubernetes, the cluster orchestration system used by Kubernetes Engine. You can install
    
    # Copyright 2021 Google LLC
    #
    # 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.
    
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: helloweb
      labels:
        app: hello
    spec:
      selector:
        matchLabels:
          app: hello
          tier: web
      template:
        metadata:
          labels:
            app: hello
            tier: web
        spec:
          containers:
          - name: hello-app
            image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
            ports:
            - containerPort: 8080
            resources:
              requests:
                cpu: 200m
    ---
    
    0 using
    gcloud container clusters create domain-test
    7:
    gcloud components install kubectl

Clone the sample code from GitHub:

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests

Set defaults for the gcloud container clusters create domain-test7 command-line tool

To save time typing your project ID and options in the
gcloud container clusters create domain-test
7 command-line tool, you can set the defaults:
gcloud config set project project-id
gcloud config set compute/zone compute-zone

Create a cluster

Create a container cluster named


# Copyright 2021 Google LLC
#
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloweb
  labels:
    app: hello
spec:
  selector:
    matchLabels:
      app: hello
      tier: web
  template:
    metadata:
      labels:
        app: hello
        tier: web
    spec:
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 200m
---
5 to deploy your web application:

gcloud container clusters create domain-test

Deploying your web application

The following manifest describes a Deployment that runs a sample web application container image:

helloweb-deployment.yaml

View on GitHub


# Copyright 2021 Google LLC
#
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloweb
  labels:
    app: hello
spec:
  selector:
    matchLabels:
      app: hello
      tier: web
  template:
    metadata:
      labels:
        app: hello
        tier: web
    spec:
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 200m
---

Run the following command to create the Deployment:

kubectl apply -f helloweb-deployment.yaml

Exposing your application

You can expose your application on GKE using either of the following methods:

  • Use a Service, which creates a TCP Network Load Balancer that works with regional IP addresses.

  • Use an Ingress, which creates an HTTP(S) Load Balancer and supports global IP addresses.

To learn more about the pros and cons of each method, refer to the .

Use a Service

To ensure that your application has a static public IP address, you must .

Note: Static IP addresses are free of charge when they are used by a load balancer. If you reserve a static IP address and do not use it, you are charged per .

If you choose to expose your application using a Service, you must create a regional IP address. Global IP addresses only work with Ingress resource type, as explained in the next section.

To use a Service, create a static IP address named


# Copyright 2021 Google LLC
#
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloweb
  labels:
    app: hello
spec:
  selector:
    matchLabels:
      app: hello
      tier: web
  template:
    metadata:
      labels:
        app: hello
        tier: web
    spec:
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 200m
---
6 in the region

# Copyright 2021 Google LLC
#
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloweb
  labels:
    app: hello
spec:
  selector:
    matchLabels:
      app: hello
      tier: web
  template:
    metadata:
      labels:
        app: hello
        tier: web
    spec:
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 200m
---
7:

gcloud

gcloud compute addresses create helloweb-ip --region us-central1

To find the static IP address you created, run the following command:

gcloud compute addresses describe helloweb-ip --region us-central1
Output:
address: 203.0.113.32
...

Config Connector

Note: This step requires Config Connector. Follow the installation instructions to install Config Connector on your cluster.

View on GitHub

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: helloweb-ip
spec:
  location: us-central1

To deploy this manifest, download it to your machine as compute-address-regional.yaml, and run:
git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
0To find the static IP address, run the following command:
git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
1

The following manifest describes a Service of type LoadBalancer, which creates a network load balancer to expose Pods with a public IP.

Replace YOUR.IP.ADDRESS.HERE with the static IP address:

helloweb-service-static-ip.yaml

View on GitHub

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
2

Then, create the Service:

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
3

To see the reserved IP address associated with the load balancer:

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
4Output:
git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
5Note: Provisioning and configuring the load balancer might take a few minutes.

Use an Ingress

If you choose to expose your application using an Ingress, which creates an HTTP(S) Load Balancer, you must . Regional IP addresses do not work with Ingress.

To learn more about how to use Ingress to expose your applications to the internet, refer to the Setting up HTTP(S) Load Balancing with Ingress tutorial.

Note: Static IP addresses are free of charge when they are used by a load balancer. If you reserve a static IP address and do not use it, you are charged per .

To create a global static IP address named


# Copyright 2021 Google LLC
#
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloweb
  labels:
    app: hello
spec:
  selector:
    matchLabels:
      app: hello
      tier: web
  template:
    metadata:
      labels:
        app: hello
        tier: web
    spec:
      containers:
      - name: hello-app
        image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 200m
---
6:

gcloud

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
6

To find the static IP address you created:

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
7Output:
address: 203.0.113.32
...

Config Connector

Note: This step requires Config Connector. Follow the installation instructions to install Config Connector on your cluster.

View on GitHub

git clone https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd kubernetes-engine-samples/hello-app/manifests
9

To deploy this manifest, download it to your machine as compute-address-global.yaml, and run:
gcloud config set project project-id
gcloud config set compute/zone compute-zone
0

The following manifest describes an Ingress that exposes a web application on a static IP with two resources:

  • A
    
    # Copyright 2021 Google LLC
    #
    # 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.
    
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: helloweb
      labels:
        app: hello
    spec:
      selector:
        matchLabels:
          app: hello
          tier: web
      template:
        metadata:
          labels:
            app: hello
            tier: web
        spec:
          containers:
          - name: hello-app
            image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
            ports:
            - containerPort: 8080
            resources:
              requests:
                cpu: 200m
    ---
    
    9 with
    kubectl apply -f helloweb-deployment.yaml
    0
  • An
    kubectl apply -f helloweb-deployment.yaml
    1 configured with the service name and static IP annotation

helloweb-ingress-static-ip.yaml

View on GitHub

gcloud config set project project-id
gcloud config set compute/zone compute-zone
1

The

kubectl apply -f helloweb-deployment.yaml
2 annotation specifies the name of the global IP address resource to be associated with the HTTP(S) Load Balancer.

Apply the resource to the cluster:

gcloud config set project project-id
gcloud config set compute/zone compute-zone
2Output:
gcloud config set project project-id
gcloud config set compute/zone compute-zone
3

To see the reserve IP address associated with the load balancer:

gcloud config set project project-id
gcloud config set compute/zone compute-zone
4Output:
gcloud config set project project-id
gcloud config set compute/zone compute-zone
5Note: Provisioning and configuring the load balancer might take a few minutes.

Visiting your reserved static IP address

To verify that the load balancer is configured correctly, you can either use a web browser to visit the IP address or use

kubectl apply -f helloweb-deployment.yaml
3:

gcloud config set project project-id
gcloud config set compute/zone compute-zone
6Output:
gcloud config set project project-id
gcloud config set compute/zone compute-zone
7Note: You might get HTTP 404 and HTTP 500 errors for a few minutes if you used
kubectl apply -f helloweb-deployment.yaml
1 resource to configure a load balancer. It takes time for configuration changes to propagate to regions across the globe.

Configuring your domain name records

To have browsers querying your domain name, such as

gcloud container clusters create domain-test
6, or subdomain name, such as
kubectl apply -f helloweb-deployment.yaml
6, point to the static IP address you reserved, you must update the DNS (Domain Name Server) records of your domain name.

You must create an A (Address) type DNS record for your domain or subdomain name and have its value configured with the reserved IP address

DNS records of your domain are managed by your nameserver. Your nameserver might be the "registrar" where you registered your domain, a DNS service such as Cloud DNS, or another third-party provider.

  • If your nameserver is Cloud DNS: Follow to configure DNS A record for your domain name with the reserved IP address of your application.

  • If your nameserver is another provider: Refer to your DNS service's documentation on setting DNS A records to configure your domain name. If you choose to use Cloud DNS instead, refer to Migrating to Cloud DNS.

Visiting your domain name

To verify that your domain name's DNS A records resolve to the IP address you reserved, visit your domain name.

Note: It can take a few hours for DNS records to propagate. This time might depend on your nameservers, local internet service provider (ISP), and many other factors.

To make a DNS query for your domain name's A record, run the

kubectl apply -f helloweb-deployment.yaml
7 command:

gcloud config set project project-id
gcloud config set compute/zone compute-zone
8Output:
gcloud config set project project-id
gcloud config set compute/zone compute-zone
9

At this point, you can point your web browser to your domain name and visit your website!

Clean up

To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, either delete the project that contains the resources, or keep the project and delete the individual resources.

  1. Delete the load balancing resources:

    gcloud container clusters create domain-test
    0
  2. Release the reserved static IP. After the load balancer is deleted, the unused but reserved IP address is no longer free of charge and is billed per unused IP address pricing. Run the following commands to release the static IP resource:

    • If you used a Service:

      gcloud container clusters create domain-test
      1
    • If you used an Ingress:

      gcloud container clusters create domain-test
      2
  3. Delete the sample application:

    gcloud container clusters create domain-test
    3
  4. Wait until the load balancer is deleted by watching the output of the following command. The output should not show a forwarding rule that contains "helloweb" in its name:

    gcloud container clusters create domain-test
    4
  5. Delete the container cluster:

    gcloud container clusters create domain-test
    5

What's next

  • Register your own domain name through Google Domains.

  • Explore other Kubernetes Engine tutorials.

  • Explore reference architectures, diagrams, tutorials, and best practices about Google Cloud. Take a look at our Cloud Architecture Center.

    Is the text version of a domain name?

    A domain name is a string of text that maps to a numeric IP address, used to access a website from client software. In plain English, a domain name is the text that a user types into a browser window to reach a particular website. For instance, the domain name for Google is 'google.com'.

    What is a text based name that corresponds to the IP address?

    domain name is a text based name that corresponds to the IP address A DNS server | Course Hero.

    What is the relationship between a domain name and an IP address quizlet?

    IP addresses are used to identify a user's location. DNS looks up the host and domain names that you enter and returns the actual IP address for the computer that you want to communicate with.

    Which one of these translates human readable words to IP addresses for the computer?

    DNS, or the Domain Name System, translates human readable domain names (for example, www.amazon.com) to machine readable IP addresses (for example, 192.0. 2.44).