分类: 未分类

  • Docker&AKS相关命令

    制作docker镜像

    docker build -t <your-name-for-the-image> –file <path-to-your-Dockerfile>  <path-to-project>

    例:docker build -t video-streaming –file Dockerfile .

    显示docker镜像

    docker image list

    docker镜像加载到容器

    docker run -d -p 3000:3000 video-streaming

    停止运行并删除容器

    docker kill <your-container-id>

    docker rm <your-container-id>

    彻底删除镜像

    docker rmi <your-image-id> –force

    利用compose批量挂载多个docker文件

    docker-compose up –build

    利用compose批量卸载多个docker文件

    docker-compose down

    docker-compose down && docker-compose up –build

    Docker镜像使用(阿里)

      “registry-mirrors”: [

        “https://j36f7zw9.mirror.aliyuncs.com

      ],

    Docker镜像进入

    $ sudo docker ps  

    $ sudo docker exec -it 775c7c9ee1e1 /bin/bash  

    Docker日志

    docker logs [OPTIONS] CONTAINER

    Azure的ACR的命令

    建立镜像库

    $registry = New-AzContainerRegistry -ResourceGroupName “myResourceGroup” -Name “myContainerRegistry007” -EnableAdminUser -Sku Basic

    登陆远端镜像库

    docker login flixtubeinfony.azurecr.io –username InfonyReg –password Qm/umaR8cjhdg93Bc/ZXTxmHeixMCDdV

    打标签,并push到远端镜像库

    docker tag flixtubeinfony.azurecr.io/video-streaming:latest

    docker push flixtubeinfony.azurecr.io/video-streaming:latest

    Azure Storage

        environment:

          – PORT=80

          – STORAGE_ACCOUNT_NAME=infony

          – STORAGE_ACCESS_KEY=YoYVUiph3v0Lmp9aNk+1F68kuHLddixJTdM4ZGtyBhzhb0yMpZiCruPnMtQvARhnzA8d2ocWOLOTWEHhqS37MQ==

    Terraform相关命令

    Terraform初期化/计划/执行/销毁

    terraform init

    terraform plan

    terraform apply -auto-approve

    terraform destroy

    K8S相关命令

    设定AKS的config文件

    az aks get-versions –location westus –output table

    az aks get-credentials –resource-group flixtube –name flixtube

    执行完后,建立~/.kube/config

    获取token示例

    az ad sp create-for-rbac –role=”Contributor” –scopes=”/subscriptions/a495fe79-8307-4153-b6c3-f40b487cc8f8″

      “appId”: “751258fd-a1a4-43f7-87a9-8b5060f227ad”,

      “displayName”: “azure-cli-2021-08-02-06-22-04”,

      “name”: “751258fd-a1a4-43f7-87a9-8b5060f227ad”,

      “password”: “SuE_Hg150LsDt_KCp3cruu-1cGCo8mRC_E”,

      “tenant”: “be8bec0d-1095-4b1d-b59f-e7412eb0b2f6”

    安装K8S Dashboard

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml

    Kubectl获取服务list,POD,LOG

    kubectl get services

    kubectl get pods 

    kubectl logs video-streaming-d578d6fd8-ncpx8 -p

  • 免费实用的PPT模板网站

    平时闲暇的时候有一个爱好,就是收集好看的PPT,以备今后不时之需。今天就介绍一下我经常使用的几个网站

    1. SlideModel

    这个是我最喜欢的网站,因为当初不知为什么给我一个一年免费会员账号,一天可以下载一个,一年攒下来,存了不少。现在虽然过期了,那里面的免费PPT也很漂亮,我基本上他一更新,我就下载下来了。

    2. PresentationGo

    虽然不怎么更新,但是概念图形类PPT非常丰富。我把喜欢的都下载下来了。

    3. showeet

    商业风格的PPT居多,都是完整成套的,下载即可直接使用。

    4. slideEgg

    PPT的颜色都很漂亮,VIP的一天下载一个,Free的一天下载5个。不过PPT本身主要素材居多,成套的比较少。

    5. 24slides

    这个网站最大的特色就是商业成套的PPT比较多,但是PPT数量不多,更新也比较慢。

    6. 其他一些网站,一些需要翻墙

    • http://googleslidesppt.com/
    • https://www.free-powerpoint-templates-design.com/
    • https://templates.office.com/en-us/templates-for-powerpoint
    • https://www.slideshare.net/
    • https://www.slidescarnival.com/
  • DevOps 2.0 is here, and it’s time to put end-to-end continuous delivery pipelines behind every project.

    mplementing end-to-end continuous delivery at the enterprise level has always been a challenge. It is a complex problem that requires simultaneous improvements across an organization’s structure, culture, application architecture, infrastructure and change management processes.

    This challenge is made more difficult by the fact that focusing improvement on only one aspect rarely leads to the desired results, because they are all closely linked and reinforce one another as part of an evolutionarily stable strategy. And attempting to improve all aspects at once is almost impossible at the enterprise level, due to the cumulative level of effort required. Different companies apply different strategies and achieve varying levels of success, but it is rare to find a company that has successfully achieved the right balance between efficiency, productivity and speed.

    However, the situation has been changing since the implementation of clouds, containers, microservices and automation across all levels of the software delivery process. Now, in 2019, technologies and best practices have evolved to a point where we can confidently say that the continuous delivery problem has been solved at the enterprise level. Of course, we are not talking about mainframes, but it is true for most brownfield modern applications and definitely the case for all greenfield development.

    All the necessary capabilities and techniques are now sufficiently well-known, and most are covered by technologies at the necessary levels of maturity. There remain some occasional gaps, however, they are being quickly addressed. And the big players, like Google, are already providing products and services for this new vision.

    The main contributor to solving the problem has been the establishment of well-defined interfaces between the application, infrastructure, platform and change management processes. It has helped to untangle organizational and technological dependencies and implement solutions for individual problems.

    Once the interfaces were established, infrastructure and platform components, which were the biggest bottlenecks, were quickly served with stable and feature-rich technologies from well-known cloud providers, such as: Google, Amazon and Microsoft. Remaining gaps have been filled with open source technologies released by large technology companies, such as: Netflix, Facebook, and LinkedIn, which had already spent large amounts of time and resources battling these problems internally.

    autosuggest_v2-27

    This division allowed for the establishment of service-oriented organizations, where each team develops and manages their own service end-to-end from development to production. Now infrastructure teams can deliver Infrastructure as a Service based on a robust cloud foundation. Platform teams use Infrastructure as a Service and provide microservices management platform capabilities as a service to application teams, closing the gap between raw infrastructure and applications.

    Even change management processes can now be implemented in a platform and provided as a service to application teams, with change management policies enforced at the enterprise level without limiting the flexibility of application teams. Finally, application teams can focus on application development and delivery. This can now be achieved without sacrificing efficiency through having human dependencies on infrastructure or change management teams or by implementing missing infrastructure and platform pieces.

    New capabilities of DevOps 2.0

    We will use the term DevOps 2.0 to describe the enterprise-level capability that solves the continuous delivery problem. Although the term DevOps has been overloaded, it is a well-known term, and is often used in a similar fashion. DevOps 2.0 brings a number of additional capabilities in the areas of organization, technology and process:

    autosuggest_v2-30

    Implementing them brings the state of continuous delivery and DevOps to a completely new level of organizational efficiency, speed and productivity, while retaining visibility and control.

    In this next section, we will provide a summary of what each capability means, what value it brings, and how it is supported with an open source or cloud-native technology stack. It is important to note that we are not touching traditional capabilities such as versioning, testing, monitoring, logging, security and others. It is possible to look at the technology advancements in these areas separately.

    Organization

    In a service-oriented organization, every team is working on their own product, which is available to other departments and teams as a service via an API (not self-service portals or emails). This allows organizations to scale indefinitely without a loss of efficiency. Since each team becomes a product team responsible for the requirements, development, testing, release and support of their product end-to-end, it increases the team’s agency, leading to overall higher employee satisfaction.

    Teams working on a service should be cross-functional teams to ensure the ability of the team to deliver the end result with minimal human dependencies on other teams. It doesn’t necessarily mean that each engineer in the team should possess all skills across development, testing, infrastructure, deployment, CICD, security, etc. Although excess specialization doesn’t lead to good results, healthy division of labor helps with productivity, and the organization’s ability to hire and train engineers.

    DevOps culture is enabled by a service-oriented organization and cross-functional teams. In many companies with existing DevOps departments, such departments should be built according to the principles of a service-oriented organization. In practical terms, it means that DevOps organization is split in the following way:

    1. Microservices platform – this works on top of vanilla Infrastructure as a Service and bridges the gap between application and infrastructure. This is achieved by implementing technology capabilities of service registry and discovery, secret management, deployment, application lifecycle management, service mesh, logging, monitoring, distributed tracing and others.
    2. CICD (change management) platform – this implements core tooling for build, code review, continuous integration, continuous deployment, test harness, audit trail, management dashboards and others. The platform is also used to enforce corporate change management policies according to executable policy principles.
    3. Specialized deployment and CI engineers embedded into application teams, where application developers lack skills in these areas.

    The site reliability engineering team replaces or augments traditional production support teams with the mission to convert reactive support efforts to proactive ones, increasing overall system SLOs.

    Technology

    Infrastructure as a Service or Cloud, is a foundation on which applications can be deployed and managed over a well-defined and battle-tested interface. Enterprises tried to create internal IaaS offerings for some time, however, reliability, stability and interfaces were generally subpar. This prevented the establishment of a foundation for application deployment automation and the creation of a truly service-oriented organization. Public cloud vendors changed the game, providing reliable infrastructure services. Large companies such as Google have now moved into private data centers, with offerings such as GKE on premise or Anthos, making reliable infrastructure interfaces possible even on premise.

    Immutable infrastructure, especially in the areas of compute and storage, dramatically reduces configuration issues during deployments and configuration drift in environments. It includes creating self-containing containers or VMs with application code and configuration during the build and CI cycle. It follows the “build once, deploy everywhere” principle, with minimal configuration differences between environments.

    Immutable networking infrastructure is an advanced technique that includes load balancing, firewall and in some cases subnet configurations. It is possible with modern cloud providers or platforms such as Kubernetes and Istio. Immutable infrastructure requires careful separation of application and environment configuration (properties). Application configuration typically includes memory, CPU and middleware settings that may seriously affect application stability, and are treated as application code from a change management perspective. Environment configuration is dynamic, includes endpoints of upstream dependencies, secrets and feature flags, and is provided to the application by microservices platform interfaces during runtime. It can be treated as data from a change management perspective.

    Microservices architecture is a well-known capability that requires well-designed small services that communicate with each other over API and can be delivered by small teams, which in turn follows the two-pizza rule for determining their size.

    The microservices platform provides a layer of additional services on top of the vanilla Infrastructure as a Service interface. It includes capabilities such as packaging, deployment, service registry, secret management, application lifecycle management, service mesh, etc. Major technologies include Kubernetes, Istio and Hashicorp stack. You can read more about it in one of our previous blog posts.

    The continuous delivery platform provides tooling to implement the end-to-end change management process from requirement management, source code repository, CI server, test harness, continuous deployment infrastructure and others. The most common tooling includes JIRA, Git, Jenkins, and Spinnaker. You can read more about it in one of our previous blog posts.

    Chaos engineering is both a process and technology capability. From a technology perspective, the chaos engineering platform should include necessary monitoring, logging, and failure induction tooling. The most common tools include Chaos Toolkit, Gremlin and Simian Army.

    Distributed tracing and OpenTracing standard is the new way of monitoring end-to-end flows in microservices environments and service mesh. Open source tooling includes Istio, Jaeger, Zipkin, and many others. It is still a new capability, but it is maturing quickly.

    Serverless computing further reduces the need to manage infrastructure, middleware, and platform components from an application standpoint. It allows for increases in the efficiency and productivity of application teams for certain types of applications. It is enabled by technologies such as AWS Lambda, Google Functions, and Knative.

    AI and ML are becoming necessary components of successful production operations. Production environments generate plenty of logging and monitoring data to do anomaly detection, perform predictive scaling and augment RCA. Change management platforms generate significant data that can be used for the optimization of processes and for determining best practices. These best practices can later be distributed across teams in the organization.

    Process

    Policy driven CI/CD takes high-level enterprise change management policies but redesigns processes and tools to automatically satisfy those policies. All sign-offs from development leads, test leads, security leads and operations leads are now implemented as executable policies and embedded into the pipeline. For example, a policy with a sign-off from the development lead may be implemented as a required code peer review, static code analysis rules and unit test success rate and coverage.

    With such a policy, each build passing these requirements automatically records development lead sign-off in the audit trail with the explanation and proof of how the policy was satisfied. Such policy definition can be created and changed only by the development lead, and it is of course versioned by itself. Since it is executable and automated in a CI process, it doesn’t reduce the efficiency of the development team from one side, ensuring full control over change management, and compliance with internal and external audit requirements from another. While such policy-driven CICD is not supported by CI platforms directly, it can be implemented in tools like Jenkins or Spinnaker.

    Single environment solves non-production environment creep and increased costs on dev/test environments. With the right microservices architecture, platform, service mesh and CICD process, services don’t need a large number of huge integration testing environments. Services can be tested in isolation on small environments during the CICD cycle and can be directly deployed to production for functional and user acceptance testing, canary releases and A/B testing.

    At this point, it is important to understand that deployment in the production environment doesn’t automatically mean acceptance of user traffic, meaning that the production environment can serve as an integration testing environment for properly designed applications. In the worst case scenario, during the transformation, the single environment can be split into two: production and staging, with the staging environment used for the last phases of quality assurance.

    Testing in production is a technique where significant testing is done directly in the production environment on the services that are deployed in blue-green mode, and are not accepting user traffic. This requires well-designed applications and service mesh capabilities, and in turn, enables single environment capability.

    Ultra-light process strives to keep most high-level change management policies in place, but implements them with completely new processes, procedures and tools. It is enabled by all capabilities outlined above, and uncovers the ultimate value of CICD.

    Closing notes

    We are confident that building DevOps 2.0 capabilities will bring digital organizational efficiency and productivity to a new level, and truly solve the continuous delivery problem. While it doesn’t cover certain legacy applications, we found that it works for many modern brownfield applications and all greenfield development.

    This article provides a high-level overview. If you are interested in more details:

    1. Read our blog post on microservices platform.
    2. Check the presentation we’ve been showing at Dynamic Talks.
    3. Get the Continuous Delivery Blueprint book.
    4. Reach out to us for a deep dive.

    Of course, even when the end state is clear, the transition will still require time, effort, and skills. But the result will be well worth the effort.

  • WordPress 的SSL设置

    去年买的华为云虚拟机到期了,续约就要上千大洋,苦于囊中羞涩,只好放弃。其实这一年也没用,就是停放wordpress而已,于是回到西部数码,388元能租1G空间五年,果断买下。

    于是又要重复每次的wordpress迁移。这次也不是很顺利,不过总算大体完成,博客开张了。心血来潮,看SSL只需要1元购买,1元部署,于是又搞了一个SSL证书。

    证书是有了,部署到服务器也很简单,问题是wordpress可不简单。来来回回曲折的一米。

    总结如下:

    Step1 部署服务器SSL,保证能访问
    Step2 修改conf文件,在if ( !defined(‘ABSPATH’) )前加入

    define('FORCE_SSL_LOGIN', true);//强制SSL登录和管理
    define('FORCE_SSL_ADMIN', true);//强制SSL登录和管理

    Step3 修改

    move your website to https change WordPress settings

    Step4 安装WP Force SSL插件,开启SSL

    大功告成。不知道为什么wordpress自己不能这么方便的切换呢。

  • 端午季节

    秋实开学日,背包如少年。
    初夏毕业季,挥袖亦难舍。
    来以梦为马,去不负韶华。
    聚如一团火,散如满天星。
    狮厂美如画,诸君前似锦。
    后会必有期,举杯徐庄月。

  • 人生的切换

    在2年前的端午,做了一次人生真正意义上的切换,离开了17年的公司,而今天也彻底和SUNING切断了所有联系。虽然只有短短的2年。但是对之前的依恋,以及对将来的迷惘一点也不比2年前的少。也许我一直就是一个恋旧的人,第一次如果不是心灰意冷到了无法忍受的程度,我想我现在肯定还在LIANDI,一方面想着如何突破自己,一方面却无可奈何的等待着最后钟声的响起。

    这次,由于已经提前在RF开始了奋斗,所以衔接算是很平滑了。今天骑上自己心爱的小电驴,向着徐庄出发,一路上一切都很熟悉,大部分和2年前初次相见也并没有变化,一幢新的企业总部正在打桩,而就在前方不远的苏宁体育的训练基地,则变成了一片瓦砾。苏宁体育,是我每天上班遇到的第一个苏宁元素,每次看到这座大堂式的建筑,以及广场上飞起一脚的金属雕塑,一直让我深切地体会到苏宁家大业大,无处不在。现在看到这片瓦砾以及上面还在钻孔的挖土机,我不知道我的苏宁的生活也是如此,嘎然而止,不复存在。

    进入了苏宁大楼,我已然没有了豆芽防疫战狮,只得按照要求提交行程,临了门卫对我说知道在哪里拿离职资料吧。我白了他一眼,我是办理离职,不是办理入职。

    拿到了资料,刻意走到了大楼的宽畅的走廊,与一位领导不期而遇。寒暄了几句,我怅然地离去,走出大门的一刻,感觉切换终于结束了。

    虽然已经早早地来到了新的公司。但是只有过了这个端午,我想我才能彻底地告诉自己,已然没有退路,现在只有向着前方,不管身后是瓦砾还是辉煌,都和我再有关,而前方,不管是荆棘还是鲜花,我都会义无反顾!

  • 17年的总结

    毕业之后,同一家公司,从programer做到开发部长,十七年光阴历历在目,多想洋洋洒洒呈现每一滴沉淀,却发现文字如此冗余拖沓。放弃了,简简单单说说吧。
    我最希望得到的评价,是一位技术狂热,积极进取的奋斗者。我引以为豪的三个能力:
    第一个,提案力。PPT精通,故事提炼,需求引导,演讲风采等等,与其说是能力矩阵,不如说是我心底一个产品运营思维的外露。
    第二个,技术力。我清楚当今IT细分浩如烟海,但对于新技术,特别是web前端栈,API栈,移动服务栈,总能孜孜不倦,乐于其中。无论走到哪里,我骨子里依然是个怀揣梦想的软件工程师。
    第三个,领导力。经过九年的Scrum实践。我深刻体会,共同理想和赞扬鼓励,比严格流程和追责防错要更重要。但是将两者矛盾起来,又是一个更大的陷阱。我最大的乐趣就是寻找每一个团队每一个时期的最佳实践。每次失或得,都是试错勇气的增长。

  • 在海的那边的思考

    这几天在见客户。一直担心南京有什么突发问题。
    从另外一个角度来说,我也体验了客户是如何在看中国发生的事情。

    如果我无法亲眼看到南京,那么非常希望南京能做到下面几点,
    你们也可以现象一下如果你们在日本,是不是同样希望远在大洋彼岸的伙伴能做到这些呢?

    1)反馈要快速
    其实很多时候,就算没有时间处理,只要回一个Mail或者一个信息,“知道了,我们考虑后回信”,都是对他人的一个尊重。而且,一直在等待消息,逐渐是会让对方崩溃,真的到了那个时候,你就算写一个极棒的回信,也很难挽回对方那种差差的感觉。
    * 而站在南京立场,自然思路是我都忙死了,或者我还没有想好,等我想好了再回这个Mail

    2)问题早说明
    问题说的要早,因为对方也希望能够一起参与。而不是到了覆水难收的时候,让对方成为被动的接受者。这种愤怒是油然而生的。因为即使你承认问题你有责任,可是却让他人背锅,莫名无辜感
    *而站在南京立场,自然想法都是,出个问题我就说,岂不是让人觉得我们很弱,与其花时间说清楚问题,还不如花时间研究清楚,确实解决不了再说吧。

    3)解决问题要积极向上
    说明问题相对简单,但是如何说明看待问题的态度却能直接影响对方的思考。如果问题发生,能提出方案,甚至实施的结果都有,那自然最好。如果暂时提不出方案,也应该是积极表态准备去探讨,去寻找的姿态。
    *而站在南京立场,自然想法都是,我说的严重些,悲观些,降低客户的预期,万一做到了还好呢,做不好反正我也说在前头了。这个手段确实存在,但是必须配合说明采取的措施和预期的效果。否则只会变成球抛过来的感觉。