
📅 2017-06-01
最近两周一直没有抽出时间写点Kubernetes的东西,这篇学习一下Kubernetes对Pod的调度。我们先来复习一下Kubernetes的一些基本概念。
Kubernetes的基本概念
#
Kubernetes是一个基于容器技术的分布式架构平台,它首先是一个开源的容器集群管理系统,又是一个分布式系统开发、运维和支撑平台。
Kubernetes为容器应用提供了服务注册和发现、负载均衡、服务部署和运行、服务滚动升级、在线扩容和缩容、资源调度、资源配额管理等功能。
可以说Kubernetes具备完备的集群管理能力,贯串分布式系统开发、测试、部署、运维监控各个环节。
...📅 2017-05-20
1.变量声明和赋值
#
1.1 变量声明
#
let和const是新增的变量声明关键字,
它们与var的区别是,声明变量没有预解析。
1// 变量声明
2{
3 let num1 = 10
4 const max_len = 99
5 // max_len = 100 // 错误,常量不能修改
6}
7// console.log(num1) // 错误,超出了作用域
1.2 解构赋值
#
ES6允许按照一定的模式,从数组和对象中提取值,这被成为解构(Destructuring)
...📅 2017-05-19
Vue.js是一个渐进式的JavaScript框架。怎么理解"渐进式":
- 声明式渲染
- 组件系统
- 客户端路由
- 集中式状态管理
- 项目构建
1.CSS基础
#
2.JavaScript基础
#
3.Vue基础
#
4.第三方组件库
#
5.其他资源
#
📅 2017-05-18
在Vue项目中使用less
#
Less是一个CSS预编译器,它扩展了CSS语言添加了变量(variables),混合(mixins),函数(functions)等特性。
下面演示在Vue项目中使用less.
使用vue-cli创建项目:
1vue init webpack-simple vue-less
2cd vue-less
3npm i
安装webpack支持的less编译包:
...📅 2017-05-16
Prometheus是一个开源的监控系统和时序数据库。
Prometheus使用Go语言开发,是Google BorgMon监控系统的类似实现。
Prometheus架构
#
Prometheus使用的是Pull模型,Prometheus Server通过HTTP的pull方式到各个目标拉取监控数据。
...📅 2017-05-15
概述
#
kube-apiserver是Kubernetes集群的中心,集群中所有资源的创建和更新都是通过APIServer的Restful API实现的。
因此Kubernetes通过一系列的机制来保证APIServer的安全,包括APIServer的认证、授权以及本文我们要学习的准入控制Admission Control。
...📅 2017-05-11
环境
#
安装
#
下载最新稳定版源码:
1wget https://github.com/proftpd/proftpd/archive/v1.3.6.tar.gz
解压:
1tar -zxvf proftpd-1.3.6.tar.gz
编译:
1cd proftpd-1.3.6
2./configure --prefix=/usr/local/proftpd
安装:
创建运行用户:
1useradd -s /sbin/nologin proftpd
修改配置文件/usr/local/proftpd/etc/proftpd.conf:
1
2# Umask 022 is a good standard umask to prevent new dirs and files
3# from being group and world writable.
4Umask 0000
5
6User proftpd
7Group proftpd
8DefaultRoot ~
9SystemLog /home/proftpd/proftpd.log
10TransferLog /home/proftpd/proftpd-transfer.log
11
12PathDenyFilter "\\.ftp)|\\.ht)[a-z]+$"
13DenyFilter \*.*/
14
15
16UseReverseDNS off
17IdentLookups off
18ServerIdent off
19AllowRetrieveRestart on
20AllowStoreRestart on
21
22AuthOrder mod_auth_file.c
23AuthUserFile /usr/local/proftpd/etc/passwd
24AuthGroupFile /usr/local/proftpd/etc/group
25
26<Limit LOGIN>
27 AllowGroup admin
28 AllowGroup dev
29 AllowGroup ops
30 DenyAll
31</Limit>
32
33<Directory /home/proftpd/ftp>
34 AllowOverwrite on
35 HideNoAccess on
36 <Limit DIRS>
37 AllowAll
38 </Limit>
39 <Limit STOR RMD MKD>
40 DenyAll
41 </Limit>
42</Directory>
43
44<Directory /home/proftpd/ftp/dev>
45 AllowOverwrite on
46 HideNoAccess on
47 <Limit DIRS>
48 AllowGroup dev
49 AllowGroup admin
50 DenyAll
51 </Limit>
52</Directory>
53
54<Directory /home/proftpd/ftp/dev/*>
55 AllowOverwrite on
56 HideNoAccess on
57 <Limit READ DIRS>
58 AllowGroup dev
59 AllowGroup admin
60 DenyAll
61 </Limit>
62 <Limit MKD STOR RMD DELE>
63 AllowGroup dev
64 AllowGroup admin
65 DenyAll
66 </Limit>
67</Directory>
68
69<Directory /home/proftpd/ftp/ops>
70 AllowOverwrite on
71 HideNoAccess on
72 <Limit DIRS>
73 AllowGroup ops
74 AllowGroup admin
75 DenyAll
76 </Limit>
77</Directory>
78
79<Directory /home/proftpd/ftp/ops/*>
80 AllowOverwrite on
81 HideNoAccess on
82 <Limit READ DIRS>
83 AllowGroup ops
84 AllowGroup admin
85 DenyAll
86 </Limit>
87 <Limit MKD STOR RMD DELE>
88 AllowGroup ops
89 AllowGroup admin
90 DenyAll
91 </Limit>
92</Directory>
AuthOrder
指定权限检查顺序,这里mod_auth_file.c
只使用虚拟用户- 注意删除配置文件中的
<Anonymous ~ftp>...</Anonymous>
- 关于配置的umask配置项可以查看Umask
- umask即权限掩码,系统的umask默认值是0022,可以使用umask命令查看,此时创建的文件的默认权限是644(6-0,6-2,6-2),创建的目录的默认权限是755(7-0,7-2,7-2),umask的作用就是用来设置控制默认权限。
1touch /usr/local/proftpd/etc/passwd
2chmod o-rwx /usr/local/proftpd/etc/passwd
3
4touch /usr/local/proftpd/etc/group
5chmod o-rwx /usr/local/proftpd/etc/group
systemd unit文件/usr/lib/systemd/system/proftpd.service:
...📅 2017-05-11
环境
#
- CentOS 7.3 192.168.61.100
- JDK 1.8
安装
#
创建运行用户:
1groupadd confluence
2useradd -g confluence -d /home/confluence -s /sbin/nologin confluence
这里使用的是zip格式的安装包。
1unzip -d /home/confluence/ bc-atlassian-confluence-6.2.0.zip
创建数据目录:
1mkdir /home/confluence/data
修改/home/confluence/atlassian-confluence-6.2.0/confluence/WEB-INF/classes
,在最下方加入:
...📅 2017-05-10
环境
#
- 服务器CentOS 7
- 服务器上已经装好JDK 1.8
- Jenkins版本2.60
Jenkins安装
#
下载安装包:
1wget https://pkg.jenkins.io/redhat/jenkins-2.60-1.1.noarch.rpm
安装:
1yum localinstall jenkins-2.60-1.1.noarch.rpm
创建JENKINS_HOME
目录:
1mkdir /home/jenkins
2chown jenkins:jenkins /home/jenkins
📅 2017-05-10
环境
#
- CentOS 7.3 192.168.61.100
下载JIRA Linux Installer
#
本文将使用JIRA的Linux Installer进行安装,先下载:
1wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.3.6-x64.bin
运行JIRA Linux Installer
#
1chmod u+x atlassian-jira-software-7.3.6-x64.bin
2
3./atlassian-jira-software-7.3.6-x64.bin
根据向导提示一步一步安装:
- 安装类型:
Choose the appropriate installation or upgrade option.
选2Custom Install (recommended for advanced users) [2, Enter]
- 安装位置:
Where should JIRA Software be installed?[/opt/atlassian/jira]
输入回车默认该位置 - 数据目录:
Default location for JIRA Software data[/var/atlassian/application-data/jira]
输入/home/jira
- 端口:
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
,输入2
进行定制,HTTP Port Number[8080]
输入18080
,Control Port Number[8005]
输入18005
- 安装为服务:
You may choose to run JIRA as a service, which means it will start
输入y
回车 - 开始安装:
Install [i, Enter], Exit [e]
,输入i
回车 - 安装后启动服务:
Start JIRA Software 7.3.6 now?Yes [y, Enter], No [n]
,输入y
回车
配置JIRA
#
数据库配置
#
在已经准备好的MySQL实例中创建JIRA的数据库:
...