diff --git a/docs/v0.13/cloud-providers/aws/aws-provider.md b/docs/v0.13/cloud-providers/aws/aws-provider.md index 8918f2c8..cbb6b339 100644 --- a/docs/v0.13/cloud-providers/aws/aws-provider.md +++ b/docs/v0.13/cloud-providers/aws/aws-provider.md @@ -28,7 +28,7 @@ Run `setup.sh` to read `aws` credentials and region, and create an `aws provider` instance in Crossplane: ```bash -curl -O https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/configure/aws/provider.yaml +curl -O https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/configure/aws/providerconfig.yaml curl -O https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/configure/aws/setup.sh ./setup.sh [--profile aws_profile] ``` diff --git a/docs/v0.13/getting-started/compose-infrastructure.md b/docs/v0.13/getting-started/compose-infrastructure.md index a58e539d..3f77d856 100644 --- a/docs/v0.13/getting-started/compose-infrastructure.md +++ b/docs/v0.13/getting-started/compose-infrastructure.md @@ -67,6 +67,11 @@ We will now install a `Configuration` that:
+> Note that this configuration will create an RDS instance using your default +> VPC, which may or may not allow connections from the internet depending on how +> it is configured. Select the AWS (New VPC) configuration if you wish to create +> an RDS instance that will allow traffic from the internet. + ```console kubectl crossplane install configuration crossplane/getting-started-with-aws:master ``` @@ -74,6 +79,11 @@ kubectl crossplane install configuration crossplane/getting-started-with-aws:mas
+> Note that this configuration for AWS also includes several networking managed +> resources that are required to provision a publicly available PostgreSQL +> instance. Composition enables scenarios such as this, as well as far more +> complex ones. See the [composition] documentation for more information. + ```console kubectl crossplane install configuration crossplane/getting-started-with-aws-with-vpc:master ``` @@ -267,9 +277,9 @@ Try the following command to watch your provisioned resources become ready: kubectl get crossplane -l crossplane.io/claim-name=my-db ``` -You should also see a `Secret` in the `default` namespace named `db-conn` that -contains keys that we defined in XRD. If they are filled by the composition, then -they should appear: +Once your `PostgreSQLInstance` is ready, you should see a `Secret` in the `default` +namespace named `db-conn` that contains keys that we defined in XRD. If they were +filled by the composition, then they should appear: ```console $ kubectl describe secrets db-conn diff --git a/docs/v0.13/getting-started/install-configure.md b/docs/v0.13/getting-started/install-configure.md index 93c5aaf7..a2cd6fbd 100644 --- a/docs/v0.13/getting-started/install-configure.md +++ b/docs/v0.13/getting-started/install-configure.md @@ -166,7 +166,8 @@ kubectl create secret generic aws-creds -n crossplane-system --from-file=key=./c ### Configure the Provider -Create the following `provider.yaml`: +We will create the following `ProviderConfig` object to configure credentials for AWS +Provider: ```yaml apiVersion: aws.crossplane.io/v1beta1 @@ -181,11 +182,8 @@ spec: name: aws-creds key: key ``` - -Then apply it: - ```console -kubectl apply -f provider.yaml +kubectl apply -f https://raw.githubusercontent.com/crossplane/crossplane/master/docs/snippets/configure/aws/providerconfig.yaml ```
@@ -229,28 +227,24 @@ kubectl create secret generic gcp-creds -n crossplane-system --from-file=key=./c ### Configure the Provider -Create the following `provider.yaml`: +We will create the following `ProviderConfig` object to configure credentials for GCP +Provider: -```yaml -apiVersion: gcp.crossplane.io/v1beta1 +```console +# replace this with your own gcp project id +PROJECT_ID=my-project +echo "apiVersion: gcp.crossplane.io/v1beta1 kind: ProviderConfig metadata: name: default spec: - # replace this with your own gcp project id - projectID: my-project + projectID: ${PROJECT_ID} credentials: source: Secret secretRef: namespace: crossplane-system name: gcp-creds - key: key -``` - -Then apply it: - -```console -kubectl apply -f provider.yaml + key: key" | kubectl apply -f - ```
@@ -293,7 +287,8 @@ kubectl create secret generic azure-creds -n crossplane-system --from-file=key=. ### Configure the Provider -Create the following `provider.yaml`: +We will create the following `ProviderConfig` object to configure credentials for +Azure Provider: ```yaml apiVersion: azure.crossplane.io/v1beta1 @@ -308,11 +303,8 @@ spec: name: azure-creds key: key ``` - -Then apply it: - ```console -kubectl apply -f provider.yaml +kubectl apply -f https://raw.githubusercontent.com/crossplane/crossplane/master/docs/snippets/configure/azure/providerconfig.yaml ``` @@ -327,12 +319,14 @@ kubectl crossplane install provider crossplane/provider-alibaba:v0.3.0 ### Create a Provider Secret ```console +# Replace and with your actual key id and key secret. kubectl create secret generic alibaba-creds --from-literal=accessKeyId= --from-literal=accessKeySecret= -n crossplane-system ``` ### Configure the Provider -Create the following `provider.yaml`: +We will create the following `ProviderConfig` object to configure credentials for +Alibaba Provider: ```yaml apiVersion: alibaba.crossplane.io/v1alpha1 @@ -346,13 +340,12 @@ spec: secretRef: namespace: crossplane-system name: alibaba-creds - key: credentials + # "key" field does not have any effect right now but it has to be given. + # See https://github.com/crossplane/crossplane-runtime/issues/215 + key: credentials ``` - -Then apply it: - ```console -kubectl apply -f provider.yaml +kubectl apply -f https://raw.githubusercontent.com/crossplane/crossplane/master/docs/snippets/configure/alibaba/providerconfig.yaml ``` diff --git a/docs/v0.13/getting-started/package-infrastructure.md b/docs/v0.13/getting-started/package-infrastructure.md index f8ba502c..d3ed4bbe 100644 --- a/docs/v0.13/getting-started/package-infrastructure.md +++ b/docs/v0.13/getting-started/package-infrastructure.md @@ -58,17 +58,6 @@ into a package. First we'll create a `CompositeResourceDefinition` (XRD) to define the schema of our `CompositePostgreSQLInstance` and its `PostgreSQLInstance` resource claim. - -
-
-
- ```yaml apiVersion: apiextensions.crossplane.io/v1alpha1 kind: CompositeResourceDefinition @@ -108,192 +97,9 @@ spec: ``` ```console -curl -OL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/package/aws/definition.yaml +curl -OL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/package/definition.yaml ``` -
-
- -```yaml -apiVersion: apiextensions.crossplane.io/v1alpha1 -kind: CompositeResourceDefinition -metadata: - name: compositepostgresqlinstances.database.example.org -spec: - claimNames: - kind: PostgreSQLInstance - plural: postgresqlinstances - connectionSecretKeys: - - username - - password - - endpoint - - port - crdSpecTemplate: - group: database.example.org - version: v1alpha1 - names: - kind: CompositePostgreSQLInstance - plural: compositepostgresqlinstances - validation: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - parameters: - type: object - properties: - storageGB: - type: integer - required: - - storageGB - required: - - parameters -``` - -```console -curl -OL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/package/aws-with-vpc/definition.yaml -``` - -
-
- -```yaml -apiVersion: apiextensions.crossplane.io/v1alpha1 -kind: CompositeResourceDefinition -metadata: - name: compositepostgresqlinstances.database.example.org -spec: - claimNames: - kind: PostgreSQLInstance - plural: postgresqlinstances - connectionSecretKeys: - - username - - password - - endpoint - - port - crdSpecTemplate: - group: database.example.org - version: v1alpha1 - names: - kind: CompositePostgreSQLInstance - plural: compositepostgresqlinstances - validation: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - parameters: - type: object - properties: - storageGB: - type: integer - required: - - storageGB - required: - - parameters -``` - -```console -curl -OL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/package/gcp/definition.yaml -``` - -
-
- -```yaml -apiVersion: apiextensions.crossplane.io/v1alpha1 -kind: CompositeResourceDefinition -metadata: - name: compositepostgresqlinstances.database.example.org -spec: - claimNames: - kind: PostgreSQLInstance - plural: postgresqlinstances - connectionSecretKeys: - - username - - password - - endpoint - - port - crdSpecTemplate: - group: database.example.org - version: v1alpha1 - names: - kind: CompositePostgreSQLInstance - plural: compositepostgresqlinstances - validation: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - parameters: - type: object - properties: - storageGB: - type: integer - required: - - storageGB - required: - - parameters -``` - -```console -curl -OL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/package/azure/definition.yaml -``` - -
-
- -```yaml -apiVersion: apiextensions.crossplane.io/v1alpha1 -kind: CompositeResourceDefinition -metadata: - name: compositepostgresqlinstances.database.example.org -spec: - claimNames: - kind: PostgreSQLInstance - plural: postgresqlinstances - connectionSecretKeys: - - username - - password - - endpoint - - port - crdSpecTemplate: - group: database.example.org - version: v1alpha1 - names: - kind: CompositePostgreSQLInstance - plural: compositepostgresqlinstances - validation: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - parameters: - type: object - properties: - storageGB: - type: integer - required: - - storageGB - required: - - parameters -``` - -```console -curl -OL https://raw.githubusercontent.com/crossplane/crossplane/release-0.13/docs/snippets/package/alibaba/definition.yaml -``` - -
-
- > You might notice that the XRD we created specifies both "names" and "claim > names". This is because the composite resource it defines offers a composite > resource claim (XRC). diff --git a/docs/v0.13/getting-started/provision-infrastructure.md b/docs/v0.13/getting-started/provision-infrastructure.md index 892becfc..1c621dde 100644 --- a/docs/v0.13/getting-started/provision-infrastructure.md +++ b/docs/v0.13/getting-started/provision-infrastructure.md @@ -63,7 +63,7 @@ When provisioning is complete, you should see `READY: True` in the output. You can take a look at its connection secret that is referenced under `spec.writeConnectionSecretToRef`: ```console -kubectl describe secret aws-rdspostgresql-conn -n crossplane-system -o yaml +kubectl describe secret aws-rdspostgresql-conn -n crossplane-system ``` You can then delete the `RDSInstance`: @@ -111,7 +111,7 @@ When provisioning is complete, you should see `READY: True` in the output. You can take a look at its connection secret that is referenced under `spec.writeConnectionSecretToRef`: ```console -kubectl describe secret cloudsqlpostgresql-conn -n crossplane-system -o yaml +kubectl describe secret cloudsqlpostgresql-conn -n crossplane-system ``` You can then delete the `CloudSQLInstance`: diff --git a/docs/v0.13/introduction/packages.md b/docs/v0.13/introduction/packages.md index c8c75aaf..8e383bf9 100644 --- a/docs/v0.13/introduction/packages.md +++ b/docs/v0.13/introduction/packages.md @@ -31,7 +31,7 @@ purposes of Crossplane packages are as follows: As stated above, Crossplane packages are just opinionated OCI images, meaning they can be constructed using any tool that outputs files that comply the the OCI specification. However, constructing packages using the Crossplane CLI is a -more streamlined experience, as it will performing build-time checks on your +more streamlined experience, as it will perform build-time checks on your packages to ensure that they are compliant with the Crossplane [package format]. Providers and Configurations vary in the types of resources they may contain in @@ -53,9 +53,9 @@ spec: image: crossplane/provider-gcp-controller:master ``` -> Note: The `meta.pkg.crossplane.io` group does contain actual CRDs that get -> installed into the cluster. They are strictly used as metadata in a Crossplane -> package. +> Note: The `meta.pkg.crossplane.io` group does contain custom resources that +> may be installed into the cluster. They are strictly used as metadata in a +> Crossplane package. The `spec.controller.image` fields specifies that the `Provider` desires for a `Deployment` to be created with the provided image. It is important to note that @@ -126,7 +126,7 @@ kubectl crossplane push provider crossplane/provider-gcp:master To push a Configuration package, execute the following command: ``` -kubectl crossplane push provider crossplane/my-org-infra:master +kubectl crossplane push configuration crossplane/my-org-infra:master ``` > Note: Both of the above commands assume a single `.xpkg` file exists in the @@ -178,7 +178,7 @@ spec: > Note: These types differ from the `Provider` and `Configuration` types we saw > earlier. They exist in the `pkg.crossplane.io` group rather than the -> `meta.pkg.crossplane.io` group and are actual CRD types installed in the +> `meta.pkg.crossplane.io` group and are actual custom resources created in the > cluster. The `spec.revisionActivationPolicy` and `spec.revisionHistoryLimit` fields are diff --git a/docs/v0.13/snippets/configure/alibaba/providerconfig.yaml b/docs/v0.13/snippets/configure/alibaba/providerconfig.yaml new file mode 100644 index 00000000..1a8bdd95 --- /dev/null +++ b/docs/v0.13/snippets/configure/alibaba/providerconfig.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: alibaba.crossplane.io/v1alpha1 +kind: ProviderConfig +metadata: + name: default +spec: + region: cn-beijing + credentials: + source: Secret + secretRef: + namespace: crossplane-system + name: alibaba-creds + key: credentials diff --git a/docs/v0.13/snippets/configure/aws/provider.yaml b/docs/v0.13/snippets/configure/aws/provider.yaml deleted file mode 100644 index 76317fc5..00000000 --- a/docs/v0.13/snippets/configure/aws/provider.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: v1 -data: - credentials: ((AWS_CREDS_BASE64)) -kind: Secret -metadata: - name: aws-account-creds - namespace: crossplane-system -type: Opaque ---- -apiVersion: aws.crossplane.io/v1beta1 -kind: ProviderConfig -metadata: - name: default -spec: - credentials: - source: Secret - secretRef: - namespace: crossplane-system - name: aws-account-creds - key: credentials diff --git a/docs/v0.13/snippets/configure/aws/providerconfig.yaml b/docs/v0.13/snippets/configure/aws/providerconfig.yaml new file mode 100644 index 00000000..b00e6860 --- /dev/null +++ b/docs/v0.13/snippets/configure/aws/providerconfig.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: aws.crossplane.io/v1beta1 +kind: ProviderConfig +metadata: + name: default +spec: + credentials: + source: Secret + secretRef: + namespace: crossplane-system + name: aws-creds + key: key diff --git a/docs/v0.13/snippets/configure/aws/setup.sh b/docs/v0.13/snippets/configure/aws/setup.sh index f2f54079..59d3523c 100755 --- a/docs/v0.13/snippets/configure/aws/setup.sh +++ b/docs/v0.13/snippets/configure/aws/setup.sh @@ -40,10 +40,14 @@ AWS_CREDS_BASE64=$(echo -e "[default]\naws_access_key_id = $(aws configure get a if test -z "$AWS_CREDS_BASE64"; then echo "error reading credentials from aws config" - exit -1 + exit 1 fi -# build the secret and provider objects, and then apply it -cat provider.yaml | sed \ - -e "s|((AWS_CREDS_BASE64))|"$AWS_CREDS_BASE64"|g" \ - | kubectl apply -f - \ No newline at end of file +echo "apiVersion: v1 +data: + key: $AWS_CREDS_BASE64 +kind: Secret +metadata: + name: aws-creds + namespace: crossplane-system +type: Opaque" | kubectl apply -f - \ No newline at end of file diff --git a/docs/v0.13/snippets/configure/azure/providerconfig.yaml b/docs/v0.13/snippets/configure/azure/providerconfig.yaml new file mode 100644 index 00000000..581e277b --- /dev/null +++ b/docs/v0.13/snippets/configure/azure/providerconfig.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: azure.crossplane.io/v1beta1 +kind: ProviderConfig +metadata: + name: default +spec: + credentials: + source: Secret + secretRef: + namespace: crossplane-system + name: azure-creds + key: key diff --git a/docs/v0.13/snippets/package/definition.yaml b/docs/v0.13/snippets/package/definition.yaml new file mode 100644 index 00000000..bc4c7ddf --- /dev/null +++ b/docs/v0.13/snippets/package/definition.yaml @@ -0,0 +1,36 @@ +--- +apiVersion: apiextensions.crossplane.io/v1alpha1 +kind: CompositeResourceDefinition +metadata: + name: compositepostgresqlinstances.database.example.org +spec: + claimNames: + kind: PostgreSQLInstance + plural: postgresqlinstances + connectionSecretKeys: + - username + - password + - endpoint + - port + crdSpecTemplate: + group: database.example.org + version: v1alpha1 + names: + kind: CompositePostgreSQLInstance + plural: compositepostgresqlinstances + validation: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + parameters: + type: object + properties: + storageGB: + type: integer + required: + - storageGB + required: + - parameters