Last active
October 7, 2018 02:00
-
-
Save tonysm/85b33467e5647dc2ec2c1c6ae8a4e003 to your computer and use it in GitHub Desktop.
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
$ minikube status | |
======================================== | |
kubectl could not be found on your path. kubectl is a requirement for using minikube | |
To install kubectl, please run the following: | |
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ | |
To disable this message, run the following: | |
minikube config set WantKubectlDownloadMsg false | |
======================================== | |
minikube: | |
cluster: | |
kubectl: |
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
$ minikube status | |
minikube: | |
cluster: | |
kubectl: |
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
$ minikube status | |
minikube: Running | |
cluster: Running | |
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100 |
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
$ minikube dashboard | |
Opening http://127.0.0.1:45741/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ in your default browser... | |
Created new window in existing browser session. |
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: Namespace | |
metadata: | |
name: "slackishapp" | |
labels: | |
name: "slackishapp" |
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 slackish-namespace-manifest.yaml | |
namespace "slackishapp" created |
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: PersistentVolumeClaim | |
metadata: | |
name: redis-pv-claim | |
namespace: slackishapp | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 20Gi |
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 redis/volume-manifest.yaml | |
persistentvolumeclaim "redis-pv-claim" created |
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: | |
name: redis-svc | |
namespace: slackishapp | |
spec: | |
ports: | |
- port: 6379 | |
protocol: TCP | |
selector: | |
name: redis |
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 redis/service-manifest.yaml | |
service "redis-svc" created |
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: apps/v1beta1 | |
kind: StatefulSet | |
metadata: | |
name: redis-st | |
namespace: slackishapp | |
spec: | |
serviceName: redis-svc | |
template: | |
metadata: | |
name: redis | |
labels: | |
name: redis | |
namespace: slackishapp | |
spec: | |
containers: | |
- name: container-redis | |
image: redis | |
ports: | |
- containerPort: 6379 | |
volumeMounts: | |
- name: redis-persistent-storage | |
mountPath: /data | |
volumes: | |
- name: redis-persistent-storage | |
persistentVolumeClaim: | |
claimName: redis-pv-claim |
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 redis/statefulset-manifest.yaml | |
statefulset.apps "redis-st" created |
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: | |
name: mysql | |
namespace: slackishapp | |
spec: | |
ports: | |
- port: 3306 | |
protocol: TCP | |
selector: | |
name: mysql | |
clusterIP: None |
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: PersistentVolumeClaim | |
metadata: | |
name: mysql-pv-claim | |
namespace: slackishapp | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 20Gi |
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: apps/v1beta1 | |
kind: StatefulSet | |
metadata: | |
name: mysql | |
namespace: slackishapp | |
spec: | |
serviceName: mysql | |
template: | |
metadata: | |
labels: | |
name: mysql | |
namespace: slackishapp | |
spec: | |
containers: | |
- name: container-mysql | |
image: mysql:5.7 | |
args: | |
- "--ignore-db-dir=lost+found" | |
ports: | |
- containerPort: 3306 | |
env: | |
# Use secret in real usage | |
- name: MYSQL_ROOT_PASSWORD | |
value: evensecreter | |
- name: MYSQL_DATABASE | |
value: slacksishdb | |
- name: MYSQL_USER | |
value: slacksishdbuser | |
- name: MYSQL_PASSWORD | |
value: supersecret | |
volumeMounts: | |
- name: mysql-persistent-storage | |
mountPath: /var/lib/mysql | |
volumes: | |
- name: mysql-persistent-storage | |
persistentVolumeClaim: | |
claimName: mysql-pv-claim |
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 mysql/volume-manifest.yaml | |
persistentvolumeclaim "mysql-pv-claim" created | |
$ kubectl create -f mysql/service-manifest.yaml | |
service "mysql" created | |
$ kubectl create -f mysql/statefulset-manifest.yaml | |
statefulset.apps "mysql" created |
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: slackish-webapp | |
namespace: slackishapp | |
spec: | |
replicas: 3 | |
minReadySeconds: 10 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxUnavailable: 1 | |
maxSurge: 1 | |
selector: | |
matchLabels: | |
app: slackish-webapp | |
template: | |
metadata: | |
labels: | |
app: slackish-webapp | |
namespace: slackishapp | |
spec: | |
containers: | |
- image: tonysm/slackish-laravel-app:latest | |
name: slackish-webapp | |
ports: | |
- containerPort: 80 | |
env: | |
- name: APP_NAME | |
value: "Slackish" | |
- name: APP_ENV | |
value: "local" | |
- name: APP_KEY | |
value: "SUPER_SECRET" | |
- name: APP_DEBUG | |
value: "true" | |
- name: APP_LOG_LEVEL | |
value: "debug" | |
- name: APP_URL | |
value: "http://slackish.com:30080" | |
- name: LOG_CHANNEL | |
value: "stack" | |
- name: DB_CONNECTION | |
value: "mysql" | |
- name: DB_HOST | |
value: "mysql" | |
- name: DB_DATABASE | |
value: "slacksishdb" | |
- name: DB_USERNAME | |
value: "slacksishdbuser" | |
- name: DB_PASSWORD | |
value: "supersecret" | |
- name: BROADCAST_DRIVER | |
value: "pusher" | |
- name: CACHE_DRIVER | |
value: "redis" | |
- name: SESSION_DRIVER | |
value: "redis" | |
- name: SESSION_LIFETIME | |
value: "120" | |
- name: QUEUE_DRIVER | |
value: "redis" | |
- name: REDIS_HOST | |
value: "redis-svc" | |
- name: REDIS_PASSWORD | |
value: "null" | |
- name: REDIS_PORT | |
value: "6379" | |
- name: PUSHER_APP_ID | |
value: "SUPER_SECRET" | |
- name: PUSHER_APP_KEY | |
value: "SUPER_SECRET" | |
- name: PUSHER_APP_SECRET | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_CLIENT_ID | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_CLIENT_SECRET | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_REDIRECT | |
value: "http://slackish.com:30080/auth/google/callback" |
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 slackish/web-manifest.yaml | |
deployment.extensions "slackish-webapp" created |
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: | |
name: slackish-webapp-service | |
labels: | |
app: slackish-webapp | |
namespace: slackishapp | |
spec: | |
type: NodePort | |
ports: | |
- port: 80 | |
protocol: TCP | |
nodePort: 30080 # Remove this if you are running in the Clouds. | |
selector: | |
app: slackish-webapp |
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 slackish/service-manifest.yaml | |
service "slackish-webapp-service" created |
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 get pods --namespace=slackishapp | |
NAME READY STATUS RESTARTS AGE | |
mysql-0 1/1 Running 0 16m | |
redis-st-0 1/1 Running 0 19m | |
slackish-webapp-798c5fbfc7-5cdjs 1/1 Running 0 10m | |
slackish-webapp-798c5fbfc7-mwf7p 1/1 Running 0 10m | |
slackish-webapp-798c5fbfc7-nx22r 1/1 Running 0 10m |
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 exec --namespace=slackishapp -it slackish-webapp-798c5fbfc7-5cdjs -- /bin/bash | |
root@slackish-webapp-798c5fbfc7-5cdjs:/var/www/html# php artisan migrate | |
Migration table created successfully. | |
Migrating: 2014_10_12_000000_create_users_table | |
Migrated: 2014_10_12_000000_create_users_table | |
Migrating: 2016_06_01_000001_create_oauth_auth_codes_table | |
Migrated: 2016_06_01_000001_create_oauth_auth_codes_table | |
Migrating: 2016_06_01_000002_create_oauth_access_tokens_table | |
Migrated: 2016_06_01_000002_create_oauth_access_tokens_table | |
Migrating: 2016_06_01_000003_create_oauth_refresh_tokens_table | |
Migrated: 2016_06_01_000003_create_oauth_refresh_tokens_table | |
Migrating: 2016_06_01_000004_create_oauth_clients_table | |
Migrated: 2016_06_01_000004_create_oauth_clients_table | |
Migrating: 2016_06_01_000005_create_oauth_personal_access_clients_table | |
Migrated: 2016_06_01_000005_create_oauth_personal_access_clients_table | |
Migrating: 2017_10_20_213656_create_companies_table | |
Migrated: 2017_10_20_213656_create_companies_table | |
Migrating: 2017_10_20_214041_add_link_between_users_and_companies | |
Migrated: 2017_10_20_214041_add_link_between_users_and_companies | |
Migrating: 2017_10_20_225853_create_channels_table | |
Migrated: 2017_10_20_225853_create_channels_table | |
Migrating: 2017_10_20_230533_add_default_channel_id_to_companies_table | |
Migrated: 2017_10_20_230533_add_default_channel_id_to_companies_table | |
Migrating: 2017_10_21_002407_add_current_channel_id_to_users_table | |
Migrated: 2017_10_21_002407_add_current_channel_id_to_users_table |
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: slackish-worker | |
namespace: slackishapp | |
spec: | |
replicas: 4 | |
minReadySeconds: 10 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxUnavailable: 1 | |
maxSurge: 1 | |
selector: | |
matchLabels: | |
app: slackish-worker | |
template: | |
metadata: | |
labels: | |
app: slackish-worker | |
namespace: slackishapp | |
spec: | |
containers: | |
- image: tonysm/slackish-laravel-app:latest | |
name: slackish-worker | |
env: | |
- name: CONTAINER_ROLE | |
value: "queue" | |
- name: APP_NAME | |
value: "Slackish" | |
- name: APP_ENV | |
value: "local" | |
- name: APP_KEY | |
value: "SUPER_SECRET" | |
- name: APP_DEBUG | |
value: "true" | |
- name: APP_LOG_LEVEL | |
value: "debug" | |
- name: APP_URL | |
value: "http://slackish.com:30080" | |
- name: LOG_CHANNEL | |
value: "stack" | |
- name: DB_CONNECTION | |
value: "mysql" | |
- name: DB_HOST | |
value: "mysql" | |
- name: DB_DATABASE | |
value: "slacksishdb" | |
- name: DB_USERNAME | |
value: "slacksishdbuser" | |
- name: DB_PASSWORD | |
value: "supersecret" | |
- name: BROADCAST_DRIVER | |
value: "pusher" | |
- name: CACHE_DRIVER | |
value: "redis" | |
- name: SESSION_DRIVER | |
value: "redis" | |
- name: SESSION_LIFETIME | |
value: "120" | |
- name: QUEUE_DRIVER | |
value: "redis" | |
- name: REDIS_HOST | |
value: "redis-svc" | |
- name: REDIS_PASSWORD | |
value: "null" | |
- name: REDIS_PORT | |
value: "6379" | |
- name: PUSHER_APP_ID | |
value: "SUPER_SECRET" | |
- name: PUSHER_APP_KEY | |
value: "SUPER_SECRET" | |
- name: PUSHER_APP_SECRET | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_CLIENT_ID | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_CLIENT_SECRET | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_REDIRECT | |
value: "http://slackish.com:30080/auth/google/callback" |
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 slackish/worker-manifest.yaml | |
deployment.extensions "slackish-worker" created |
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: slackish-scheduler | |
namespace: slackishapp | |
spec: | |
replicas: 1 | |
minReadySeconds: 10 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxUnavailable: 1 | |
maxSurge: 1 | |
selector: | |
matchLabels: | |
app: slackish-scheduler | |
template: | |
metadata: | |
labels: | |
app: slackish-scheduler | |
namespace: slackishapp | |
spec: | |
containers: | |
- image: tonysm/slackish-laravel-app:latest | |
name: slackish-scheduler | |
env: | |
- name: CONTAINER_ROLE | |
value: "scheduler" | |
- name: APP_NAME | |
value: "Slackish" | |
- name: APP_ENV | |
value: "local" | |
- name: APP_KEY | |
value: "SUPER_SECRET" | |
- name: APP_DEBUG | |
value: "true" | |
- name: APP_LOG_LEVEL | |
value: "debug" | |
- name: APP_URL | |
value: "http://slackish.com:30080" | |
- name: LOG_CHANNEL | |
value: "stack" | |
- name: DB_CONNECTION | |
value: "mysql" | |
- name: DB_HOST | |
value: "mysql" | |
- name: DB_DATABASE | |
value: "slacksishdb" | |
- name: DB_USERNAME | |
value: "slacksishdbuser" | |
- name: DB_PASSWORD | |
value: "supersecret" | |
- name: BROADCAST_DRIVER | |
value: "pusher" | |
- name: CACHE_DRIVER | |
value: "redis" | |
- name: SESSION_DRIVER | |
value: "redis" | |
- name: SESSION_LIFETIME | |
value: "120" | |
- name: QUEUE_DRIVER | |
value: "redis" | |
- name: REDIS_HOST | |
value: "redis-svc" | |
- name: REDIS_PASSWORD | |
value: "null" | |
- name: REDIS_PORT | |
value: "6379" | |
- name: PUSHER_APP_ID | |
value: "SUPER_SECRET" | |
- name: PUSHER_APP_KEY | |
value: "SUPER_SECRET" | |
- name: PUSHER_APP_SECRET | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_CLIENT_ID | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_CLIENT_SECRET | |
value: "SUPER_SECRET" | |
- name: AUTH_GOOGLE_REDIRECT | |
value: "http://slackish.com:30080/auth/google/callback" |
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 slackish/scheduler-manifest.yaml | |
deployment.extensions "slackish-scheduler" created |
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
$ tree . | |
. | |
├── mysql | |
│ ├── service-manifest.yaml | |
│ ├── statefulset-manifest.yaml | |
│ └── volume-manifest.yaml | |
├── redis | |
│ ├── service-manifest.yaml | |
│ ├── statefulset-manifest.yaml | |
│ └── volume-manifest.yaml | |
├── slackish | |
│ ├── scheduler-manifest.yaml | |
│ ├── service-manifest.yaml | |
│ ├── web-manifest.yaml | |
│ └── worker-manifest.yaml | |
└── slackish-namespace-manifest.yaml | |
3 directories, 11 files |
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
spec: | |
containers: | |
- - image: tonysm/slackish-laravel-app:latest | |
+ - image: tonysm/slackish-laravel-app:1.0 | |
name: slackish-webapp |
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 apply -f slackish/web-manifest.yaml | |
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply | |
deployment.extensions "slackish-webapp" configured |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment