Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deploy a sample app with load balance on your existing Kubernetes cluster on VPC.

License

NotificationsYou must be signed in to change notification settings

Cloud-Schematics/iks-on-vpc-deploy-demo-load-balancer-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

These modules deploy a simple demo app to an IKS Cluster using aLoad Balancer deployment.

Load Balancer Deployment

Load Balancer Deployment

Table of Contents

  1. Setup
  2. Deployment
  3. Load Balancer Depolyment Pattern
  4. Module Variables

Setup

Ensure that the account you're using to create this deployment has permissions to create Load Balancer for VPC. When you create a load balancer service, a VPC load balancer is automatically created

Creating the Image In IBM Cloud Container Registry

In order to make sure this architecture deploys correctly, ensure that you have copied any icr image pull secrets into the namespace where the app will be deployed if you're using ICR for the images. You will need to have Docker installed locally. You can find more information on getting started with IBM Container Registryhere.

Both of these deployment patterns use anode demo app. To upload this example application toIBM Cloud Container Registry follow these steps:

  1. Log in to IBM Cloud using the CLI
ibmcloud login
  1. Log in to the IBM Container Registry
ibmcloud cr login
  1. If you do not have a namespace you want to use with your app, create a namespace:
ibmcloud cr namespace-add <my_namespace>
  1. In the./node-demo-app directory run this command to build the docker container:
docker build . -t <image_name>:<tag>
  1. Next, tag the image to upload to ICR
docker tag <image_name>:<tag> <region>.icr.io/<my_namespace>/<new_image_repo>:<new_tag>
  1. Push the image to ICR
docker push <region>.icr.io/<my_namespace>/<new_image_repo>:<new_tag>

Deployment

This pattern creates an IKS deployment equivalant to this .yaml file:

apiVersion: apps/v1kind: Deploymentmetadata:  name: demo-app  namespace: default  labels:    app: demo-appspec:  selector:    matchLabels:      app: test-app  template:    metadata:      labels:        app: api-service    spec:      containers:      - image: <region>.icr.io/<my_namespace>/<new_image_repo>:<new_tag>        name: test-app        env:            - name: PORT              value: 8080

Load Balancer Depolyment Pattern

Once the application has been deploued, the script creates a Load Balancer service. This service will create a Load Balancer for VPC where the application can be accessed. Please note that the application will not be available until the Load Balancer has finished creating. To access the application, you will need add theapp_port to your Load Balancer URL:

<your_lb_host_name>:<app_port>

Module Variables

The following variables are used for both deployment methods.

VariableTypeDescriptionDefault
ibmcloud_api_keyStringThe IBM Cloud platform API key needed to deploy IAM enabled resources
generationStringGeneration of VPC. Can be 1 or 22
ibm_regionStringIBM region for IKS on VPC clusterus-south
groupStringName of resource group to provision resourcesasset-development
app_nameStringName for app in kubernetesdemo-app
namespaceStringNamespace to deploy applicationdefault
container_nameStringName for container in deploymentapi-service
app_imageStringlink to app image to install
app_portStringPort for app to run8080
protocolStringService protocolTCP
service_portStringPort for application8080
cluster_nameStringname of IKS cluster
lb_typeStringIKS on VPC load balancer type. Can be public or privatepublic

About

Deploy a sample app with load balance on your existing Kubernetes cluster on VPC.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp