Cloud Foundry 2. 核心概念

简介: Cloud Foundry 2. 核心概念

文章目录

Chapter Overview

Orgs and Spaces

Targeting

Scope and Names

Role-Based Access Control (RBAC)

Global Roles

Org Roles

Space Roles

Resource Names

GUIDs

Renaming

Tidy Up

Chapter Overview

This module reviews the constructs that allow Cloud Foundry to securely and effectively support multiple users, projects, and tenants.


Orgs and spaces are used to divide up a Cloud Foundry instance so that it can be used by multiple teams, projects, tenants, etc.

Role-based access control (RBAC) is used to control what you can do in Cloud Foundry.

Resource names provide human-readable labels to resources in Cloud Foundry.

Orgs and Spaces

Organizations (orgs) and spaces are logical separations within a Cloud Foundry instance. Spaces live within orgs, and a single org can contain one or more spaces.


Orgs are often used to separate tenants or projects. For example, you may want to divide your Cloud Foundry instance into separate orgs for different areas of your business. Within an org you might have separate spaces for different lifecycle stages, like development, staging, and production.


While you’re required to use orgs and spaces in Cloud Foundry, how you use them is up to you.

Targeting

To begin working with an org and/or space in Cloud Foundry, you must first target it. Targeting directs CLI commands to a specific org and space. The cf target command is used to change your target. It can also be used to show the org and space you are currently targeting (if any). You can see your current target by running:

cf target

You can change the org and space you are using by:

cf target -o <THE_ORG> -s <THE_SPACE>

You don’t need to do this now. For the time being, we will remain in the default org and space.

Scope and Names

In the previous section, we deployed an application to a space. Applications are always deployed to a space, and a space is always scoped to an org (you cannot push an app directly to an org). As you will see later in the course, other elements, including service instances and routes, are also scoped to spaces. As such, you need to target a space before you can begin managing that space’s resources.


When you deployed the app using cf push, you gave it a name (via the manifest) of first-push. Naming the app meant you could easily refer to it in Cloud Foundry. While names can be used as defaults by some commands (for example, in creating a route for your first-push app), they exist primarily for humans. We discuss resources names in more depth later in this module.


You can list details of your app by using its name:


cf app first-push


Because apps are scoped to a space, app names need to be unique in that space. However, they do not need to be unique outside the space. You could therefore have an app named first-push in development, staging, and production spaces. Other users may have their own app called first-push in their spaces as well.

1035234-20181020215539574-213176954.png

Role-Based Access Control (RBAC)

Cloud Foundry leverages Role-Based Access Control (RBAC) to restrict user actions that affect resources within the platform. Users can be assigned to roles globally (Cloud Foundry wide) or can be assigned to roles in specific orgs and spaces. Roles control what you can do and where you can do it.

Global Roles

Users can be assigned global roles and capabilities that span an entire Cloud Foundry deployment. As a developer using Cloud Foundry, it is unlikely you will be assigned one of these roles.


Click on each card to flip it and learn more about each global role.


Admin

Allows a user to perform operational actions on all orgs and spaces.

Admin-read-only

Allows visibility of all orgs and spaces without the ability to modify resources.

global auditor

Similar to the Admin Read-Only role, except that this role cannot see secrets such as environment variable content.

Org Roles

Org roles grant user access at the Org level.


Click on each card to flip it and learn more about each org role.


OrgManager

Can administer the org. OrgManagers can create/modify/delete spaces, org-level roles, domains, etc., in that org.

OrgAuditor

Have read-only access to the org.

BillingManager

Billing managers can create and manage billing account and payment information associated with an org in Cloud Foundry instances that have deployed the billing engine.You can see the users assigned to these roles for an org via:

cf org-users <ORG>

OrgManagers can manage users in your org with:

cf set-org-role

and

cf unset-org-role

Space Roles

Space roles grant user access at the space level.


Click on each card to flip it and learn more about space roles.


Space Manager

Space managers can administer roles for a space.

Space Devoper

Can manage apps, services, and routes in a space. A user must have the SpaceDeveloper role to push apps.

Space Auditor

Space auditors have read-only access to a space.You can see the users assigned to roles in a space with the command:

cf space-users <ORG> <SPACE>

Org roles do not cascade into spaces. For example, an OrgManager cannot deploy apps to spaces in their org. However, they can grant the SpaceDeveloper role to a user (including themselves) for a particular space.

SpaceManagers can manage users in your space with:

cf set-space-role

and

cf unset-space-role

You can also see all users assigned to org roles and space roles by running:

cf org-users <ORG> -a

1035234-20181020215539574-213176954.png

1035234-20181020215539574-213176954.png

Resource Names

You may have already noticed that the objects you create in Cloud Foundry have resource names assigned. For example, we ran cf push in a previous section, and we named the application first-push (defined in the app’s manifest).


Resource names are important. You’ll often refer to them when performing actions with the CLI, and in some cases, names are set according to a default. Think about the first-push example again. The app manifest includes random_route: true. This directive instructs Cloud Foundry to create a random route for our app using the resource name. If the random-route directive had not been set, a default route would have been created based on the resource name we chose i.e. http://first-push.<mydomain.io>.


Most resource names you encounter as a developer are scoped to a space. This means you can have apps with the same name in different spaces. For example, you might use the same name for apps deployed across the spaces development, staging, and production.


You’ll need to be wary of routing collisions where app names are duplicated across spaces, but we’ll discuss that later on.

GUIDs

Along with resource names, objects created in Cloud Foundry are assigned a globally unique identifier (GUID). Like resource names, an object’s GUID will sometimes be passed to CLI commands. Unlike resource names, guids are globally unique.

Renaming

You can rename certain objects in Cloud Foundry. When an object is renamed, the GUID does not change.

Let’s test this out on the first-push app. Before we do, let’s look at its current GUID:

cf app first-push --guid

Now, let’s try renaming it:

cf rename first-push renamed-app

Once this change succeeds, if you run cf app renamed-app --guid, you will notice that the app GUID is the same (and so is the app route). The route can be manually updated, and we’ll look at mapping and unmapping routes later in the course.

Tidy Up

You can go ahead and delete the renamed-app now - we won’t be needing it for the rest of this course.


cf delete -r renamed-app


The -r flag tells Cloud Foundry to also delete the route. We will discuss routes more in an upcoming section.

1035234-20181020215539574-213176954.png

相关文章
|
4月前
|
人工智能 弹性计算 API
阿里云服务器新手选购全解:轻量、ECS、GPU、AI云产品选型与性能实测
在云计算落地的过程里,开发者、小微企业以及AI从业者,总会遇到算力选型的难题。市面上有轻量应用服务器、ECS弹性云服务器、GPU加速实例以及各类AI云产品,产品形态繁多,定位差异巨大。不少使用者因为分不清产品边界,盲目选购高规格实例,造成预算白白消耗;也有人为了节约成本选择过低配置,业务上线之后频繁卡顿、推理超时,直接影响项目正常运行。
423 0
阿里云服务器新手选购全解:轻量、ECS、GPU、AI云产品选型与性能实测
|
5月前
|
人工智能 安全 BI
2026企业级Agent解决方案:落地实施路径
2026年是企业级AI智能体落地关键年,IDC预测活跃智能体年增超200%,但Gartner显示仅17%企业完成部署。瓴羊AgentOne以“Data×AI”双轮驱动,构建统一调度中枢,覆盖数据、客服、营销等五大场景,具备多模型融合、语义层打通、低代码编排与全栈安全能力,助力企业实现主动智能化升级。
|
5月前
|
人工智能 监控 API
‌阿里云百炼AI模型平台免费Tokens额度领取指南:问题解答、扣费及问题解答FAQ
阿里云百炼新用户开通即赠超7000万Tokens,70+主流模型各享100万免费额度(限中国内地版,有效期90天),仅支持实时推理调用。在阿里云百炼官网:https://t.aliyun.com/U/fPVHqY 免费领取千万Tokens
|
6月前
|
人工智能 供应链 小程序
从0到1搭建餐饮门店点餐预约配送小程序
本文详解餐饮小程序从0到1的搭建全过程,涵盖需求分析、模块设计(商品/购物车/预约/订单/配送/支付)、系统架构、多门店管理及云部署等关键环节,助力商家构建自主可控的数字化经营体系。(239字)
|
6月前
|
人工智能 弹性计算 开发者
2026年阿里云618活动攻略:时间、入口及优惠政策详解
2026阿里云618大促开启!主题“AI加速季,智惠生产力”,6月1日-30日限时开展。涵盖云服务器秒杀(低至38元/年)、上云满减券(最高减1728元)、Qwen 3.7大模型5折、全模型节省计划直省55%,及QoderWork首月0元等专属AI权益,助力开发者与企业低成本上云、高效用AI。(240字)
1100 2
|
5月前
|
人工智能 Rust 安全
Claude Code 动态工作流速通指南,多 Agent 干活效率起飞!
Claude Code 动态工作流保姆级科普,高频 AI 应用开发面试题,从 Claude 官方五种多 Agent 系统模式讲起,拆解动态工作流的运作机制、上下文隔离设计、交叉验证策略,对比传统多 Agent 框架的本质区别
459 0
|
5月前
|
弹性计算 运维 监控
阿里云VPC NAT网关配置完全指南:从零搭建企业级公网访问架构
本文系统讲解阿里云VPC中NAT网关的配置方法与核心原理。首先介绍NAT网关的产品定位与两种类型(公网NAT网关与VPC NAT网关)的区别,然后逐步拆解创建公网NAT网关、绑定弹性公网IP、配置SNAT条目实现VPC内无公网IP的ECS访问互联网、配置DNAT条目将内网服务暴露到公网的完整操作流程。深入分析路由表与NAT网关的协同工作机制、SNAT与DNAT的地址转换原理、多可用区高可用部署方案。结合阿里云CLI和Terraform提供自动化配置代码示例,涵盖按量计费模式下的成本构成、配额限制、常见故障排查方法(如SNAT无法访问公网、DNAT无法被公网访问等),并给出企业级最佳实践建议,帮
|
7月前
|
存储 人工智能 数据可视化
满足CNAS/CMA认证,实验室信息管理系统必备功能汇总
本资料为优检云LIMS系统合规功能指南,严格对标CNAS(ISO/IEC 17025)与CMA(RB/T 214)评审要求,涵盖审计追踪、分级权限、电子签名、数据防篡改等一票否决项,以及样品全周期、仪器直连、报告智能生成、资源要素管控、质量体系运行等核心模块,助力实验室高效通过资质认定与飞行检查。
|
7月前
|
安全 网络协议 文件存储
深度评测这么多内网穿透软件,还是这3款内网穿透软件值得推荐
在无公网IP环境下,内网穿透技术通过加密隧道实现安全远程访问。本文系统解析其原理、五大典型场景(远程办公、NAS访问、开发调试等),并从易用性、安全、速度等七维度对比快解析、ngrok、FRP三款主流工具,助您精准选型。(239字)
|
8月前
|
存储 人工智能 关系型数据库
【第2天】每天一个MySQL知识点,百日打怪升级
【MySQL第2天】深入解析InnoDB与MyISAM核心差异:事务支持、行锁vs表锁、崩溃恢复、外键及适用场景。10年DBA实战总结,助你避开选型陷阱,面试稳拿分!无脑选InnoDB,除非只读/日志等特殊需求。(239字)
455 3

热门文章

最新文章