Skip to content

Instantly share code, notes, and snippets.

@kprasad99
kprasad99 / Dockerfile
Last active February 19, 2020 15:59
JRE 11 Docker file
# reference https://stackoverflow.com/questions/53669151/java-11-application-as-lightweight-docker-image
FROM alpine:latest as builder
RUN apk --no-cache add openjdk11-jdk openjdk11-jmods
ENV JAVA_MINIMAL="/opt/java-minimal"
# build minimal JRE
RUN /usr/lib/jvm/java-11-openjdk/bin/jlink \
@kprasad99
kprasad99 / k8s_td.adoc
Last active December 5, 2019 15:36
How to take Thread dump for Java Application in kubernetes.

How to take Thread Dump for Java Application in Kubernetes.

  • Get the container id of the pod.

    $ kubectl get po <pod-id>  -o=jsonpath='{.status.containerStatuses[0].containerID}{"\n"}' | awk '{print substr($0, 10, 12);}'
    Note
    In my case there is only one container, if there are mulitple container, you can use selectors.
@kprasad99
kprasad99 / install_docker_compose_ubuntu.18.04.adoc
Created August 3, 2019 08:36
Install docker-compose on ubuntu 18.04

Install Compose on Ubuntu 18.04

The Docker Compose binary cam be downloaded from the Compose repository release page on GitHub.

  • Install following dependency packages

    $ sudo apt update && sudo apt install -y py-pip python-dev libffi-dev openssl-dev gcc libc-dev make
@kprasad99
kprasad99 / zookeeper-cluster.adoc
Last active July 11, 2019 19:13
Create zookeeper cluster in ubuntu,18.04
  1. Download zookeeper distribution

    wget http://apachemirror.wuchna.com/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
  2. Extract distribution

version: '3.7'
services:
zoo1:
image: zookeeper:3.4.14
restart: always
hostname: zoo1
volumes:
- "/opt/docker-volumes/zoo1/data:/data"
- "/opt/docker-volumes/zoo1/datalog:/datalog"
apiVersion: kubeadm.k8s.io/v1beta2
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
token: abcdef.0123456789abcdef
ttl: 24h0m0s
usages:
- signing
- authentication
kind: InitConfiguration
@kprasad99
kprasad99 / vsc_plugins.md
Created May 8, 2019 19:40
Usefull VSC plugins

To list Installed plugins

.Linux

code --list-extensions | xargs -L 1 echo code --install-extension

.Windows (PowerShell, e. g. using VSCode's integrated Terminal):

# Sample ``local.conf`` for user-configurable variables in ``stack.sh``
# NOTE: Copy this file to the root DevStack directory for it to work properly.
# ``local.conf`` is a user-maintained settings file that is sourced from ``stackrc``.
# This gives it the ability to override any variables set in ``stackrc``.
# Also, most of the settings in ``stack.sh`` are written to only be set if no
# value has already been set; this lets ``local.conf`` effectively override the
# default values.
@kprasad99
kprasad99 / install_and_configure_kubernetes.adoc
Last active January 24, 2019 14:33
Install and configure Kubernetes in Ubuntu 18.04

Kubernetes MultiNode cluster on VirtualBox

A step by step description of bringing up kubernetes cluster using VirtualBox 6.0 with ubuntu 18.04 server.

VirtualBox setup

Create two VMs k8s-master and k8s-s1 as shown in below diagram.


@kprasad99
kprasad99 / install_docker_ubuntu_18_04.adoc
Last active January 21, 2019 17:37
Installation and configuration of docker in Ubuntu 18.04

Installation and configuration of docker in Ubuntu 18.04

Install docker package

Below are the steps to install docker in ubuntu 18.04

  • First update existing packages.

$ sudo apt update ; sudo apt upgrade