2019년 8월 11일 일요일
CNI
kubernetes CNI (Container Network Interface) : Calico, Canal, Flannel, Kube-router, Romana, Weave Net 등의 컨테이너 네트워크
2019년 8월 10일 토요일
download kubectl
For windows : http://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/windows/amd64/kubectl.exe
For Linux : curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
For Linux : curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
2019년 3월 10일 일요일
register gitlab-runner
[Pre requisite]
1. edit /etc/hosts for adding gitlab server
$ cat /etc/hosts
127.0.0.1 localhost holyxlat.com
[add certificate file to /etc/gitlab-runner/certs]
$ mkdir /etc/gitlab-runner/certs
$ cp /etc/gitlab/ssl/holyxlat.com.crt /etc/gitlab-runner/certs/. // sample for my case
[Register gitlab-runner]
$ sudo gitlab-runner register
Runtime platform arch=amd64 os=linux pid=2305 2 revision=4745a6f3 version=11.8.0
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://holyxlat.com/
Please enter the gitlab-ci token for this runner:
<My Token>
Please enter the gitlab-ci description for this runner:
[<my host>]: test-gitlab-ci
Please enter the gitlab-ci tags for this runner (comma separated):
test-gitlab-ci
Registering runner... succeeded runner=SvgtcSrN
Please enter the executor: ssh, docker-ssh+machine, kubernetes, docker, parallel s, shell, virtualbox, docker+machine, docker-ssh:
docker
Please enter the default Docker image (e.g. ruby:2.1):
alpine:latest
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
1. edit /etc/hosts for adding gitlab server
$ cat /etc/hosts
127.0.0.1 localhost holyxlat.com
[add certificate file to /etc/gitlab-runner/certs]
$ mkdir /etc/gitlab-runner/certs
$ cp /etc/gitlab/ssl/holyxlat.com.crt /etc/gitlab-runner/certs/. // sample for my case
[Register gitlab-runner]
$ sudo gitlab-runner register
Runtime platform arch=amd64 os=linux pid=2305 2 revision=4745a6f3 version=11.8.0
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://holyxlat.com/
Please enter the gitlab-ci token for this runner:
<My Token>
Please enter the gitlab-ci description for this runner:
[<my host>]: test-gitlab-ci
Please enter the gitlab-ci tags for this runner (comma separated):
test-gitlab-ci
Registering runner... succeeded runner=SvgtcSrN
Please enter the executor: ssh, docker-ssh+machine, kubernetes, docker, parallel s, shell, virtualbox, docker+machine, docker-ssh:
docker
Please enter the default Docker image (e.g. ruby:2.1):
alpine:latest
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
2019년 3월 8일 금요일
gitlab build error (Connection Refused) windows + virtualbox + docker
Cloning repository...
Cloning into '/builds/root/test-project'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@holyxlat.com/root/test-project.git/': Failed to connect to holyxlat.com port 443: Connection refused
/bin/bash: line 69: cd: /builds/root/test-project: No such file or directory
$ ifconfig -a
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:91ff:fe0c:ada6 prefixlen 64 scopeid 0x20<link>
ether 02:42:91:0c:ad:a6 txqueuelen 0 (Ethernet)
RX packets 15 bytes 2171 (2.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112 bytes 22834 (22.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ vi /etc/gitlab-runner/config.toml
[[runners]]
name = "test-runner"
url = "https://holyxlat.com"
token = "gpp2ahsxs8xkB4AeZZxX"
executor = "docker"
[runners.docker]
tls_verify = false
image = "java:8"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock","/cache"]
shm_size = 0
extra_hosts = ["holyxlat.com:127.0.0.1","holyxlat.com:172.17.0.1"]
Cloning into '/builds/root/test-project'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@holyxlat.com/root/test-project.git/': Failed to connect to holyxlat.com port 443: Connection refused
/bin/bash: line 69: cd: /builds/root/test-project: No such file or directory
$ ifconfig -a
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:91ff:fe0c:ada6 prefixlen 64 scopeid 0x20<link>
ether 02:42:91:0c:ad:a6 txqueuelen 0 (Ethernet)
RX packets 15 bytes 2171 (2.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112 bytes 22834 (22.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ vi /etc/gitlab-runner/config.toml
[[runners]]
name = "test-runner"
url = "https://holyxlat.com"
token = "gpp2ahsxs8xkB4AeZZxX"
executor = "docker"
[runners.docker]
tls_verify = false
image = "java:8"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock","/cache"]
shm_size = 0
extra_hosts = ["holyxlat.com:127.0.0.1","holyxlat.com:172.17.0.1"]
2019년 3월 7일 목요일
gitlab "fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@holyxlat.com/root/test-project.git/': Could not resolve host:
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@holyxlat.com/root/test-project.git/': Could not resolve host: holyxlat.com
/bin/bash: line 69: cd: /builds/root/test-project: No such file or directory
ERROR: Job failed: exit code 1
[solution]
$ vi /etc/gitlab-runner/config.toml
[[runners]]
name = "test-runner"
url = "https://holyxlat.com:1443"
token = "gpp2ahsxs8xkB4AeZZxX"
executor = "docker"
[runners.docker]
tls_verify = false
image = "java:8"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
extra_hosts = ["holyxlat.com:127.0.0.1"] // ["<hostname>":"<ip address>"]
/bin/bash: line 69: cd: /builds/root/test-project: No such file or directory
ERROR: Job failed: exit code 1
[solution]
$ vi /etc/gitlab-runner/config.toml
[[runners]]
name = "test-runner"
url = "https://holyxlat.com:1443"
token = "gpp2ahsxs8xkB4AeZZxX"
executor = "docker"
[runners.docker]
tls_verify = false
image = "java:8"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
extra_hosts = ["holyxlat.com:127.0.0.1"] // ["<hostname>":"<ip address>"]
2019년 3월 6일 수요일
gitlab-runner "x509: certificate signed by unknown authority"
ERROR: Registering runner... failed runner=sohsMZnj status=couldn't execute POST against https://holyxlat.com:443/api/v4/runners: Post https://holyxlat.com:443/api/v4/runners: x509: certificate signed by unknown authority
PANIC: Failed to register this runner. Perhaps you are having network problems
[solution]
$ mkdir /etc/gitlab-runner/certs
$ cp /etc/gitlab/ssl/holyxlat.com.crt /etc/gitlab-runner/certs/.
PANIC: Failed to register this runner. Perhaps you are having network problems
[solution]
$ mkdir /etc/gitlab-runner/certs
$ cp /etc/gitlab/ssl/holyxlat.com.crt /etc/gitlab-runner/certs/.
2019년 3월 5일 화요일
install gitlab-runner on linux (ubuntu x86_64)
$ uname -a
Linux shlee-VirtualBox 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
// Simply download one of the binaries for your system
$ sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
...
/usr/local/bin/gitl 100%[++++++++++++++++++=>] 29.28M 331KB/s in 10s
2019-02-21 06:50:17 (210 KB/s) - ‘/usr/local/bin/gitlab-runner’ saved [30703328/30703328]
// Give it permissions to execute
$ sudo chmod +x /usr/local/bin/gitlab-runner
// Create a GitLab CI user:
$ sudo useradd --comment 'Gitlab Runner' --create-home gitlab-runner --shell /bin/bash
//Install and run as service
$ sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
Runtime platform arch=amd64 os=linux pid=24039 revision=4745a6f3 version=11.8.0
$ sudo gitlab-runner start
Runtime platform arch=amd64 os=linux pid=24420 revision=4745a6f3 version=11.8.0
// Stop the service
$ sudo gitlab-runner stop
Linux shlee-VirtualBox 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
// Simply download one of the binaries for your system
$ sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
...
/usr/local/bin/gitl 100%[++++++++++++++++++=>] 29.28M 331KB/s in 10s
2019-02-21 06:50:17 (210 KB/s) - ‘/usr/local/bin/gitlab-runner’ saved [30703328/30703328]
// Give it permissions to execute
$ sudo chmod +x /usr/local/bin/gitlab-runner
// Create a GitLab CI user:
$ sudo useradd --comment 'Gitlab Runner' --create-home gitlab-runner --shell /bin/bash
//Install and run as service
$ sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
Runtime platform arch=amd64 os=linux pid=24039 revision=4745a6f3 version=11.8.0
$ sudo gitlab-runner start
Runtime platform arch=amd64 os=linux pid=24420 revision=4745a6f3 version=11.8.0
// Stop the service
$ sudo gitlab-runner stop
2019년 2월 24일 일요일
Install docker on ubuntu (virtualbox)
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
$ sudo apt update
$ apt-cache policy docker-ce
$ sudo apt install docker-ce
$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-02-21 01:49:25 KST; 4min 3s ago
Docs: https://docs.docker.com
Main PID: 17674 (dockerd)
Tasks: 9
CGroup: /system.slice/docker.service
└─17674 /usr/bin/dockerd -H fd://
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.282330531+09:00" level=w
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.282750349+09:00" level=w
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.283530253+09:00" level=w
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.289217028+09:00" level=i
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.561081241+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.162682683+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.657244633+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.665705060+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox systemd[1]: Started Docker Application Container Engine.
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.924950417+09:00" level=i
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
$ sudo apt update
$ apt-cache policy docker-ce
$ sudo apt install docker-ce
$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-02-21 01:49:25 KST; 4min 3s ago
Docs: https://docs.docker.com
Main PID: 17674 (dockerd)
Tasks: 9
CGroup: /system.slice/docker.service
└─17674 /usr/bin/dockerd -H fd://
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.282330531+09:00" level=w
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.282750349+09:00" level=w
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.283530253+09:00" level=w
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.289217028+09:00" level=i
2월 21 01:49:24 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:24.561081241+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.162682683+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.657244633+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.665705060+09:00" level=i
2월 21 01:49:25 shlee-VirtualBox systemd[1]: Started Docker Application Container Engine.
2월 21 01:49:25 shlee-VirtualBox dockerd[17674]: time="2019-02-21T01:49:25.924950417+09:00" level=i
2019년 2월 21일 목요일
Install gitlab ce on Ubuntu / virtualbox
$ cd /tmp
$ sudo apt-get update
$ sudo apt-get install -y curl openssh-server ca-certificates
$ sudo apt-get install -y postfix
$ sudo curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh
$ sudo bash /tmp/script.deb.sh
$ less /tmp/script.deb.sh
$ sudo apt install gitlab-ce
$ sudo ufw status
$ sudo ufw enable
$ sudo ufw status
$ sudo ufw allow http
$ sudo ufw allow https
$ sudo ufw allow OpenSSH
$ sudo ufw status
$ sudo ufw status
Status: active
To Action From
-- ------ ----
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
OpenSSH ALLOW Anywhere
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
$ // change external_url and letsencrypt in /etc/gitlab/gitlab.rb file
$ sudo gitlab-ctl reconfigure
(*) ref : https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-gitlab-on-ubuntu-18-04
$ sudo apt-get update
$ sudo apt-get install -y curl openssh-server ca-certificates
$ sudo apt-get install -y postfix
$ sudo curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh
$ sudo bash /tmp/script.deb.sh
$ less /tmp/script.deb.sh
$ sudo apt install gitlab-ce
$ sudo ufw status
$ sudo ufw enable
$ sudo ufw status
$ sudo ufw allow http
$ sudo ufw allow https
$ sudo ufw allow OpenSSH
$ sudo ufw status
$ sudo ufw status
Status: active
To Action From
-- ------ ----
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
OpenSSH ALLOW Anywhere
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
$ // change external_url and letsencrypt in /etc/gitlab/gitlab.rb file
$ sudo gitlab-ctl reconfigure
(*) ref : https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-gitlab-on-ubuntu-18-04
피드 구독하기:
글 (Atom)