Get started with GitBook and GitHub a small guide

In this blog post I want to point out the great documentation topic GitBook.

The first time I noticed GitBook, was in a hands-on workshop, when I asked the presenters how they create and update their good looking workshop documentation.

I directly tried out the free GitBook version  for one of my GitHub projects and I noticed the awesome navigation, search, feedback and the responsive webpage capabilities which is all provided out of the box by GitBook. That’s awesome.

Here is a small gif that shows the GitHub readme.md page and the GitBook page at the same time.

gitbook-page-and-github-page

Sure there are many more functionalities in GitBook such as teaming, but to use these functionalities you need a paid license and I didn’t tried that out.

Here is a small “get started guide” I created from my perspective to get started with a GitBook page.

Continue reading

A small, but useful change in the IBM Cloud CLI for Kubernetes

This blog post is about a very small, but useful change in the IBM Cloud CLI for Kubernetes clusters.

You no longer need to export and set the KUBECONFIG environment variable to access your Kubernetes cluster on IBM Cloud in a terminal session. ( IBM Cloud documentation ).

You just can execute following IBM Cloud CLI command,

ibmcloud ks cluster config --cluster YOURCLUSTER

and verify the config settings.

kubectl config current-context

These images are showing the guides for your IBM Kubernetes cluster before and now.
Before Now
before now

That’s all.


I hope this was useful for you and let’s see what’s next?

Greetings,

Thomas

PS:  You can try out Cloud Foundry Apps or Kubernetes on IBM Cloud. By the way, you can use the IBM Cloud for free, if you simply create an IBM Lite account. Here you only need an e-mail address.

#IBMCloud, #Kubernetes

Run a Docker image as a Cloud Foundry App on IBM Cloud

In that blog post I want to point out an awesome topic: “Run a Docker container image as a Cloud Foundry App on IBM Cloud”

Rainer Hochecker, Simon Moser and I had an interesting exchange about running a Docker image as a Cloud Foundry App on IBM Cloud.

The advantage with that approach is: you don’t need to instantiate a Kubernetes or OpenShift cluster. You can just run a single Docker image with your single application on IBM Cloud. That can be useful in different situations where you need to control the contents of your application, and the cloud foundry build-pack mechanism maybe restricts you.

IBM offers to run Cloud Foundry Apps on IBM Cloud and supports a set of build packsBut, by the fact IBM uses Cloud Foundry, you can also upload a Docker image as a Cloud Foundry application, it’s an officially supported feature. Yes there is no documentation related to that topic in the IBM Cloud documentation, but you can apply the Cloud Foundry documentation.

One impact of that situation is, you don’t see the VCAP variables and you can’t use the out of the box binding for IBM Cloud services. You have to manage the bindings to your IBM Cloud services by yourself.  

Let’s start with a short guide: How to setup a Cloud Foundry application using a Docker image.

Continue reading

COVID19 communication starter kit for the Call for Code challenge

In this blog post I want to point out the awesome COVID19 communication starter kit for the Call for Code challenge. I created a small YouTube Video series following a COVID19 starter kit tutorial with the objective to show and talk: “More about the how and not so much about the why”.

 

I selected the tutorial Create a crisis communication chatbot and connect it to news and COVID-19 data sources for my video series on YouTube.

Note: Here is the YouTube video series link for LinkedIn users ;-), because I notice in the LinkedIn Mobile App it seems, it isn’t possible to access the embedded YouTube video in the blog post.

Continue reading

error: no matches forkind “Deployment”in version “apps/v1beta1”

This is a short blog post about changes in the new Kubernetes deployment definition.
In my older blog posts related to Kubernetes you will find older deployment definitions, these definitions will cause errors during the Kubernetes deployment. Here are the two major problems you maybe will notice:

1. If you get the following error

error: unable to recognize "deployment.yaml": 
no matches forkind "Deployment"in version "apps/v1beta1"
Please change the entry apps/v1beta1 to apps/v1 in the deployment.yaml file, the newer `deployment definition` for Kubernetes v1.16.8 (v1.18).

2. If you get this error

error: error validating "deployment.yaml": 
error validating data: ValidationError(Deployment.spec): 
missing required field "selector"in io.k8s.api.apps.v1.DeploymentSpec; 
#if you choose to ignore these errors, 
turn validation off with --validate=false
You need to insert in the deployment specification the statement selector:matchLabels:name:authors, as you see in the table below.
The table contains an example of the major changes in the deployment specification, the left hand side contains the new Kubernetes deployment definition and right hand side includes the older definition. The `selector` is now required.

kind: Deployment
apiVersion: apps/v1
metadata:
   name: authors
   labels:
     app: authors
spec:
   selector:
     matchLabels:
       app: authors
       version: v1
  replicas: 1
  template:
    metadata:
     labels:
        app: authors
        version: v1
     spec:
       containers:
       - name: authors
         image: authors:1
         ports:
          - containerPort: 3000
 ...
kind: Deployment
apiVersion: apps/v1beta1
metadata:
  name: authors
  labels:
    app: authors
spec: 
  ...
  ...
  ...
  ...
  replicas: 1
  template:
  metadata:
    labels:
      app: authors
        version: v1
    spec:
      containers:
      - name: authors
        image: authors:1
        ports:
        - containerPort: 3000
...

I hope this was useful for you and let’s see what’s next?

Greetings,

Thomas

PS:  You can try out Cloud Foundry Apps or Kubernetes on IBM Cloud. By the way, you can use the IBM Cloud for free, if you simply create an IBM Lite account. Here you only need an e-mail address.

#Kubernetes, #Deployment, #yaml

 

A Node-RED Twitter-follower-flow

In my last blog post I did an introduction to “how use the starter kit for Node-RED on IBM Cloud” and in this new blog post I want to highlight the Node-RED Twitter-follower-flow I developed as an introduction to different topics I frequently face at hackathons. Here is the link to the “Twitter-follower-flow” GitHub project. Node-RED is very good for prototyping, that is the reason why it is often used in hackathons. If you are new to Node-RED and you start  to develop a Node-RED flow, you normally have following challenges:

  • How to …
    1. … define own REST endpoints to encapsulate an external API?
    2. … automate the authentication to that external API?
    3. … extract data from the external API?
    4. … customize data and CRUD with databases?

The Node-RED flow of that project has the objective to provide an (little advanced) introduction to the first three topics above. The CRUD (Create, Read, Update, Delete) topic is not covered here. Visit that CRUD example for more information.

  • The “Twitter-follower-flow” example …
    • … uses open technologies (Node-RED is a Project of the OpenJS foundation )
    • … creates no additional costs
    • … has following technical level:
      • Beginner to intermediate
      • Needs a basic knowledge of JavaScript and REST
    • … takes 30 – 45 min to setup the example from scratch
      1. Register on IBM Cloud
      2. Create a Node-RED instance on IBM Cloud
      3. Register at Twitter for a developer API Account
      4. Copy the existing Node-RED flow
      5. Configure the flow
      6. Run the flow

The YouTube video below gives you a 13 min more detailed introduction to the Twitter-follower-flow.

Continue reading

A short introduction of the Node-RED Starter kit on IBM Cloud for Hackathons

In that blog post I want to highlight the new way of the instantiation of a Node-RED application on  IBM Cloud with the Node-RED Starter kit. From my perspective Node-RED is a very helpful tool at hackathons. (just take a look in my blog post  How to prepare for a Hackathon with IBM Cloud?)

The Node-RED instantiation has changed and with the Node-RED Starter kit we can take the advantage of the capabilities of IBM Cloud to control the build, deployment and execution of the Node-RED application and we setup automatically all  development tools to work effectively in a small development team in our hackathon.

I want to provide a short walkthrough from my perspective and created a 13 min YouTube video in addition to that blog post.

Continue reading

Write and execute a JUnit test for a Java microservice based on MicroProfile and run both in the OpenLiberty development mode

This blog post has the focus on: how to develop a JUnit test for the Authors microservice from the Cloud Native Starter example and run both the Authors microservice and the JUnit test on OpenLiberty in the development mode.

That blog post hasn’t the objective to be a blueprint or a ‘how to guide’ for writing JUnit tests,  JUnit test organization, test strategy and so on. The objective is to get technically started along one concrete microservice example from the Cloud Native Starter project.

The Authors microservice has one RESTful api endpoint called getAuthor. The endpoint provides one parameter for the Author name. The endpoint returns Author data in a JSON format.

Keep the end in mind: The gif shows a sample JUnit test execution for the Author microservice using OpenLiberty in the Visual Studio Code editor:

junit-on-openliberty-run-test

Note: As an alternative or in addition, you can also visit the OpenLiberty tutorial “MicroProfile or Jakarta EE application” to start with that topic.

Let’s start with: What do we need and how do we realize the implementation?

We need to ..

    •  invoke the REST endpoint of the Authors microservice with a REST Client.
    •  transform the JSON response of the REST endpoint to an Author data class
    •  handle different values to invoke the REST Endpoint parameter for the Author name to run tests with variations of the Author name.
    • compare the actual response value with an expected value and document the result.

Continue reading

Run a MicroProfile Microservice on OpenLiberty in a Remote development container in Visual Studio Code

In this blog post I want to show, how to setup a local remote Java development container for Eclipse MicroProfile with OpenLiberty in Visual Studio Code.

I did that for the Authors microservice from the Cloud Native Starter project with MicroProfile 3.2, OpenJDK Java 11, and the latest OpenLiberty version.

That blog post is structured in:

  • Setup and configuration of Visual Studio Code
  • Run the Authors microservice in the remote development container
  • Debug the Authors microservice in the remote development container

The documentation of remote development with Video Studio Code is here and Java Dev Environments with Containers is a great blog post, which does also cover the remote development with container.

Continue reading