Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions examples/compute/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ metadata:
name: example-instance
spec:
forProvider:
folderIdRef: # you can also use folderId: <your-folder-id> here
name: example-folder
name: example-instance
platformId: standard-v1
platformId: standard-v3
zone: ru-central1-a
resources:
- cores: 2
Expand All @@ -14,10 +16,10 @@ spec:
- initializeParams:
# ubuntu 20.04
# yc compute image list --folder-id standard-images | grep 'ubuntu-20-04-lts'
- imageId: fd8ot0k0vde438jv0t8j
- imageId: fd8ot0k0vde438jv0t8j # your image-id
networkInterface:
- subnetIdRef:
name: example-subnet-a
name: example-subnet-a # you can also use subnetId: <your-subnet-id> here
metadata:
ssh-keys: "ubuntu:<public-key-data>"
providerConfigRef:
Expand Down
4 changes: 2 additions & 2 deletions examples/container/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: example-registry
spec:
forProvider:
name: example-registry
folderIdRef:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave refs here and everywhere. It's more correct way to make resource references with crossplane

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.
But sometimes users face with the issue when they use Refs (folderIdRef, networkIdRef, etc...).

For example, when they apply the manifest, they see something like this in 'kubectl describe':
**CannotResolveResourceReferences 7s (x2 over 7s) managed/vpc.yandex-cloud.jet.crossplane.io/v1alpha1, kind=network cannot resolve references: mg.Spec.ForProvider.FolderID: cannot get referenced resource: Folder.resourcemanager.yandex-cloud.jet.crossplane.io "b1g67uo02ppktpkktrpg" not found

That's why I leave comments for additional information to users that they can not only use Refs.

folderIdRef: # you can also use folderId: <your-folder-id> here
name: example-folder
name: example-registry
providerConfigRef:
name: example
7 changes: 4 additions & 3 deletions examples/dns/recordset.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
apiVersion: dns.yandex-cloud.jet.crossplane.io/v1alpha1
piVersion: dns.yandex-cloud.jet.crossplane.io/v1alpha1
kind: Recordset
metadata:
name: example-recordset
spec:
deletionPolicy: Orphan
forProvider:
zoneIdRef:
zoneIdRef: # you can also use zoneId: <your-zone-id> here
name: example-zone
name: example-recordset
type: "A"
ttl: 200
ttl: 600
data:
- "10.1.0.1"
providerConfigRef:
Expand Down
10 changes: 4 additions & 6 deletions examples/dns/zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ kind: Zone
metadata:
name: example-zone
spec:
deletionPolicy: Orphan
forProvider:
folderIdRef:
name: example-folder # you can also use folderId: <your-folder-id> here
name: example-zone
description: desc
labels:
label1: "label-1-value"
zone: "example.com."
public: false
privateNetworksRefs:
- name: example-net
public: true
providerConfigRef:
name: example
10 changes: 5 additions & 5 deletions examples/iam/folderiambinding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: iam.yandex-cloud.jet.crossplane.io/v1alpha1
kind: FolderIAMBinding
metadata:
name: crossplane-preprod
name: example-iam-binding
spec:
deletionPolicy: Orphan
forProvider:
serviceAccountRefs:
- name: example-sa
role: editor
folderIdRef:
name: example-folder
name: example-folder # you can also use folderId: <your-folder-id> here
role: admin
members: ["serviceAccount:<sa-id>"]
providerConfigRef:
name: example
11 changes: 5 additions & 6 deletions examples/iam/folderiammember.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apiVersion: iam.yandex-cloud.jet.crossplane.io/v1alpha1
kind: FolderIAMMember
metadata:
name: crossplane-preprod
name: example-iam-member
spec:
forProvider:
serviceAccountRef:
name: example-sa
role: editor
folderIdRef:
name: example-folder
name: example-folder # you can also use folderId: <your-folder-id> here
role: storage.editor
member: "serviceAccount:<sa-id>"
providerConfigRef:
name: example
name: example
6 changes: 3 additions & 3 deletions examples/iam/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: example-sa
spec:
forProvider:
name: example-sa
folderIdRef:
name: example-folder
name: example-folder # you can also use folderId: <your-folder-id> here
name: example-sa
providerConfigRef:
name: example
name: example
10 changes: 4 additions & 6 deletions examples/iam/serviceaccountiammember.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ metadata:
name: example-sa-iam-member
spec:
forProvider:
role: "storage.editor"
serviceAccountRef:
- name: example-sa
serviceAccountIdRef:
name: example-sa
role: "editor"
serviceAccountId: <sa-id>
member: "serviceAccount:<sa-id>"
providerConfigRef:
name: example
name: example
5 changes: 2 additions & 3 deletions examples/iam/serviceaccountkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
spec:
forProvider:
description: "static access key for object storage"
serviceAccountIdRef:
name: example-sa
serviceAccountId: <sa-id>
providerConfigRef:
name: example
name: example
5 changes: 2 additions & 3 deletions examples/iam/serviceaccountstatickey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ metadata:
spec:
forProvider:
description: "static access key for object storage"
serviceAccountIdRef:
name: example-sa
serviceAccountId: <sa-id>
providerConfigRef:
name: example
writeConnectionSecretToRef:
name: sa-key-conn
namespace: crossplane-system
namespace: crossplane-system
4 changes: 2 additions & 2 deletions examples/kms/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ spec:
defaultAlgorithm: AES_128
rotationPeriod: 8760h
folderIdRef:
name: example-folder
name: example-folder # you can also use folderId: <your-folder-id> here
providerConfigRef:
name: example
name: example
39 changes: 17 additions & 22 deletions examples/kubernetes/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@ metadata:
name: example-cluster
spec:
forProvider:
clusterIpv4Range: 10.113.0.0/16
folderIdRef:
name: example-folder # you can also use folderId: <your-folder-id> here
master:
- publicIp: true
regional:
- region: ru-central1
securityGroupIdsRefs:
name: example-sg # you can also use securityGroupIds: <your-sg-id>
version: '1.21'
name: example-cluster
description: provider-jet-yc cluster
networkIdRef:
name: example-net
master:
- version: "1.21"
zonal:
- zone: ru-central1-a
subnetIdRef:
name: example-subnet-a
publicIp: true
maintenancePolicy:
- autoUpgrade: true
maintenanceWindow:
- startTime: "15:00"
duration: "3h"
serviceAccountIdRef:
name: example-sa
nodeServiceAccountIdRef:
name: example-sa
releaseChannel: RAPID
name: example-vpc # you can also use networkId: <your-network-id> here
networkPolicyProvider: CALICO
kmsProvider:
- keyIdRef:
name: example-sk
nodeServiceAccountIdRef:
name: example-node-sa # you can also use nodeServiceAccountId: <your-sa-id> here
releaseChannel: STABLE
serviceAccountIdRef:
name: example-sa # you can also use serviceAccountId: <your-sa-id> here
serviceIpv4Range: 10.97.0.0/16
providerConfigRef:
name: example
54 changes: 27 additions & 27 deletions examples/kubernetes/nodegroup.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
apiVersion: kubernetes.yandex-cloud.jet.crossplane.io/v1alpha1
kind: NodeGroup
metadata:
name: example-nodegroup
name: example-nodegroup-0
spec:
forProvider:
allocationPolicy:
- location:
- zone: ru-central1-a
clusterIdRef:
name: example-cluster
name: example-cluster
description: provider-jet-yc nodegroup
version: "1.21"
name: example-cluster # you can also use clusterId: <your-cluster-id> here
instanceTemplate:
- platformId: "standard-v2"
- bootDisk:
- size: 64
type: network-hdd
networkInterface:
- nat: true
securityGroupIdsRefs:
name: example-sg # you can also use securityGroupIds: <your-sg-id> here
subnetIdsRefs:
- name: example-subnet-a
- name: example-subnet-a # you can also use subnetIds: <your-subnet-id> here
platformId: standard-v3
resources:
- memory: 2
cores: 2
bootDisk:
- type: "network-hdd"
size: 64
- cores: 2
memory: 2
schedulingPolicy:
- preemptible: true
scalePolicy:
- fixedScale:
- size: 1
allocationPolicy:
- location:
- zone: "ru-central1-a"
maintenancePolicy:
- autoUpgrade: true
autoRepair: true
- autoRepair: true
autoUpgrade: true
maintenanceWindow:
- startTime: "15:00"
duration: "3h"
day: "monday"
- startTime: "10:00"
duration: "4h30m"
day: "friday"
- day: saturday
duration: 3h
startTime: '23:00'
name: example-nodegroup-0
scalePolicy:
- autoScale:
- initial: 1
max: 5
min: 1
version: '1.21'
providerConfigRef:
name: example
name: example
10 changes: 5 additions & 5 deletions examples/mdb/mongodbcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ spec:
name: example-mongodb
environment: PRESTABLE
networkIdRef:
name: example-net
name: example-vpc # you can also use networkId: <your-network-id> here
clusterConfig:
- version: "4.2"
- version: "4.4"
resources:
- diskSize: 16
diskTypeId: network-hdd
Expand All @@ -39,11 +39,11 @@ spec:
host:
- zoneId: ru-central1-a
subnetIdRef:
name: example-subnet-a
folderIdRef:
name: example-subnet-a # you can also use subnetId: <your-subnet-id> here
folderIdRef: # you can also use folderId: <your-folder-id> here
name: example-folder
providerConfigRef:
name: example
writeConnectionSecretToRef:
name: mongodb-conn
namespace: default
namespace: default
31 changes: 31 additions & 0 deletions examples/mdb/mysql_db_user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: mdb.yandex-cloud.jet.crossplane.io/v1alpha1
kind: MySQLDatabase
metadata:
name: example-mysql-db
spec:
forProvider:
clusterIdRef:
name: example-mysql # you can also use clusterId: <your-cluster-id> here
name: example-mysql-db
providerConfigRef:
name: example

---
apiVersion: mdb.yandex-cloud.jet.crossplane.io/v1alpha1
kind: MySQLUser
metadata:
name: example-mysql-user
spec:
forProvider:
clusterIdRef:
name: example-mysql # you can use clusterId: <your-cluster-id-here>
name: example-mysql-user
passwordSecretRef:
name: mysql
key: password
namespace: default
permission:
- databaseName: db_name
providerConfigRef:
name: example
Loading