This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Kotlin Code*/ | |
val a: Int | |
val b: Int | |
a=5 | |
b=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Java Code */ | |
static int num1, num2; //explicit declaration | |
num1 = 20; //use the variables anywhere | |
num2 = 30; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pip install --upgrade --user awscli | |
mkdir -p ~/.aws && chmod 755 ~/.aws | |
cat << EOF > ~/.aws/credentials | |
[default] | |
aws_access_key_id = XXXXXX | |
aws_secret_access_key = XXXXXX | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker version | |
Client: | |
Version: 17.03.1-ce | |
API version: 1.27 | |
Go version: go1.7.5 | |
Git commit: c6d412e | |
Built: Mon Mar 27 17:14:09 2017 | |
OS/Arch: linux/amd64 (Ubuntu 16.04) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ kubectl create -f deployment.yml | |
$ kubectl create -f service.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
k8s-app: postgres | |
name: postgres | |
namespace: production | |
spec: | |
type: NodePort | |
ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: postgres | |
namespace: production | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gluster volume create postgres-disk replica 2 transport tcp k8-master:/mnt/brick1/postgres-disk k8-1:/mnt/brick1/postgres-disk | |
$ gluster volume start postgres-disk | |
$ gluster volume info postgres-disk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker build -t dr.xenonstack.com:5050/postgres:v9.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
MAINTAINER XenonStack | |
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 | |
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list | |
RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6 | |
RUN /etc/init.d/postgresql start &&\ |