23
© 2015 VMware Inc. All rights reserved. Harbor integration with Kubernetes 郑泽宇 [email protected] 姜坦(Daniel) [email protected]

Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

© 2015 VMware Inc. All rights reserved.

Harbor integration with Kubernetes

郑泽宇 [email protected]姜坦(Daniel) [email protected]

Page 2: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Introducing Project Harbor

• An open source enterprise-class registry server.• Apache 2 license.• Initiated by VMware China.• To be developed and maintained by Chinese technology

community.• https://github.com/vmware/harbor/• 0.3.0 released this week!

2

Page 3: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

What is a Registry?

3

Page 4: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Why a private registry server?

• Almost all container users set up their own private registry • Efficiency

– LAN vs WAN– Internet connection is the pain for Chinese users

• Security– Intellectual property stays in organization– Access Control – Integration with enterprise identity, such as AD/LDAP

4

Page 5: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Key Features• Web Admin GUI• User management & access control

– User self-registration and password reset– AD/LDAP integration– RBAC, Project/repo granularity: admin, developer, guest

• Audit and logs• Policy based image replication.• Internationalization: 中文 and English• Restful API for integration• Easy deployment and customization with Docker compose

5

new in 0.3.0

new in 0.3.0

Page 6: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Access Control

6

Project

Members Images

Guest:

Developer:

Admin:

${Project}/ubuntu:14.04${Project}/nginx:1.8, 1.9${Project}/golang:1.6.2${Project}/redis:3.0

…...

docker pull ...

docker pull/push ...

Page 7: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

7

Page 8: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

8

Page 9: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Image replication (synchronization)

9

Project

Images

Policy

Image

Project

ImagesInitial replication

Imageincremental replication

(including image deletion)

Page 10: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Image replication (synchronization)

10

Harbor

Master - Slave

Harbor Harbor Harbor

Hierarchical

Harbor Harbor

Master - Master

Page 11: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

11

Page 12: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

12

Page 13: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Harbor Architecture

13

Registry v2Dockerclient

NginxAPI

Harbor

Browser

Auth

UI

DBAD /

LDAP

Admin Server

Log Collector

Replicajob service

RemoteRegistry

Page 14: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Harbor Roadmap

Future

HA Deployment,

More auth options,

labels for images….

14

Q2 2016

New UI

Image Replication

Page 15: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Call for Participation• Try, star and provide feedback, join wechat group.• Partnership in customer cases• Contribute to Project Harbor

– Fork and Pull Request– Submit Issue

• https://github.com/vmware/harbor/

15

Page 16: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Harbor系统架构

16

统一的网络入口

Docker镜像仓库MySQL数据/LDAP

ACL控制

Page 17: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Why Kubernetes?

17

Deployment

Deployment

Deployment Deployment

自动修复

Page 18: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Why Kubernetes?

Deployment

Deployment

Deployment Deployment

弹性扩容

Page 19: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Running Harbor on Kubernetes

• Step 1:容器化配置文件– 将配置文件容器化实现统一调度

– 静态配置文件• Email设置• Harbor管理员账号• …

Page 20: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Running Harbor on Kubernetes

• Step 2:动态配置文件– 内部服务地址 -> DNS

– Registry地址• Registry地址为Kubernetes中的地址• Kubernetes会动态生成IP• 死循环?

Page 21: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Running Harbor on Kubernetes

• Step 3:配置Registry地址– 使用rolling-update

• 先不设置IP,等IP产生好了之后再编译镜像

• 使用rolling-update更新镜像– 先启动Service

• 先只启动Service,等IP好了之后再编译镜像

• 用编译好的镜像启动Pod– DNS服务

Page 22: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Running Harbor on Kubernetes

• Step 4:支持HTTPS协议– 配置证书

• 获取证书• 替换cert文件

– 绕开证书• 编辑/etc/default/docker• 加入 DOCKER_OPTS="$DOCKER_OPTS–insecure-registry={HOST}“• 重启Docker: sudo service docker restart

Page 23: Harbor integration with Kubernetes - Huodongjia.com · Key Features • Web Admin GUI • User management & access control – User self-registration and password reset – AD/LDAP

Thank You!