mirror of https://github.com/crossplane/docs.git
docs snapshot for crossplane version `master`
This commit is contained in:
parent
c1e5c2fedb
commit
1d1ba606ea
|
@ -52,6 +52,7 @@ relevant values for your AKS cluster.
|
||||||
export AKS_RESOURCE_GROUP=myAKSResourceGroup
|
export AKS_RESOURCE_GROUP=myAKSResourceGroup
|
||||||
export AKS_VNET=myAKSVnet
|
export AKS_VNET=myAKSVnet
|
||||||
export AKS_NAME=myAKSName
|
export AKS_NAME=myAKSName
|
||||||
|
export AKS_REGION=myRegion
|
||||||
export SUBSCRIPTION_ID=$(az account list | jq -j '.[0].id')
|
export SUBSCRIPTION_ID=$(az account list | jq -j '.[0].id')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -120,11 +121,11 @@ metadata:
|
||||||
name: azure-mysql-standard
|
name: azure-mysql-standard
|
||||||
labels:
|
labels:
|
||||||
size: standard
|
size: standard
|
||||||
demo: true
|
demo: "true"
|
||||||
specTemplate:
|
specTemplate:
|
||||||
adminLoginName: myadmin
|
adminLoginName: myadmin
|
||||||
resourceGroupName: $AKS_RESOURCE_GROUP
|
resourceGroupName: $AKS_RESOURCE_GROUP
|
||||||
location: EAST US
|
location: $AKS_REGION
|
||||||
sslEnforced: false
|
sslEnforced: false
|
||||||
version: "5.6"
|
version: "5.6"
|
||||||
pricingTier:
|
pricingTier:
|
||||||
|
@ -135,9 +136,9 @@ specTemplate:
|
||||||
storageGB: 25
|
storageGB: 25
|
||||||
backupRetentionDays: 7
|
backupRetentionDays: 7
|
||||||
geoRedundantBackup: false
|
geoRedundantBackup: false
|
||||||
|
writeConnectionSecretsToNamespace: crossplane-system
|
||||||
providerRef:
|
providerRef:
|
||||||
name: demo-azure
|
name: azure-provider
|
||||||
namespace: azure-infra-dev
|
|
||||||
reclaimPolicy: Delete
|
reclaimPolicy: Delete
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -153,8 +154,8 @@ kubectl apply -f azure-mysql-standard.yaml
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ kubectl get sqlserverclasses
|
$ kubectl get sqlserverclasses
|
||||||
NAME PROVIDER-REF RECLAIM-POLICY AGE
|
NAME PROVIDER-REF RECLAIM-POLICY AGE
|
||||||
azure-mysql-standard demo-azure Delete 11s
|
azure-mysql-standard azure-provider Delete 17s
|
||||||
```
|
```
|
||||||
|
|
||||||
You are free to create more Azure `SQLServerClass` instances to define more
|
You are free to create more Azure `SQLServerClass` instances to define more
|
||||||
|
@ -164,9 +165,9 @@ field `storageGB: 100`.
|
||||||
### Configure Managed Service Access
|
### Configure Managed Service Access
|
||||||
|
|
||||||
In order for the AKS cluster to talk to the MySQL Database, you must condigure a
|
In order for the AKS cluster to talk to the MySQL Database, you must condigure a
|
||||||
`Microsoft.Sql` service endpoint on the AKS Virtual Network. If you do not
|
`Microsoft.Sql` service endpoint on the AKS Virtual Network for all subnets. If
|
||||||
already have this configured, Azure has a [guide][service endpoint] on how to
|
you do not already have this configured, Azure has a [guide][service endpoint]
|
||||||
set it up.
|
on how to set it up.
|
||||||
|
|
||||||
## Provision MySQL
|
## Provision MySQL
|
||||||
|
|
||||||
|
@ -183,7 +184,7 @@ several ways: (a) rely on the default class marked
|
||||||
existing managed resource.*
|
existing managed resource.*
|
||||||
|
|
||||||
In the `SQLServerClass` above, we added the labels `size: standard` and `demo:
|
In the `SQLServerClass` above, we added the labels `size: standard` and `demo:
|
||||||
true`, so our claim will be scheduled to that class using the labels are
|
"true"`, so our claim will be scheduled to that class using the labels are
|
||||||
specified in the `claim.spec.classSelector`. If there are multiple classes which
|
specified in the `claim.spec.classSelector`. If there are multiple classes which
|
||||||
match the specified label(s) one will be chosen at random.
|
match the specified label(s) one will be chosen at random.
|
||||||
|
|
||||||
|
@ -192,17 +193,17 @@ match the specified label(s) one will be chosen at random.
|
||||||
```yaml
|
```yaml
|
||||||
cat > mysql-claim.yaml <<EOF
|
cat > mysql-claim.yaml <<EOF
|
||||||
apiVersion: database.crossplane.io/v1alpha1
|
apiVersion: database.crossplane.io/v1alpha1
|
||||||
kind: MySQLInstance
|
kind: MySQLInstance
|
||||||
metadata:
|
metadata:
|
||||||
name: mysql-claim
|
name: mysql-claim
|
||||||
spec:
|
spec:
|
||||||
classSelector:
|
classSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
size: standard
|
size: standard
|
||||||
demo: true
|
demo: "true"
|
||||||
engineVersion: "5.6"
|
engineVersion: "5.6"
|
||||||
writeConnectionSecretToRef:
|
writeConnectionSecretToRef:
|
||||||
name: wordpressmysql
|
name: wordpressmysql
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
kubectl apply -f mysql-claim.yaml
|
kubectl apply -f mysql-claim.yaml
|
||||||
|
@ -214,8 +215,8 @@ consumption. You can see when claim is bound using the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ kubectl get mysqlinstances
|
$ kubectl get mysqlinstances
|
||||||
NAME STATUS CLASS VERSION AGE
|
NAME STATUS CLASS-KIND CLASS-NAME RESOURCE-KIND RESOURCE-NAME AGE
|
||||||
mysql-claim Bound mysql-standard 5.6 11m
|
mysql-claim Bound SQLServerClass azure-mysql-standard MySQLServer default-mysql-claim-bm4ft 9s
|
||||||
```
|
```
|
||||||
|
|
||||||
If the `STATUS` is blank, we are still waiting for the claim to become bound.
|
If the `STATUS` is blank, we are still waiting for the claim to become bound.
|
||||||
|
@ -227,35 +228,42 @@ Name: mysql-claim
|
||||||
Namespace: default
|
Namespace: default
|
||||||
Labels: <none>
|
Labels: <none>
|
||||||
Annotations: kubectl.kubernetes.io/last-applied-configuration:
|
Annotations: kubectl.kubernetes.io/last-applied-configuration:
|
||||||
{"apiVersion":"database.crossplane.io/v1alpha1","kind":"MySQLInstance","metadata":{"annotations":{},"name":"mysql-claim","namespace":"team..."}}
|
{"apiVersion":"database.crossplane.io/v1alpha1","kind":"MySQLInstance","metadata":{"annotations":{},"name":"mysql-claim","namespace":"defa...
|
||||||
API Version: database.crossplane.io/v1alpha1
|
API Version: database.crossplane.io/v1alpha1
|
||||||
Kind: MySQLInstance
|
Kind: MySQLInstance
|
||||||
Metadata:
|
Metadata:
|
||||||
Creation Timestamp: 2019-09-16T13:46:42Z
|
Creation Timestamp: 2019-10-28T15:43:28Z
|
||||||
Finalizers:
|
Finalizers:
|
||||||
finalizer.resourceclaim.crossplane.io
|
finalizer.resourceclaim.crossplane.io
|
||||||
Generation: 2
|
Generation: 3
|
||||||
Resource Version: 4256
|
Resource Version: 11072
|
||||||
Self Link: /apis/database.crossplane.io/v1alpha1/namespaces/app-project1-dev/mysqlinstances/mysql-claim
|
Self Link: /apis/database.crossplane.io/v1alpha1/namespaces/default/mysqlinstances/mysql-claim
|
||||||
UID: 6a7fe064-d888-11e9-ab90-42b6bb22213a
|
UID: afff42b3-f999-11e9-a2d5-c64d758a651f
|
||||||
Spec:
|
Spec:
|
||||||
Class Ref:
|
Class Ref:
|
||||||
Name: mysql-standard
|
API Version: database.azure.crossplane.io/v1alpha3
|
||||||
|
Kind: SQLServerClass
|
||||||
|
Name: azure-mysql-standard
|
||||||
|
UID: 5710f3db-f999-11e9-a2d5-c64d758a651f
|
||||||
|
Class Selector:
|
||||||
|
Match Labels:
|
||||||
|
Demo: true
|
||||||
|
Size: standard
|
||||||
Engine Version: 5.6
|
Engine Version: 5.6
|
||||||
Resource Ref:
|
Resource Ref:
|
||||||
API Version: database.azure.crossplane.io/v1alpha3
|
API Version: database.azure.crossplane.io/v1alpha3
|
||||||
Kind: MySQLServer
|
Kind: MySQLServer
|
||||||
Name: mysqlinstance-6a7fe064-d888-11e9-ab90-42b6bb22213a
|
Name: default-mysql-claim-bm4ft
|
||||||
Namespace: azure-infra-dev
|
UID: b02c1389-f999-11e9-a2d5-c64d758a651f
|
||||||
Write Connection Secret To Ref:
|
Write Connection Secret To Ref:
|
||||||
Name: wordpressmysql
|
Name: wordpressmysql
|
||||||
Status:
|
Status:
|
||||||
Conditions:
|
Conditions:
|
||||||
Last Transition Time: 2019-09-16T13:46:42Z
|
Last Transition Time: 2019-10-28T15:43:29Z
|
||||||
Reason: Managed claim is waiting for managed resource to become bindable
|
Reason: Managed claim is waiting for managed resource to become bindable
|
||||||
Status: False
|
Status: False
|
||||||
Type: Ready
|
Type: Ready
|
||||||
Last Transition Time: 2019-09-16T13:46:42Z
|
Last Transition Time: 2019-10-28T15:43:29Z
|
||||||
Reason: Successfully reconciled managed resource
|
Reason: Successfully reconciled managed resource
|
||||||
Status: True
|
Status: True
|
||||||
Type: Synced
|
Type: Synced
|
||||||
|
@ -289,13 +297,12 @@ metadata:
|
||||||
name: wordpress-vnet-rule
|
name: wordpress-vnet-rule
|
||||||
spec:
|
spec:
|
||||||
name: wordpress-vnet-rule
|
name: wordpress-vnet-rule
|
||||||
serverName: ${MYSQL_NAME}
|
serverName: ${MYSQL_NAME}
|
||||||
resourceGroupName: ${AKS_RESOURCE_GROUP}
|
resourceGroupName: ${AKS_RESOURCE_GROUP}
|
||||||
properties:
|
properties:
|
||||||
virtualNetworkSubnetId: /subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${AKS_RESOURCE_GROUP}/providers/Microsoft.Network/virtualNetworks/${AKS_VNET}/subnets/aks-subnet
|
virtualNetworkSubnetId: /subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${AKS_RESOURCE_GROUP}/providers/Microsoft.Network/virtualNetworks/${AKS_VNET}/subnets/aks-subnet
|
||||||
providerRef:
|
providerRef:
|
||||||
name: demo-azure
|
name: azure-provider
|
||||||
namespace: azure-infra-dev
|
|
||||||
reclaimPolicy: Delete
|
reclaimPolicy: Delete
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -305,9 +312,9 @@ kubectl apply -f wordpress-vnet-rule.yaml
|
||||||
* You can verify creation with the following command and output:
|
* You can verify creation with the following command and output:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl get mysqlservervirtualnetworkrules
|
$ kubectl get mysqlservervirtualnetworkrules
|
||||||
NAME AGE
|
NAME STATE AGE
|
||||||
wordpress-vnet-rule 27s
|
wordpress-vnet-rule Ready 17s
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install Wordpress
|
## Install Wordpress
|
||||||
|
@ -325,17 +332,17 @@ $ kubectl describe secret wordpressmysql
|
||||||
Name: wordpressmysql
|
Name: wordpressmysql
|
||||||
Namespace: default
|
Namespace: default
|
||||||
Labels: <none>
|
Labels: <none>
|
||||||
Annotations: crossplane.io/propagate-from-name: 6a7fe064-d888-11e9-ab90-42b6bb22213a
|
Annotations: crossplane.io/propagate-from-name: 084b9476-f99e-11e9-a2d5-c64d758a651f
|
||||||
crossplane.io/propagate-from-namespace: crossplane-system
|
crossplane.io/propagate-from-namespace: crossplane-system
|
||||||
crossplane.io/propagate-from-uid: c539fcef-f698-11e9-a957-12a4af141bea
|
crossplane.io/propagate-from-uid: 2e71f6f9-f99e-11e9-a2d5-c64d758a651f
|
||||||
|
|
||||||
Type: Opaque
|
Type: Opaque
|
||||||
|
|
||||||
Data
|
Data
|
||||||
====
|
====
|
||||||
endpoint: 75 bytes
|
endpoint: 50 bytes
|
||||||
password: 27 bytes
|
password: 27 bytes
|
||||||
username: 58 bytes
|
username: 33 bytes
|
||||||
```
|
```
|
||||||
|
|
||||||
* Define the `Deployment` and `Service` in `wordpress-app.yaml` and create it:
|
* Define the `Deployment` and `Service` in `wordpress-app.yaml` and create it:
|
||||||
|
|
Loading…
Reference in New Issue