? accurev ?    2020-06-08 14:03:25    699    0    0

Accurev workspace 有一个include/exclude 功能,可以在workspace 中增加规则,使workspace 只看到,只更新想关注的列表。
对于被排除在外的元素,不可见,不更新,不会提交,不影响


title

workspace Exploer

切换到workspace exploer
title

Include/Exclude View

在workspace 左侧导栏 下方,勾选 include/exclude view 右击文件视图上方会出现 include.exclude 功能的按扭
title

根据需要设置需要的视图效果

Include : 包含在视图
Include Directry Only : 只包含目录,不包含目录下的文件
Exclude : 排除在外
一个元素上只能有一种规则
顶部元素没有设置rule的,按默认显示

设置之后右侧视图上方展示workspace 的元素,下方展示元素上被设置的规则


例子

/gua/gua2/test1.txt
/hua/hua2/test2.txt
/hua/hua2/test1.txt
/dua/dua2/test/test3.txt

设置一个workspace ,使之更新时将/dua目录及目录下的文件排除在外,即workspace视图 对stream 的dua 目录不可见

  1. /dua :exclude

设置一个workspace ,使之更新时只会更新到/hua/hua2/test2.txt,对此文件外的其他文件及目录不可见。

  1. /dua :exclude
  2. /gua :exclude
  3. /hua :include directory only
  4. /hua/hua2 :include directory only
  5. /hua/hua2/test2.txt :include

Accurev 其他相关笔记
安装时报错:
http://blog.leanote.com/post/gua_l

? accurev ?    2020-05-15 15:11:26    572    1    0

Accurev GUI 里新建 stream 的界面有三个元素:

Stream Name: 自定义名称
Basis: 爸爸stream
Stream Type : stream 类型
Base Time : 基准时间


GUI 创建入口

新建 :Base stream 上右击菜单,new stream
修改 :在建成的stream 上右击菜单是,change stream
一般情况下我们新建的都是 Dynamic Stream ,图标是波浪线或时钟。


类型和时间

title


Dynamic Stream : 类型

这种类型的stream 的图标有两种,一种是三条波浪线,一种是时钟
两种情况可以互相转换,通过把basetime 从None 和 其他三种时间的切换实现

波浪线 :(none)

title
波浪线表示可以本流是实时同步父流同步的提交的,实时接收父流的修改,即两流从上而下的关系是畅通的意思, New stream 的页面,Based time里选 None , 即上下游之间无关时间闸门阻隔。

时钟 : ( now / transaction / special time )

title
时钟表示这个动态流上打上了一个时间闸门,即以basetime 里设置的时间作为一个时间节点,这个时间节点以后,在父流提交的东西,不会往下流到本流。
New stream 的页面,Based time 的 Now , Transaction # , specail time 三个选项都可以设置时间闸门。

now

会以创建时间为准,保存时,将当前时间转换成一个具体的时间戳。创建成功后再查看时间,是当时的now. 不同时间点now 都有不同含义。常用于需要最新修改,但是不要以后的修改流下来的情况

As transaction

在base stream 的history 里,每一条promote 都有一个对应的transaction ID , 这背后也是对应着的一个时间戳,可以在该base time 的histroy 里选一条提交的transaction ID ,或者选全局的一个trans

2020-04-28 15:32:23    922    0    0

系统:ubuntu

软件:dnsmasq

安装:

  1. apt-get install -y dnsmasq

配置 /etc/dnsmasq.conf:

  1. root@node248:/etc/resolvconf/resolv.conf.d# cat /etc/dnsmasq.conf | grep -v "^#|^$"
  2. port=53
  3. resolv-file=/etc/resolv.conf
  4. strict-order
  5. listen-address=172.0.11.248
  6. addn-hosts=/etc/hosts

配置 /etc/hosts

  1. root@node248:/etc/resolvconf/resolv.conf.d# cat /etc/hosts
  2. #.....
  3. 172.0.11.2 vm2
  4. 172.0.11.3 vm3
  5. 172.0.11.4 vm4.com

配置 上游 nameserver

  1. 使用服务器本身的dns 列表,则resolv-file=/etc/resolv.conf

  2. 使用服务器上另外的dns 列表文件,即上游dns,则resolv-file=/etc/dnsmasq.d/ 此目录下放置 *conf

重启服务:

  1. #14
  2. service dnsmasq restart
  3. #18
  4. systemctl restart dnsmasq

解析过程:

客户端将此服务器ip 设置为dns 之后,查找域名时,会通过服务器的/etc/hosts 去解析域名,然后再通过resolv-file 中列的dns 去解析。

附不同ubuntu系统dns-nameserver的设置:

UBUNTU 14

  1. root@vm1:/etc/dnsmasq.d# cat /etc/resolvconf/resolv.conf.d/base
  2. nameserver 172.0.11.248
  3. root@vm1:/etc/dnsmasq.d# cat /etc/resolv.conf
  4. # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
  5. #
? k8s ?    2020-04-14 10:54:42    922    0    0


fluxCD

https://fluxcd.io/
The GitOps operator for Kubernetes


填补了构建和监控之间的空白 ,持续监控git库中的yaml和 registry的镜像

It fills the automation void that exists between building and monitoring.
Automated git->cluster synchronisation


配置存储库的同步

Flux的主要特性是版本控制存储库和集群之间的自动同步。如果对存储库进行任何更改,这些更改将自动部署到集群中。

所有配置都存储在版本控制中,并且本质上是最新的。在任何时候,任何人都可以完全以完全相同的配置状态重新创建集群。
对集群的更改对所有相关方都是立即可见的。
在事后分析期间,git日志为审计提供了完美的历史记录。
端到端,代码到生产管道不仅变得可能,而且容易。


配置容器的自动部署

另一个特性是容器的自动部署。它将持续监控一系列容器注册中心,并在适用的地方部署新版本。
这对于使存储库和集群保持最新非常有用。它允许单独的团队拥有自己的部署管道,因为Flux能够看到新映像并相应地更新集群。
可以禁用此功能,并将图像锁定到特定的版本。


集成其他配置工具,内置支持Kustomize和Helm

对于跨环境和集群的配置自定义,Flux提供了对Kustomize和Helm的内置支持。
对于高级部署模式,如Canary版本、A/B测试和蓝/绿部署,Flux可以和Flagger一起使用。


要求和局限性:

Requirements and limitations

  1. 目前一次只能处理一个库,技术限制,不会是永久问题
  2. 会忽略 heml/chart ,文件夹包含Chart.yaml and values.yaml 就会被跳过。
  3. 只能处理yaml 文件,会递归目录中的yaml 文件,不会解析文件夹结构意义
  4. 由于Flux在集群中的一个容器中运行,所以它可能无法解析您或Kubernetes能够解析的所有主机名。特别是,它将无法在localhost上提供
2020-04-09 13:49:47    523    0    0


 

ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable. This page provides a series of usage examples demonstrating how to create ConfigMaps and configure Pods using data stored in ConfigMaps.

ConfigMaps允许您将配置构件与映像内容解耦,以保持容器化应用程序的可移植性。这个页面提供了一系列使用示例,演示如何使用ConfigMaps中存储的数据创建ConfigMaps和配置Pods。

 

用kubectl create configmap创建

kubectl create configmap <map-name> <data-source>

 

--from-file

--from-file 可以跟路径,可以跟单个文件,可以多次使用跟多个文件

 
mkdir -p configure-pod-container/configmap/
# Download the sample files into `configure-pod-container/configmap/` directory
wget https://kubernetes.io/examples/configmap/game.properties -O configure-pod-container/configmap/game.properties
wget https://kubernetes.io/examples/configmap/ui.properties -O configure-pod-container/configmap/ui.properties
# Create the configmap
kubectl create configmap game-config --from-file=configure-pod-container/configmap/
kubectl create configmap game-config-2 --from-file=config
? k8s ?    2020-04-07 11:42:30    623    0    0

 

flagger

https://github.com/weaveworks/flagger

主要是推进
Flagger是Kubernetes公司的运营商,该公司使用Istio、Linkerd、App Mesh、NGINX、等高线或Gloo路由来自动提升canary部署,并使用Prometheus指标进行canary分析。canary分析可以通过webhook进行扩展,以运行验收测试、负载测试或任何其他自定义验证。

https://docs.flagger.app/

https://docs.flagger.app/usage/how-it-works

flagger 可以通过配置一个名为canary的自定义资源,将Kubernetes工作负载的发布过程自动化。

A canary resource can target a Kubernetes Deployment or DaemonSet.

Kubernetes Deployment example:

Based on the above configuration, Flagger generates the following Kubernetes objects:

  • deployment/<targetRef.name>-primary

  • hpa/<autoscalerRef.name>-primary

Flagger will detect changes to the target deployment (including secrets and configmaps) and will perform a canary analysis before promoting the new version as primary.

If the target deployment uses secrets and/or configmaps, Flagger will create a copy of each object using the -primary prefix and will reference these objects in the primary deployment、

Note that the target deployment must have a single label selector in th

? shell ?    2020-04-03 10:07:53    3022    1    0

 

设置密码复杂度

http://www.linux-pam.org/Linux-PAM-html/sag-pam_cracklib.html

安装libpam-cracklib

apt-get install libpam-cracklib

 

修改文件 /etc/pam/common-password 中的配置,修改完保存即生效。

如果有加enforce_for_root​ ,则对root 有效。

默认对root无效。 当root 为操作修改的用户时,虽然会提示,但是仍能修改成功。

 

vi common-password

password        requisite                       pam_cracklib.so retry=3 minlen=8 difok=3 dcredit=-1 ocredit=-1 enforce_for_root​

以上例子为:可重试三次,密码最少8个字符,与旧密码至少3个字符不同,至少一个数字,至少一个符号,对root操作也有效。


 

http://www.linux-pam.org/Linux-PAM-html/sag-pam_cracklib.html

-----------------


difok=N

This argument will change the default of 5 for the number of character changes in the new password that differentiate it from the old password.

minlen=N

The minimum acceptable size for the new password (plus one if credits are not disabled which is the default). In addition to the number of characters in the new password, credit (of +1 in length) is given for each different kind of character (other, upper, lower and digit). The default for this parameter is 9 whic

? k8s ?    2020-03-31 14:04:14    2921    0    3

项目源码:

https://github.com/tektoncd/pipeline

The Tekton Pipelines project provides k8s-style resources for declaring CI/CD-style pipelines.
Tekton管道项目为声明CI/ cd风格的管道提供了k8风格的资源。


 

 安装

Install Tekton Pipelines

kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml

Install Tekton CLI (tkn)

curl -LO https://github.com/tektoncd/cli/releases/download/v0.7.1/tkn_0.7.1_Linux_x86_64.tar.gz

# Change destination directory as needed
tar xvzf tkn_0.7.1_Linux_x86_64.tar.gz -C ~/bin
​

Install Tekton dashboard 仪表盘

kubectl apply --filename https://github.com/tektoncd/dashboard/releases/download/v0.5.1/tekton-dashboard-release.yaml


更改镜像源

默认镜像源安装时的问题解决:

其中:https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml

https://github.com/tektoncd/dashboard/releases/download/v0.5.1/tekton-dashboard-release.yaml

两个yaml 中创建资源时,pull 镜像用的镜像库是国外的,gcr.io 需要替换成国内的镜像源:gcr.azk8s.cn

如果使用原来的gcr.io , 资源创建成功后在启动的过程中,pod状态一直是 imagepullbackoff , 查看pod 内部,是无法pull 镜像所致。

get pods --na
2020-03-19 15:24:02    770    0    0

新装系统 ubuntu 时,安装界面会让我们新建一个非root帐号,这个帐号有sudo 权限,记住装机时设置的用户密码。

在安装界面 安装预装软件时,最好将ssh勾上, 这样在初始设置时会比较方便一点。


1. 从普通用户登入root

Login: username

password:username-password

 

进入系统之后,执行

sudo passwd​

输入三次密码,第一次为用户自己的密码,第二次第三次为root的新密码和密码确认。

看到提示密码修改成功之后,执行su ,  输入刚刚设置的root 密码,切换到root 用户。

su​

2.设置静态ip

ubuntu 18 和 14 的网络配置方式不同,ubuntu 18 需要设置netplan下的XXXX.yaml

其中注意使用yaml 的格式。

注意gateway4 表示ip4的gw ,以及gw 这一行不需要方括号 [ ]

dns 的ip应该再缩进一层再书写。

修改完毕之后,netplan apply 使用配置生效。

root@vm3:~# cd /etc/netplan
root@vm3:~# cat /etc/netplan/01-netcfg.yaml 
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      addresses: [172.0.11.155/24]
      gateway4: 172.0.11.1
      nameservers:
        addresses: [8.8.8.8, 114.114.114.114]
      dhcp4: no
      dhcp6: no
root@vm3:~# netplan apply 



3. 允许root 使用ssh 远程登录

修改PermitRootLogin项的值为yes , 然后重启ssh 服务

root@vm3:~# cat /etc/ssh/sshd_config | grep Root

# the setting of "PermitR
2020-03-19 14:51:38    1076    0    0

在Centos 7.6 中,进行kvm 安装,virt-install 之后,在图形图面中,鼠标可以使用,键盘不可以使用,按键之后图形界面无反应,但是每按一次键盘CLI终端有一行warning 输出。

(virt-viewer:32227): GSpice-CRITICAL **: 02:22:38.179: send_key: assertion 'scancode != 0' failed

 


virt-install --name vm1 -r 8192 --disk path=/var/lib/libvirt/images/vm1.img,size=20 --vcpu=2 --network bridge=br0,model=e1000 --cdrom=/public/ubuntu-18.04.2-server-amd64.iso
Starting install...
Allocating 'vm1.img'                                                                                                              |  20 GB  00:00:01     
(virt-viewer:32227): GSpice-WARNING **: 02:22:36.541: PulseAudio context failed Connection refused
(virt-viewer:32227): GSpice-WARNING **: 02:22:36.541: pa_context_connect() failed: Connection refused
(virt-viewer:32227): GSpice-WARNING **: 02:22:36.605: Warning no automount-inhibiting implementation available
(virt-viewer:32227): vnc-keymap-WARNING **: 02:22:36.642: Unknown keycode mapping '(null)'.
Please report to gtk-vnc-list@gnome.org
including 
5/12