Giter Site home page Giter Site logo

vidyasagarmsc / knative-deploy Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 4.0 27 KB

Install Knative with Istio on IBM Cloud Kubernetes Service(IKS), build and push your image to IBM Cloud Container Registry (using Docker or Kaniko) and deploy the app.

Dockerfile 26.88% JavaScript 34.49% Shell 38.63%
knative istio ibmcloud kubernetes kaniko container-registry cluster kubernetes-cluster iks docker

knative-deploy's Introduction

Knative-deploy

Step-by-step instructions to install Knative with Istio 1.0.2 on IBM Cloud Kubernetes Service(IKS), build and push your image to IBM Cloud Container Registry and deploy the app.

For up-to-date instructions, refer to this article on Medium

Prerequisites

Setup IBMCloud CLI

  • Install the cs (container-service) and cr (container-registry) plugins
  ibmcloud plugin install container-service -r Bluemix
  ibmcloud plugin install container-registry -r Bluemix
  • Authorize ibmcloud:
  ibmcloud login
  kubectl apply --filename https://raw.githubusercontent.com/knative/serving/master/third_party/istio-1.0.2/istio.yaml
  • Label the default namespace with istio-injection=enabled: kubectl label namespace default istio-injection=enabled

  • Monitor the Istio components until all of the components show a STATUS of Running or Completed: kubectl get pods --namespace istio-system

  • Installing Knative components

Build your source into a container image and push using Kaniko

To Build a source into a container image from a Dockerfile inside a kubernetes cluster and push the image to IBM Cloud Container registry; all of this using Google's Kaniko tool, refer this link

OR

to build a container Image using Docker Daemon, follow the steps below

Build the app as a container image using Docker Daemon

Rehash of helloworld-nodejs

  • Clone the repo
  git clone https://github.com/VidyasagarMSC/knative-deploy.git
  cd knative-deploy
  • Install dependencies
  npm install
  • Build and Push the Docker image to IBM Cloud Container Registry by replacing <region> and <namespace> values
  ibmcloud cr build -t registry.<region>.bluemix.net/<namespace>/knative-node-app .
  • Open service.yaml, replace image and run the below command
  kubectl apply --filename service.yaml

Test your app

  • To find the IP address for your service, use kubectl get svc knative-ingressgateway -n istio-system to get the ingress IP for your cluster. If your cluster is new, it may take sometime for the service to get asssigned an external IP address.
export IP_ADDRESS=$(kubectl get svc knative-ingressgateway --namespace istio-system --output 'jsonpath={.status.loadBalancer.ingress[0].ip}')
  • To find the URL for your service, use kubectl get services.serving.knative.dev knative-node-app --output jsonpath='{.status.domain}'
export HOST_URL=$(kubectl get services.serving.knative.dev knative-node-app  --output jsonpath='{.status.domain}')
  • Now you can make a request to your app to see the result.
 curl -H "Host: ${HOST_URL}" http://${IP_ADDRESS}
Node App running on IBM Cloud

Cleanup

  • Run the below command to remove the sample app from your cluster
 kubectl delete --filename service.yaml
  • To delete the cluster, enter the following command:
 ibmcloud cs cluster-rm $CLUSTER_NAME

Related Content

knative-deploy's People

Contributors

vidyasagarmsc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.