- Notifications
You must be signed in to change notification settings - Fork1
Deploy a sample app with ingress on your existing Kubernetes cluster on VPC.
License
Cloud-Schematics/iks-on-vpc-deploy-demo-ingress-app
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
These modules deploy a simple demo app to an IKS Cluster using aCluster Ingress deployment.
Make sure that the ALBs in your cluster are enabled. If you want the app to be available publicly, make sure the public ALBs are enabled
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:
- Log in to IBM Cloud using the CLI
ibmcloud login
- Log in to the IBM Container Registry
ibmcloud cr login
- If you do not have a namespace you want to use with your app, create a namespace:
ibmcloud cr namespace-add <my_namespace>
- In the
./node-demo-app
directory run this command to build the docker container:
docker build . -t <image_name>:<tag>
- Next, tag the image to upload to ICR
docker tag <image_name>:<tag> <region>.icr.io/<my_namespace>/<new_image_repo>:<new_tag>
- Push the image to ICR
docker push <region>.icr.io/<my_namespace>/<new_image_repo>:<new_tag>
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
After the application deployed, the script creates a NodePoet service for the application with the specified service port that points to the application. The terraform script gets a list of enabled ALB IDs from the cluster is deployed and creates a semicolon separated list of them and uses it to create a cluster ingress resource.
Once your application has been deployed, you'll be able to visit it at<app_name>.<your_cluster_ingress>
.
The following variables are used for both deployment methods.
Variable | Type | Description | Default |
---|---|---|---|
ibmcloud_api_key | String | The IBM Cloud platform API key needed to deploy IAM enabled resources | |
generation | String | Generation of VPC. Can be 1 or 2 | 2 |
ibm_region | String | IBM region for IKS on VPC cluster | us-south |
group | String | Name of resource group to provision resources | asset-development |
app_name | String | Name for app in kubernetes | demo-app |
namespace | String | Namespace to deploy application | default |
container_name | String | Name for container in deployment | api-service |
app_image | String | link to app image to install | |
app_port | String | Port for app to run | 8080 |
protocol | String | Service protocol | TCP |
service_port | String | Port for application | 8080 |
cluster_name | String | name of IKS cluster |
About
Deploy a sample app with ingress on your existing Kubernetes cluster on VPC.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors3
Uh oh!
There was an error while loading.Please reload this page.