Skip to content

Instantly share code, notes, and snippets.

View hossainemruz's full-sized avatar

Emruz Hossain hossainemruz

View GitHub Profile
@hossainemruz
hossainemruz / mysql-initialization-with-init-container.yaml
Created November 2, 2018 05:56
This sample show how to use init container to download init.sql file and initialize mysql database using this file
# this pvc will be used to store downloaded init.sql file
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: init-script
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
@hossainemruz
hossainemruz / mysql-init-demo.yaml
Created October 30, 2018 16:57
Sample MySQL deployment to initialize from *.sql file
# Here, I am using a gcePersistentDisk disk to store my init.sql file.
# You can you any Kubernetes volume such as hostPath,nfs etc.
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-init-demo
spec:
selector:
matchLabels:
app: mysql
kubectl logs -n demo es-auth-none2-0 -f
+ set -o errexit
+ set -o pipefail
+ sync
+ CUSTOM_CONFIG_DIR=/elasticsearch/custom-config
+ '[' -d /elasticsearch/custom-config ']'
+ echo 'Starting runit...'
+ exec /sbin/runsvdir -P /etc/service
+ set -o errexit
cluster:
name: es-monitoring-cluster
node:
master: true
data: true
name: es-monitoring-cluster-0
ingest: true
network.host: 0.0.0.0

Here is log from elasticsearch node.

+ /fsloader/run_sgadmin.sh
chown: /elasticsearch/plugins/search-guard-6/sgconfig/..data: Read-only file system
chown: /elasticsearch/plugins/search-guard-6/sgconfig/sg_roles.yml: Read-only file system
chown: /elasticsearch/plugins/search-guard-6/sgconfig/sg_internal_users.yml: Read-only file system
chown: /elasticsearch/plugins/search-guard-6/sgconfig/sg_config.yml: Read-only file system
chown: /elasticsearch/plugins/search-guard-6/sgconfig/sg_action_groups.yml: Read-only file system
chown: /elasticsearch/plugins/search-guard-6/sgconfig/READALL_PASSWORD: Read-only file system
chown: /elasticsearch/plugins/search-guard-6/sgconfig/ADMIN_PASSWORD: Read-only file system
@hossainemruz
hossainemruz / ExecOnPod
Created April 2, 2018 07:39
cient-go execute command on pod
package main
import (
"bytes"
"flag"
"fmt"
"log"
"github.com/appscode/go/crypto/rand"
"github.com/appscode/go/types"