DevOps Taiwan Meetup #19 - 那些年
我們踩的 CI 坑
Len Chang, December 14 2018
Outline
● Me
● Issues Discussion
○ CI / CD of gitlab
○ CI / CD of bitbucket
○ logstash of Elastic
● Advertisement time !!
Me
Fear is a choice ~
https://www.linkedin.com/in/huailunchang/
Issues Discussion-CI / CD of gitlab
Q: How to deploy
gitLab-runner ?
Key word
● CI/CD of GitLab
● GitLab-runner
Q: How to deploy gitLab-runner ?
Step 1.
● open GitLab
Server and follow
the steps
Q: How to deploy gitLab-runner ?
Step 2.
● Set up gitlab-runner
● Set parameters
Q: How to deploy gitLab-runner ?
Step 3.
● Config setting
Q: How to deploy
gitLab-runner ?
Something you need to care about….
● permission is important !!!
Q: How to clean
gitLab-runner ?
Key word
● NULL
Q: How to clean gitLab-runner ?
Q: How to clean gitLab-runner ?
gitlab-runner verify --delete. It will delete runners that got removed from GitLab.
Reference
Q: How to clean
gitLab-runner ?
Something you need to care about….
● Still .. NULL
CI / CD of bitbucket
Q: How to deploy
app in Google App
Engine by Bitbucket
Pipelines ?
Key word
● Google App Engine
● Bitbucket Pipelines
Q: How to deploy app in Google App Engine by
Bitbucket Pipelines ?
Step 1.
● Apply GCP / Bitbucket account
● Make sure your app can run on local and
match Google App Engine Environment
Step 2.
● Get auth. key from GCP
Q: How to deploy app in Google App Engine by
Bitbucket Pipelines ?
Step 3.
● Bitbucket Setting
a. Enable your settings
Q: How to deploy app in Google App Engine by
Bitbucket Pipelines ?
Step 4.
● Bitbucket Setting
a. Set repository variables
Q: How to deploy app in Google App Engine by
Bitbucket Pipelines ?
Step 5.
● Bitbucket Setting
a. write pipelines.yaml
Q: How to deploy
app in Google App
Engine by Bitbucket
Pipelines ?
Something you need to care about….
● Limitations of Bitbucket Pipelines
○ Free 50 minutes
● Something will break down forever….
Q: How to deploy
web (Angular)
in Google Cloud
Storage by
Bitbucket Pipelines
?
Key word
● Google Cloud Storage
○ https://cloud.google.com/storage/
● Angular
○ https://angular.io/
Q: How to deploy web (Angular) in Google
Cloud Storage by Bitbucket Pipelines ?
Step 1.
● Apply GCP / Bitbucket account
● Make sure your angular app can run on local
Step 2.
● Get auth. key from GCP
Q: How to deploy web (Angular) in Google
Cloud Storage by Bitbucket Pipelines ?
Step 3.
● Let google know we own the domain
"test123.com" if it's not done before (do this
on Google Search Console)
Q: How to deploy web (Angular) in Google
Cloud Storage by Bitbucket Pipelines ?
Step 4.
● Create a new bucket named
"whatever.test123.com" and upload bundled
webapp
Step 5.
● Assign member named "allUsers" as the
"Storage Object Viewer" of the bucket
Q: How to deploy web (Angular) in Google
Cloud Storage by Bitbucket Pipelines ?
Step 6.
● Set index.html as main page and 404 page
Q: How to deploy web (Angular) in Google
Cloud Storage by Bitbucket Pipelines ?
Step 7.
● Bitbucket Setting
a. Enable your settings
Q: How to deploy web (Angular) in Google
Cloud Storage by Bitbucket Pipelines ?
Step 8.
● Bitbucket Setting
a. Set repository variables
Q: How to deploy app in Google App Engine by
Bitbucket Pipelines ?
Step 9.
● Bitbucket Setting
a. write pipelines.yaml
Q: How to deploy
app in Google App
Engine by Bitbucket
Pipelines ?
Something you need to care about….
● gsutil -m rm gs://aaa.test1234.com/**
○ You need to push data into bucket first otherwise
you will get exception
logstash of Elastic
How to use logstash
to read log files
created by rsyslog?
Key word
● logstash
● rsyslog
How to use logstash to read log files created by
rsyslog?
Q: logstash can’t read log files which “permission
deny…..”
How to use logstash to read log files created by
rsyslog?
Q: logstash can’t read log files which “permission
deny…..”
/etc/syslog.conf (default value)
● $FileCreateMode 0644
● $umask 0077
○ Update to $umask 0022
How to use logstash
to read log files
created by rsyslog?
Summary
● Permission is important….
logstash -
Persistent Queues
Key
- Queue
logstash - Persistent Queues
queue.type
● default: memory
● persisted
○ Info
logstash -
Persistent Queues
Summary
- set queue.type is “persisted”
Advertisement time !!
https://tw.yardian.com/
https://us.yardian.com/

DevOps Taiwan meetup #19

  • 1.
    DevOps Taiwan Meetup#19 - 那些年 我們踩的 CI 坑 Len Chang, December 14 2018
  • 2.
    Outline ● Me ● IssuesDiscussion ○ CI / CD of gitlab ○ CI / CD of bitbucket ○ logstash of Elastic ● Advertisement time !!
  • 3.
    Me Fear is achoice ~ https://www.linkedin.com/in/huailunchang/
  • 4.
  • 5.
    Q: How todeploy gitLab-runner ? Key word ● CI/CD of GitLab ● GitLab-runner
  • 6.
    Q: How todeploy gitLab-runner ? Step 1. ● open GitLab Server and follow the steps
  • 7.
    Q: How todeploy gitLab-runner ? Step 2. ● Set up gitlab-runner ● Set parameters
  • 8.
    Q: How todeploy gitLab-runner ? Step 3. ● Config setting
  • 9.
    Q: How todeploy gitLab-runner ? Something you need to care about…. ● permission is important !!!
  • 10.
    Q: How toclean gitLab-runner ? Key word ● NULL
  • 11.
    Q: How toclean gitLab-runner ?
  • 12.
    Q: How toclean gitLab-runner ? gitlab-runner verify --delete. It will delete runners that got removed from GitLab. Reference
  • 13.
    Q: How toclean gitLab-runner ? Something you need to care about…. ● Still .. NULL
  • 14.
    CI / CDof bitbucket
  • 15.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Key word ● Google App Engine ● Bitbucket Pipelines
  • 16.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Step 1. ● Apply GCP / Bitbucket account ● Make sure your app can run on local and match Google App Engine Environment Step 2. ● Get auth. key from GCP
  • 17.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Step 3. ● Bitbucket Setting a. Enable your settings
  • 18.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Step 4. ● Bitbucket Setting a. Set repository variables
  • 19.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Step 5. ● Bitbucket Setting a. write pipelines.yaml
  • 20.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Something you need to care about…. ● Limitations of Bitbucket Pipelines ○ Free 50 minutes ● Something will break down forever….
  • 21.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Key word ● Google Cloud Storage ○ https://cloud.google.com/storage/ ● Angular ○ https://angular.io/
  • 22.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Step 1. ● Apply GCP / Bitbucket account ● Make sure your angular app can run on local Step 2. ● Get auth. key from GCP
  • 23.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Step 3. ● Let google know we own the domain "test123.com" if it's not done before (do this on Google Search Console)
  • 24.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Step 4. ● Create a new bucket named "whatever.test123.com" and upload bundled webapp Step 5. ● Assign member named "allUsers" as the "Storage Object Viewer" of the bucket
  • 25.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Step 6. ● Set index.html as main page and 404 page
  • 26.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Step 7. ● Bitbucket Setting a. Enable your settings
  • 27.
    Q: How todeploy web (Angular) in Google Cloud Storage by Bitbucket Pipelines ? Step 8. ● Bitbucket Setting a. Set repository variables
  • 28.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Step 9. ● Bitbucket Setting a. write pipelines.yaml
  • 29.
    Q: How todeploy app in Google App Engine by Bitbucket Pipelines ? Something you need to care about…. ● gsutil -m rm gs://aaa.test1234.com/** ○ You need to push data into bucket first otherwise you will get exception
  • 30.
  • 31.
    How to uselogstash to read log files created by rsyslog? Key word ● logstash ● rsyslog
  • 32.
    How to uselogstash to read log files created by rsyslog? Q: logstash can’t read log files which “permission deny…..”
  • 33.
    How to uselogstash to read log files created by rsyslog? Q: logstash can’t read log files which “permission deny…..” /etc/syslog.conf (default value) ● $FileCreateMode 0644 ● $umask 0077 ○ Update to $umask 0022
  • 34.
    How to uselogstash to read log files created by rsyslog? Summary ● Permission is important….
  • 35.
  • 36.
    logstash - PersistentQueues queue.type ● default: memory ● persisted ○ Info
  • 37.
    logstash - Persistent Queues Summary -set queue.type is “persisted”
  • 38.