mirror of https://github.com/crossplane/docs.git
docs snapshot for crossplane version `master`
This commit is contained in:
parent
1a60c1d8e9
commit
804b3bce00
|
@ -77,8 +77,6 @@ To store the credentials as a secret, run:
|
|||
```bash
|
||||
# retrieve profile's credentials, save it under 'default' profile, and base64 encode it
|
||||
BASE64ENCODED_AWS_ACCOUNT_CREDS=$(echo -e "[default]\naws_access_key_id = $(aws configure get aws_access_key_id --profile $aws_profile)\naws_secret_access_key = $(aws configure get aws_secret_access_key --profile $aws_profile)" | base64 | tr -d "\n")
|
||||
# retrieve the profile's region from config
|
||||
AWS_REGION=$(aws configure get region --profile ${aws_profile})
|
||||
```
|
||||
|
||||
At this point, the region and the encoded credentials are stored in respective
|
||||
|
@ -101,7 +99,6 @@ kind: ProviderConfig
|
|||
metadata:
|
||||
name: aws-provider
|
||||
spec:
|
||||
region: ${AWS_REGION}
|
||||
credentialsSecretRef:
|
||||
namespace: crossplane-system
|
||||
name: aws-account-creds
|
||||
|
|
|
@ -31,17 +31,6 @@ create a connection `Secret` with keys for `username`, `password`, and
|
|||
`endpoint`. We will then create a `Composition` for each provider that can
|
||||
satisfy a `PostgreSQLInstance`. Let's get started!
|
||||
|
||||
## Grant RBAC Permissions
|
||||
|
||||
Crossplane must be granted RBAC permissions to manage new infrastructure types
|
||||
that we define. This is covered in greater detail in the [composition] section,
|
||||
but you can easily run the following command now to grant all necessary RBAC
|
||||
permissions for the remainder of this quick start guide:
|
||||
|
||||
```console
|
||||
kubectl apply -f https://raw.githubusercontent.com/crossplane/crossplane/master/docs/snippets/compose/clusterrole.yaml
|
||||
```
|
||||
|
||||
## Create CompositeResourceDefinition
|
||||
|
||||
The next step is authoring an XRD that defines a `CompositePostgreSQLInstance`:
|
||||
|
@ -157,6 +146,7 @@ spec:
|
|||
kind: RDSInstance
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
dbInstanceClass: db.t2.small
|
||||
masterUsername: masteruser
|
||||
engine: postgres
|
||||
|
@ -215,6 +205,7 @@ spec:
|
|||
kind: VPC
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.0.0/16
|
||||
enableDnsSupport: true
|
||||
enableDnsHostNames: true
|
||||
|
@ -225,13 +216,14 @@ spec:
|
|||
kind: Subnet
|
||||
metadata:
|
||||
labels:
|
||||
zone: us-west-2a
|
||||
zone: us-east-1a
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.64.0/18
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
availabilityZone: us-west-2a
|
||||
availabilityZone: us-east-1a
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -239,13 +231,14 @@ spec:
|
|||
kind: Subnet
|
||||
metadata:
|
||||
labels:
|
||||
zone: us-west-2b
|
||||
zone: us-east-1b
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.128.0/18
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
availabilityZone: us-west-2b
|
||||
availabilityZone: us-east-1b
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -253,13 +246,14 @@ spec:
|
|||
kind: Subnet
|
||||
metadata:
|
||||
labels:
|
||||
zone: us-west-2c
|
||||
zone: us-east-1c
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.192.0/18
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
availabilityZone: us-west-2c
|
||||
availabilityZone: us-east-1c
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -267,6 +261,7 @@ spec:
|
|||
kind: DBSubnetGroup
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
description: An excellent formation of subnetworks.
|
||||
subnetIdSelector:
|
||||
matchControllerRef: true
|
||||
|
@ -277,6 +272,7 @@ spec:
|
|||
kind: InternetGateway
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
providerConfigRef:
|
||||
|
@ -286,7 +282,7 @@ spec:
|
|||
kind: RouteTable
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-west-2
|
||||
region: us-east-1
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
routes:
|
||||
|
@ -296,13 +292,13 @@ spec:
|
|||
associations:
|
||||
- subnetIdSelector:
|
||||
matchLabels:
|
||||
zone: us-west-2a
|
||||
zone: us-east-1a
|
||||
- subnetIdSelector:
|
||||
matchLabels:
|
||||
zone: us-west-2b
|
||||
zone: us-east-1b
|
||||
- subnetIdSelector:
|
||||
matchLabels:
|
||||
zone: us-west-2c
|
||||
zone: us-east-1c
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -310,6 +306,7 @@ spec:
|
|||
kind: SecurityGroup
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
groupName: crossplane-getting-started
|
||||
|
@ -328,6 +325,7 @@ spec:
|
|||
kind: RDSInstance
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
dbSubnetGroupNameSelector:
|
||||
matchControllerRef: true
|
||||
vpcSecurityGroupIDSelector:
|
||||
|
@ -713,10 +711,12 @@ kubectl get postgresqlinstances.database.example.org my-db
|
|||
> may want to look at other resources in your cluster. The following commands
|
||||
> will allow you to view groups of Crossplane resources:
|
||||
>
|
||||
> - `kubectl get claim`: get all resources of all claim kinds, like `PostgreSQLInstance`.
|
||||
> - `kubectl get composite`: get all resources that are of composite kind, like `CompositePostgreSQLInstance`.
|
||||
> - `kubectl get managed`: get all resources that represent a unit of external
|
||||
> infrastructure
|
||||
> - `kubectl get <name-of-provider>`: get all resources related to `<provider>`
|
||||
> - `kubectl get crossplane`: get all resources related to Crossplane
|
||||
> infrastructure.
|
||||
> - `kubectl get <name-of-provider>`: get all resources related to `<provider>`.
|
||||
> - `kubectl get crossplane`: get all resources related to Crossplane.
|
||||
|
||||
You should also see a `Secret` in the `default` namespace named `db-conn` that
|
||||
contains fields for `username`, `password`, and `endpoint`:
|
||||
|
@ -811,7 +811,7 @@ alongside your [OAM] application manifests.
|
|||
|
||||
<!-- Named Links -->
|
||||
|
||||
[last section]: provision-infrastructure.yaml
|
||||
[last section]: provision-infrastructure.md
|
||||
[composition]: ../introduction/composition.md
|
||||
[next section]: run-applications.md
|
||||
[OAM]: https://oam.dev/
|
||||
|
|
|
@ -88,7 +88,7 @@ kubectl create namespace crossplane-system
|
|||
helm repo add crossplane-master https://charts.crossplane.io/master/
|
||||
helm search repo crossplane-master --devel
|
||||
|
||||
helm install crossplane --namespace crossplane-system crossplane-master/crossplane --version <version> --devel
|
||||
helm install crossplane --namespace crossplane-system crossplane-master/crossplane --devel --version <version>
|
||||
```
|
||||
|
||||
For example:
|
||||
|
@ -155,7 +155,6 @@ kind: ProviderConfig
|
|||
metadata:
|
||||
name: aws-provider
|
||||
spec:
|
||||
region: us-west-2
|
||||
credentialsSecretRef:
|
||||
namespace: crossplane-system
|
||||
name: aws-creds
|
||||
|
|
|
@ -241,4 +241,4 @@ APIs of our choosing in the [next section].
|
|||
[Azure Database for PostgreSQL]: https://azure.microsoft.com/en-us/services/postgresql/
|
||||
[Resource Group]: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal#what-is-a-resource-group
|
||||
[ApsaraDB for RDS]: https://www.alibabacloud.com/product/apsaradb-for-rds-postgresql
|
||||
[next section]: publish-infrastructure.md
|
||||
[next section]: compose-infrastructure.md
|
||||
|
|
|
@ -49,7 +49,7 @@ kubectl create namespace crossplane-system
|
|||
helm repo add crossplane-master https://charts.crossplane.io/master/
|
||||
helm search repo crossplane-master --devel
|
||||
|
||||
helm install crossplane --namespace crossplane-system crossplane-master/crossplane --version <version> --devel
|
||||
helm install crossplane --namespace crossplane-system crossplane-master/crossplane --devel --version <version>
|
||||
```
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
|
|
@ -18,6 +18,7 @@ spec:
|
|||
kind: VPC
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.0.0/16
|
||||
enableDnsSupport: true
|
||||
enableDnsHostNames: true
|
||||
|
@ -28,13 +29,14 @@ spec:
|
|||
kind: Subnet
|
||||
metadata:
|
||||
labels:
|
||||
zone: us-west-2a
|
||||
zone: us-east-1a
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.64.0/18
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
availabilityZone: us-west-2a
|
||||
availabilityZone: us-east-1a
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -42,13 +44,14 @@ spec:
|
|||
kind: Subnet
|
||||
metadata:
|
||||
labels:
|
||||
zone: us-west-2b
|
||||
zone: us-east-1b
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.128.0/18
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
availabilityZone: us-west-2b
|
||||
availabilityZone: us-east-1b
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -56,13 +59,14 @@ spec:
|
|||
kind: Subnet
|
||||
metadata:
|
||||
labels:
|
||||
zone: us-west-2c
|
||||
zone: us-east-1c
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
cidrBlock: 192.168.192.0/18
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
availabilityZone: us-west-2c
|
||||
availabilityZone: us-east-1c
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -70,6 +74,7 @@ spec:
|
|||
kind: DBSubnetGroup
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
description: An excellent formation of subnetworks.
|
||||
subnetIdSelector:
|
||||
matchControllerRef: true
|
||||
|
@ -80,6 +85,7 @@ spec:
|
|||
kind: InternetGateway
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
providerConfigRef:
|
||||
|
@ -89,7 +95,7 @@ spec:
|
|||
kind: RouteTable
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-west-2
|
||||
region: us-east-1
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
routes:
|
||||
|
@ -99,13 +105,13 @@ spec:
|
|||
associations:
|
||||
- subnetIdSelector:
|
||||
matchLabels:
|
||||
zone: us-west-2a
|
||||
zone: us-east-1a
|
||||
- subnetIdSelector:
|
||||
matchLabels:
|
||||
zone: us-west-2b
|
||||
zone: us-east-1b
|
||||
- subnetIdSelector:
|
||||
matchLabels:
|
||||
zone: us-west-2c
|
||||
zone: us-east-1c
|
||||
providerConfigRef:
|
||||
name: aws-provider
|
||||
- base:
|
||||
|
@ -113,6 +119,7 @@ spec:
|
|||
kind: SecurityGroup
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
vpcIdSelector:
|
||||
matchControllerRef: true
|
||||
groupName: crossplane-getting-started
|
||||
|
@ -131,6 +138,7 @@ spec:
|
|||
kind: RDSInstance
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
dbSubnetGroupNameSelector:
|
||||
matchControllerRef: true
|
||||
vpcSecurityGroupIDSelector:
|
||||
|
|
|
@ -18,6 +18,7 @@ spec:
|
|||
kind: RDSInstance
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
dbInstanceClass: db.t2.small
|
||||
masterUsername: masteruser
|
||||
engine: postgres
|
||||
|
@ -41,4 +42,4 @@ spec:
|
|||
- fromConnectionSecretKey: username
|
||||
- fromConnectionSecretKey: password
|
||||
- fromConnectionSecretKey: endpoint
|
||||
- fromConnectionSecretKey: port
|
||||
- fromConnectionSecretKey: port
|
||||
|
|
|
@ -17,4 +17,3 @@ spec:
|
|||
namespace: crossplane-system
|
||||
name: aws-account-creds
|
||||
key: credentials
|
||||
region: ((AWS_REGION))
|
||||
|
|
|
@ -35,17 +35,9 @@ kubectl cluster-info > /dev/null || echo "KUBECONFIG is not configured properly"
|
|||
# if aws_profile is not provided, use default
|
||||
aws_profile="${aws_profile:-default}"
|
||||
|
||||
# if region is not provided, retrieve aws profile region from config
|
||||
AWS_REGION=$(aws configure get region --profile $aws_profile)
|
||||
|
||||
# retrieve aws profile credentials, save it under 'default' profile, and base64 encode it
|
||||
AWS_CREDS_BASE64=$(echo -e "[default]\naws_access_key_id = $(aws configure get aws_access_key_id --profile $aws_profile)\naws_secret_access_key = $(aws configure get aws_secret_access_key --profile $aws_profile)" | base64 | tr -d "\n")
|
||||
|
||||
if test -z "$AWS_REGION"; then
|
||||
echo "error retrieving region from aws config. "
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if test -z "$AWS_CREDS_BASE64"; then
|
||||
echo "error reading credentials from aws config"
|
||||
exit -1
|
||||
|
@ -53,6 +45,5 @@ fi
|
|||
|
||||
# build the secret and provider objects, and then apply it
|
||||
cat provider.yaml | sed \
|
||||
-e "s|((AWS_REGION))|"$AWS_REGION"|g" \
|
||||
-e "s|((AWS_CREDS_BASE64))|"$AWS_CREDS_BASE64"|g" \
|
||||
| kubectl apply -f -
|
|
@ -4,6 +4,7 @@ metadata:
|
|||
name: rdspostgresql
|
||||
spec:
|
||||
forProvider:
|
||||
region: us-east-1
|
||||
dbInstanceClass: db.t2.small
|
||||
masterUsername: masteruser
|
||||
allocatedStorage: 20
|
||||
|
|
Loading…
Reference in New Issue