Skip to content

Commit

Permalink
add nat examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Zhang9309 committed Dec 25, 2024
1 parent 9b5d17d commit 056d6d4
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kind: Provider
metadata:
name: provider-huaweicloud
spec:
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.7
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8
```
Define the provider version with `spec.package`.
Expand All @@ -22,7 +22,7 @@ Verify the configuration with `kubectl get providers`.
```shell
$ kubectl get providers
NAME INSTALLED HEALTHY PACKAGE AGE
provider-huaweicloud True True xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.7 54s
provider-huaweicloud True True xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8 54s
```

View the Crossplane [Provider CRD definition](https://doc.crds.dev/github.com/huaweicloud/provider-huaweicloud) to view all available `Provider` options.
Expand Down
4 changes: 2 additions & 2 deletions examples/ecs/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ spec:
imageId: 89ac6e18-d938-4b0d-b038-bcdb03a1b87f
name: basic
network:
- uuid: fcc7de56-f312-4534-abe3-70943f5c8f51
- uuid: 534b6d1b-b532-4e32-9e98-1329562a8f4e
securityGroupIds:
- e46c940a-fc5e-411f-8d61-2ef918be855c
- 07d8d2fa-c206-4794-8804-8de5b22fb0cc
2 changes: 1 addition & 1 deletion examples/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Provider
metadata:
name: provider-huaweicloud
spec:
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.0-7
package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8
controllerConfigRef:
name: debug-config

Expand Down
42 changes: 42 additions & 0 deletions examples/nat/dnatrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: DnatRule
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/dnatrule
labels:
testing.upbound.io/example-name: test
name: test
spec:
initProvider:
privateIp: ""
forProvider:
externalServicePort: 8023
floatingIpIdSelector:
matchLabels:
testing.upbound.io/example-name: dedicated
internalServicePort: 23
natGatewayIdSelector:
matchLabels:
testing.upbound.io/example-name: test
portId: 0939e3e6-ffaa-467a-930b-fd17ec82d3f5
protocol: tcp

---

apiVersion: eip.huaweicloud.crossplane.io/v1alpha1
kind: VpcEip
metadata:
annotations:
meta.upbound.io/example-id: eip/v1alpha1/vpceip
labels:
testing.upbound.io/example-name: dedicated
name: dedicated
spec:
forProvider:
bandwidth:
- chargeMode: traffic
name: crossplane-test
shareType: PER
size: 10
publicip:
- type: 5_bgp
54 changes: 54 additions & 0 deletions examples/nat/gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: Gateway
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/gateway
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
description: test for crossplane
name: crossplane-test
spec: "1"
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: subnet
vpcIdSelector:
matchLabels:
testing.upbound.io/example-name: vpc

---

apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1
kind: Subnet
metadata:
annotations:
meta.upbound.io/example-id: vpc/v1alpha1/subnet
labels:
testing.upbound.io/example-name: subnet
name: subnet
spec:
forProvider:
availabilityZone: cn-north-4a
cidr: 192.168.0.0/24
gatewayIp: 192.168.0.1
name: crossplane_test
vpcIdSelector:
matchLabels:
testing.upbound.io/example-name: vpc

---

apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1
kind: VPC
metadata:
annotations:
meta.upbound.io/example-id: vpc/v1alpha1/vpc
labels:
testing.upbound.io/example-name: vpc
name: vpc
spec:
forProvider:
cidr: 192.168.0.0/16
name: crossplane_test
22 changes: 22 additions & 0 deletions examples/nat/privatednatrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: PrivateDnatRule
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/privatednatrule
labels:
testing.upbound.io/example-name: test
name: test
spec:
initProvider:
backendPrivateIp: ""
forProvider:
backendInterfaceId: 0939e3e6-ffaa-467a-930b-fd17ec82d3f5
gatewayIdSelector:
matchLabels:
testing.upbound.io/example-name: test-private
internalServicePort: 2000
protocol: tcp
transitIpIdSelector:
matchLabels:
testing.upbound.io/example-name: test
transitServicePort: 1000
17 changes: 17 additions & 0 deletions examples/nat/privategateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: PrivateGateway
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/privategateway
labels:
testing.upbound.io/example-name: test-private
name: test-private
spec:
forProvider:
description: Created by crossplane
enterpriseProjectId: "0"
name: crossplane-test
spec: Small
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: subnet
21 changes: 21 additions & 0 deletions examples/nat/privatesnatrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: PrivateSnatRule
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/privatesnatrule
labels:
testing.upbound.io/example-name: test
name: test
spec:
initProvider:
cidr: ""
forProvider:
gatewayIdSelector:
matchLabels:
testing.upbound.io/example-name: test-private
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: subnet1
transitIpIdSelector:
matchLabels:
testing.upbound.io/example-name: test
52 changes: 52 additions & 0 deletions examples/nat/privatetransitip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: PrivateTransitIP
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/privatetransitip
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
enterpriseProjectId: "0"
ipAddress: 192.168.0.100
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: subnet1
tags:
foo: bar

---

apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1
kind: Subnet
metadata:
annotations:
meta.upbound.io/example-id: vpc/v1alpha1/subnet
labels:
testing.upbound.io/example-name: subnet1
name: subnet1
spec:
forProvider:
availabilityZone: cn-north-4a
cidr: 192.168.0.0/24
gatewayIp: 192.168.0.1
name: crossplane_test1
vpcIdSelector:
matchLabels:
testing.upbound.io/example-name: vpc1

---

apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1
kind: VPC
metadata:
annotations:
meta.upbound.io/example-id: vpc/v1alpha1/vpc
labels:
testing.upbound.io/example-name: vpc1
name: vpc1
spec:
forProvider:
cidr: 192.168.0.0/16
name: crossplane_test1
19 changes: 19 additions & 0 deletions examples/nat/snatrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: nat.huaweicloud.crossplane.io/v1alpha1
kind: SnatRule
metadata:
annotations:
meta.upbound.io/example-id: nat/v1alpha1/snatrule
labels:
testing.upbound.io/example-name: test
name: test
spec:
forProvider:
floatingIpIdSelector:
matchLabels:
testing.upbound.io/example-name: dedicated
natGatewayIdSelector:
matchLabels:
testing.upbound.io/example-name: test
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: subnet

0 comments on commit 056d6d4

Please sign in to comment.