Skip to content

Instantly share code, notes, and snippets.

Creating Ingress resources for Kubernetes applications

Workstation setup

Log in to your virtual machine in the LinuxONE Community Cloud. Next, configure environment variables to match the settings for this lab.

export PROXYIP=148.100.92.103
export CLUSTER_URL=https://148.100.92.103:8443/
@timroster
timroster / lab1-nlc-icd10-classifier.md
Last active December 3, 2019 03:23
Run the IBM Code Pattern "Classify ICD-10 data with Watson" using IBM Cloud and docker containers.

Classify medical diagnosis with ICD-10 code

DISCLAIMER: This application is used for demonstrative and illustrative purposes only and does not constitute an offering that has gone through regulatory review. It is not intended to serve as a medical application. There is no representation as to the accuracy of the output of this application and it is presented without warranty.

This application was built to demonstrate IBM's Watson Natural Language Classifier (NLC). The data set we will be using, ICD-10-GT-AA.csv, contains a subset of ICD-10 entries. ICD-10 is the 10th revision of the International Statistical Classification of Diseases and Related Health Problems. In short, it is a medical classification list by the World Health Organization (WHO) that contains codes for: diseases, signs and symptoms, abnormal findings, complaints, social circumstances, and external causes of injur

Some Docker examples

running a container image with simple command:

docker run centos echo "hello world"
docker run -it centos bash

Quick clean up

start off by removing the helm releases that were deployed in the helm lab:

helm delete guestbook-demo --namespace repo-demo
helm delete guestbook-demo --namespace helm-demo

remove the guestbook application components in the default namespace (ok to ignore errors)

titan:terraform-vpc timro$ terraform apply
2020/05/01 14:40:44 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/05/01 14:40:44 [INFO] Terraform version: 0.12.24
2020/05/01 14:40:44 [INFO] Go runtime version: go1.12.13
2020/05/01 14:40:44 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2020/05/01 14:40:44 [DEBUG] Attempting to open CLI config file: /Users/timro/.terraformrc
2020/05/01 14:40:44 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/01 14:40:44 [DEBUG] checking for credentials in "/Users/timro/.terraform.d/plugins"

Notes: Using IBM Cloud Databases (ICD) Postgresql from Spring applications

Background

Spring provides handy abstractions for java data persistence across a number of database platforms. When using Spring with postgresql, it's generally simply a matter of providing a JDBC connection string, username and password to wire up a connection. When using ICD Postgresql, this connection information needs to be supplemented with a certificate for the signing CA which is used to sign server identity certificates for each postgresql database instance. For the postgresql jdbc client, the file for the root certificate defaults to ${user.home}/.postgresql/root.crt (*nix) or %appdata%/postgresql/root.crt (windows), but can be overridden with the sslrootcert property.

The IBM Developer tutorial Connect a Spring Boot application to a cloud hosted database is a good starting point that i

crc start --log-level debug
DEBU CodeReady Containers version: 1.21.0+68a4cdd7
DEBU OpenShift version: 4.6.9 (embedded in executable)
DEBU Running 'crc start'
DEBU Total memory of system is 67277574144 bytes
DEBU Unable to find out if a new version is available: Get "https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/release-info.json": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
INFO Checking if running as non-root
INFO Checking if podman remote executable is cached
DEBU Currently podman remote is not supported
INFO Checking if admin-helper executable is cached
sudo dmidecode -t processor -q | tail -20
Socket Designation: CPU 1
Type: Central Processor
Family: Other
Manufacturer: QEMU
ID: D2 06 03 00 FF FB 8B 0F
Version: pc-i440fx-4.2
Voltage: Unknown
External Clock: Unknown
Max Speed: 2000 MHz
kubelet.service - Kubernetes Kubelet
Loaded: loaded (/etc/systemd/system/kubelet.service; disabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
└─10-mco-default-env.conf
Active: active (running) since Tue 2021-01-26 14:46:46 UTC; 5h 46min ago
Process: 2989 ExecStartPre=/bin/rm -f /var/lib/kubelet/cpu_manager_state (code=exited, status=0/SUCCESS)
Process: 2987 ExecStartPre=/bin/mkdir --parents /etc/kubernetes/manifests (code=exited, status=0/SUCCESS)
Main PID: 2991 (kubelet)
Tasks: 146 (limit: 287245)
Memory: 463.1M
2021-01-20 00:14:18.187+0000: starting up libvirt version: 6.0.0, package: 28.module_el8.3.0+555+a55c8938 (CentOS Buildsys <bugs@centos.org>, 2020-11-04-01:04:00, ), qemu version: 4.2.0qemu-kvm-4.2.0-34.module_el8.3.0+613+9ec9f184.1, kernel: 4.18.0-193.14.2.el8_2.x86_64, hostname: tor-crc-schematics-instance
LC_ALL=C \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin \
HOME=/var/lib/libvirt/qemu/domain-1-crc \
XDG_DATA_HOME=/var/lib/libvirt/qemu/domain-1-crc/.local/share \
XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain-1-crc/.cache \
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain-1-crc/.config \
QEMU_AUDIO_DRV=none \
/usr/libexec/qemu-kvm \
-name guest=crc,debug-threads=on \