Skip to content

Instantly share code, notes, and snippets.

@stevendborrelli
Created September 10, 2021 03:15
Show Gist options
  • Save stevendborrelli/801fdb2c968811fbbdf5f85c5406deda to your computer and use it in GitHub Desktop.
Save stevendborrelli/801fdb2c968811fbbdf5f85c5406deda to your computer and use it in GitHub Desktop.
Basic Crossplane azure examples
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- rg.yaml
- network.yaml
- subnet.yaml
- postgres.yaml
- pg-config.yaml
apiVersion: network.azure.crossplane.io/v1alpha3
kind: VirtualNetwork
metadata:
name: borrelli-example-vn
spec:
resourceGroupNameRef:
name: borrelli-example-rg
location: West US 2
properties:
addressSpace:
addressPrefixes:
- 10.2.0.0/16
# - 10.3.0.0/16
providerConfigRef:
name: default
apiVersion: database.azure.crossplane.io/v1beta1
kind: PostgreSQLServerConfiguration
metadata:
name: borrelli-example-psql-configuration
spec:
providerConfigRef:
name: default
forProvider:
resourceGroupNameRef:
name: borrelli-example-rg
serverNameRef:
name: borrelli-example-psql
name: max_wal_senders
value: "12"
---
apiVersion: database.azure.crossplane.io/v1alpha3
kind: PostgreSQLServerFirewallRule
metadata:
name: borrelli-example-psql-fwrule
spec:
providerConfigRef:
name: default
forProvider:
resourceGroupNameRef:
name: borrelli-example-rg
serverNameRef:
name: borrelli-example-psql
properties:
startIpAddress: "0.0.0.0"
endIpAddress: "0.0.0.0"
---
apiVersion: database.azure.crossplane.io/v1alpha3
kind: PostgreSQLServerVirtualNetworkRule
metadata:
name: borrelli-example-psql-vnrule
spec:
providerConfigRef:
name: default
resourceGroupNameRef:
name: borrelli-example-rg
serverNameRef:
name: borrelli-example-psql
properties:
virtualNetworkSubnetIdRef:
name: borrelli-example-sub
apiVersion: database.azure.crossplane.io/v1beta1
kind: PostgreSQLServer
metadata:
name: borrelli-example-psql
labels:
example: "true"
spec:
forProvider:
administratorLogin: myadmin
resourceGroupNameRef:
name: borrelli-example-rg
location: West US 2
minimalTlsVersion: TLS12
sslEnforcement: Disabled
version: "9.6"
sku:
# Note that Basic servers do not support virtual network rules
tier: GeneralPurpose
capacity: 2
family: Gen5
storageProfile:
storageMB: 20480
writeConnectionSecretToRef:
namespace: upbound-system
name: example-psql
providerConfigRef:
name: default
apiVersion: azure.crossplane.io/v1alpha3
kind: ResourceGroup
metadata:
name: borrelli-example-rg
spec:
location: West US 2
providerConfigRef:
name: default
apiVersion: network.azure.crossplane.io/v1alpha3
kind: Subnet
metadata:
name: borrelli-example-sub
spec:
resourceGroupNameRef:
name: borrelli-example-rg
virtualNetworkNameRef:
name: borrelli-example-vn
properties:
addressPrefix: 10.2.0.0/24
serviceEndpoints:
- service: Microsoft.Sql
providerConfigRef:
name: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment