Skip to content

Commit

Permalink
Update providerconfig.yaml and secret.yaml.tmpl. Added datacenter exa…
Browse files Browse the repository at this point in the history
…mple.
  • Loading branch information
Fumigatus committed Nov 27, 2024
1 parent a2b2f0f commit 0833de1
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 4 deletions.
10 changes: 10 additions & 0 deletions examples/datacenter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Datacenter Example
First we need to create vSphere secret and provider.
```
kubectl create -f secret.yaml
kubectl create -f providerconfig.yaml
```
After that we can create 'Datacenter' resource via Crossplane.
```
kubectl create -f datacenter.yaml
```
11 changes: 11 additions & 0 deletions examples/datacenter/datacenter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: inventory.crossplane.io/v1alpha1
kind: VSphereDatacenter
metadata:
name: example-datacenter
spec:
forProvider:
name: my-datacenter
providerRef:
name: vsphere
providerConfigRef:
name: vsphere
11 changes: 11 additions & 0 deletions examples/datacenter/providerconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: vsphere.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: vsphere
spec:
credentials:
source: Secret
secretRef:
name: example-creds
namespace: crossplane-system
key: credentials
13 changes: 13 additions & 0 deletions examples/datacenter/secret.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: example-creds
namespace: crossplane-system
type: Opaque
stringData:
credentials: |
{
"user": "admin",
"password": "t0ps3cr3t11",
"vsphere_server": "my_excellent_vsphere_server"
}
4 changes: 2 additions & 2 deletions examples/providerconfig/providerconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: vsphere.upbound.io/v1beta1
apiVersion: vsphere.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: default
name: vsphere
spec:
credentials:
source: Secret
Expand Down
5 changes: 3 additions & 2 deletions examples/providerconfig/secret.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type: Opaque
stringData:
credentials: |
{
"username": "admin",
"password": "t0ps3cr3t11"
"user": "admin",
"password": "t0ps3cr3t11",
"vsphere_server": "my_excellent_vsphere_server"
}

0 comments on commit 0833de1

Please sign in to comment.