Apr 11, 2019
TechnologyFollowing is the tips:
Create the minikube environment, and enable the helm/charts:
# minikube start --cpus 4 --memory 8192 --disk-size 60g
# helm init
Download the prometheus-operator from the official github repository, use
dependency update
for updating the dependency locally:
# cd prometheus-operator
# helm dependency update
Record the docker images before deployment:
# eval $(minikube docker-env)
# docker images>before.txt
Now deploy the helm/charts using:
# helm install --name newprom .
When all of the items were deployed, record the images via:
# docker images>after.txt
With the helm/charts folder and the before.txt
and after.txt
you could
making this helm/charts working offline.
# docker save -o prometheus-operator.tar grafana/grafana:6.0.2 kiwigrid/k8s-sidecar:0.0.13 quay.io/coreos/prometheus-config-reloader:v0.29.0 quay.io/coreos/prometheus-operator:v0.29.0 quay.io/prometheus/alertmanager:v0.16.1 quay.io/prometheus/prometheus:v2.7.1 k8s.gcr.io/kube-state-metrics:v1.5.0 quay.io/prometheus/node-exporter:v0.17.0 quay.io/coreos/configmap-reload:v0.0.1
# xz prometheus-operator.tar
# tag and push
Apr 10, 2019
TechnologyVagrantBox
ToBeAdded
Offline
Steps:
# wget ....../kubespray-2.8.4.tar.gz .
# tar xzvf kubespray-2.8.4.tar.gz
# cd kubespray-2.8.4
# vim inventory/sample/group_vars/k8s-cluster/addons.yml
helm_enabled: true
metrics_server_enabled: true
# vim inventory/sample/hosts.ini
[all]
node ansible_host=10.0.2.15 # ip=10.0.2.15 etcd_member_name=etcd1
[kube-master]
node
[etcd]
node
[kube-node]
node
[k8s-cluster:children]
kube-master
kube-node
# cat /etc/apt/sources.list
deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
# apt-add-repository ppa:ansible/ansible
# apt-get update
# apt-get install -y ansible python-pip python ntp dbus python-apt
# ansible --version
ansible 2.7.10
config file = /root/kubespray-2.8.4/ansible.cfg
configured module search path = [u'/root/kubespray-2.8.4/library']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609
# vim /etc/ssh/sshd_config
PermitRootLogin yes
# systemctl restart sshd
# ssh-keygen
# ssh-copy-id root@10.0.2.15
# apt-get install -y bind9 bind9utils ntp nfs-common nfs-kernel-server python-netaddr nethogs iotop
#### find all of the debs and upload it to deployment directory for replacing 1604debs.tar.xz
# ansible-playbook -i inventory/sample/hosts.ini cluster.yml
Apr 1, 2019
TechnologyConoha ipv6
Find the ipv6 addresses(should have 17 ipv6 addresses together):
Network Configuration
Edit the networking via:
# vim /etc/network/interfaces
# The primary network interface
auto ens3
iface ens3 inet dhcp
iface ens3 inet6 dhcp
accept_ra 1
# IPv6 configuration
iface ens3 inet6 static
pre-up modprobe ipv6
address xxxxxx
netmask 64
Restart the networking via service networking restart
, then you will get the
ipv6 address via:
# ifconfig | grep inet6
shadowsocks configuration
Edit the configuration :
# cat shadowsocks.json
{
"server":"::",
.....
"prefer_ipv6": true
}
Now restart the service of sss
Mar 22, 2019
TechnologyPrerequites
System infos:
# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
# vi /etc/yum.conf
keepcache=1
#### Configure yum.conf and install some packages
# yum install -y wget vim net-tools gcc
# vim /etc/seliconfig/config
SELINUX=disabled
# systemctl diable firewalld
Install foreman
Configure host first:
# hostnamectl set-hostname foreman.fuck.com
# vim /etc/hosts
10.192.192.2 foreman.fuck.com
Networking configuration like following(using nmtui):
Install via:
# sudo yum -y install https://yum.puppetlabs.com/puppet5/puppet5-release-el-7.noarch.rpm
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# sudo yum -y install https://yum.theforeman.org/releases/1.21/el7/x86_64/foreman-release.rpm
# sudo yum -y install foreman-installer
Mar 14, 2019
TechnologySystem
Install Ubuntu 18.04, 4 Core/ 4G memory, 50 G disk.
Install with basic sshd support.
Network planning:
10.192.189.0/24, no dhcp.
Network
Configure the networking via following commands:
# vim /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
enp1s0:
dhcp4: no
addresses: [10.192.189.2/24]
gateway4: 10.192.189.1
nameservers:
addresses: [223.5.5.5,180.76.76.76]
# netplan --debug apply
# systemctl disable systemd-resolved.service
# systemctl stop systemd-resolved.service
# rm -f /etc/resolv.conf
# echo nameserver 223.5.5.5>/etc/resolv.conf
Configure the hostname:
# sudo hostnamectl set-hostname foreman.fuck.com
# echo "10.192.189.2 foreman.fuck.com" | sudo tee -a /etc/hosts
Install foreman
Install foreman via following commands:
# hostnamectl set-hostname foreman.fuck.com
# echo "10.192.189.2 foreman.fuck.com"| sudo tee -a /etc/hosts
# apt-get update
# apt-get update
# sudo apt-get install ca-certificates
# wget https://apt.puppetlabs.com/puppet5-release-bionic.deb
# sudo dpkg -i puppet5-release-bionic.deb
# rm puppet5-release-bionic.deb
# echo "deb http://deb.theforeman.org/ bionic 1.19" | sudo tee /etc/apt/sources.list.d/foreman.list
# echo "deb http://deb.theforeman.org/ plugins 1.19" | sudo tee -a /etc/apt/sources.list.d/foreman.list
# apt-get -y install ca-certificates
# wget -q https://deb.theforeman.org/pubkey.gpg -O- | sudo apt-key add -
# apt-get update
# sudo apt-get install foreman-installer
# foreman-installer
# foreman-installer --enable-foreman-proxy --foreman-proxy-tftp=true --foreman-proxy-tftp-servername=10.192.189.2 --foreman-proxy-dhcp=true --foreman-proxy-dhcp-interface=eth0 --foreman-proxy-dhcp-gateway=10.192.189.1 --foreman-proxy-dhcp-nameservers="10.192.189.2" --foreman-proxy-dhcp-range="10.192.189.100 10.192.189.200" --foreman-proxy-dns=true --foreman-proxy-dns-interface=eth0 --foreman-proxy-dns-zone=fuck.com --foreman-proxy-dns-reverse=189.192.10.in-addr.arpa --foreman-proxy-dns-forwarders=8.8.8.8 --foreman-proxy-foreman-base-url=https://foreman.fuck.com --foreman-proxy-oauth-consumer-key=ceqCFsvS8qrVRv8W3pb5yWNs6Prt9iZS --foreman-proxy-oauth-consumer-secret=aYCHnyCzRXFuuy4nNXWthBKhPiNdfzJt
Refers to:
Status:
After a while, you will see the server has been detected and displayed in the
webpage:
Configuration for CentOS7
Download iso from mirror:
# wget http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso
# mount -t iso9660 ./CentOS-7-x86_64-Minimal-1810.iso /mnt
# cp -arv /mnt/* ./website
Create docker based website:
# apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# apt-key fingerprint 0EBFCD88
# add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# apt-get update && apt-get install -y docker-ce
# docker pull jrelva/nginx-autoindex:latest
# mkdir -p /opt/web
# docker run --name docker-nginx -p 7888:80 -d --restart=always -v /opt/web:/usr/share/nginx/html jrelva/nginx-autoindex
Host-> Installation Media, add new iso:
Host-> Operating System, Create new os:
Filled the description of the new os:
Choose x86_64:
Partition Tables we choose Kickstart default:
Associate the installation media with our centos 7.6:
Click submit, later we will choose template for provision.
Host-> Provision Templates, choose following templates and associate with
CentOS7_x86_64:
kickstart default finish
kickstart default
kickstart default ipxe
kickstart default pxelinux
kickstart default use data
Associate with template:
Next we will configure the subnet and the foreman-proxy items.