Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
10 changes: 5 additions & 5 deletions examples/compute/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: example-instance
spec:
forProvider:
folderId: <your-folder-id>
name: example-instance
platformId: standard-v1
platformId: standard-v3
zone: ru-central1-a
resources:
- cores: 2
Expand All @@ -14,11 +15,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
- subnetId: <your-subnet-id>
metadata:
ssh-keys: "ubuntu:<public-key-data>"
providerConfigRef:
name: example
name: example
9 changes: 4 additions & 5 deletions examples/container/registry.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apiVersion: container.yandex-cloud.jet.crossplane.io/v1alpha1
kind: Registry
metadata:
name: example-registry
name: registry-1994
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 use example in names

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

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.

name: example-folder
folderId: <your-folder-id>
name: registry-1994
providerConfigRef:
name: example
name: example
16 changes: 8 additions & 8 deletions examples/dns/recordset.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: dns.yandex-cloud.jet.crossplane.io/v1alpha1
kind: Recordset
metadata:
name: example-recordset
name: apps
spec:
deletionPolicy: Orphan
forProvider:
zoneIdRef:
name: example-zone
name: example-recordset
type: "A"
ttl: 200
data:
- "10.1.0.1"
- '<ip-address>' # тут должен быть ip-адрес
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not valid filed value. It's beter to use valid values, and add descriptions in comments

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

name: '*.apps.pushka.ga.' # поменяй на свой домен
ttl: 600
type: A
zoneId: <zone-id> # поменяй на имя своей зоны
providerConfigRef:
name: example
name: example
17 changes: 7 additions & 10 deletions examples/dns/zone.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
apiVersion: dns.yandex-cloud.jet.crossplane.io/v1alpha1
kind: Zone
metadata:
name: example-zone
name: yc-courses-1999
spec:
deletionPolicy: Orphan
forProvider:
name: example-zone
description: desc
labels:
label1: "label-1-value"
zone: "example.com."
public: false
privateNetworksRefs:
- name: example-net
folderId: <your-folder-id>
name: yc-courses-1999 # укажи имя своей dns-зоны
public: true
zone: pushka.ga. # укажи свою dns-зону
Copy link
Contributor

Choose a reason for hiding this comment

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

I beleve that not all users will be allowed to create pushka.ga zone.
And example.com was made for testing purpose - https://www.iana.org/domains/reserved

Copy link
Author

Choose a reason for hiding this comment

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

Fixed. I get it.

providerConfigRef:
name: example
name: example
11 changes: 5 additions & 6 deletions examples/iam/folderiambinding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apiVersion: iam.yandex-cloud.jet.crossplane.io/v1alpha1
kind: FolderIAMBinding
metadata:
name: crossplane-preprod
name: admin-1998 # укажи своё название
spec:
deletionPolicy: Orphan
forProvider:
serviceAccountRefs:
- name: example-sa
role: editor
folderIdRef:
name: example-folder
folderId: <your-folder-id>
role: admin # укажи требуемую роль
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 use english in comments

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

members: ["serviceAccount:<sa-id>"]
providerConfigRef:
name: example
10 changes: 4 additions & 6 deletions examples/iam/folderiammember.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
apiVersion: iam.yandex-cloud.jet.crossplane.io/v1alpha1
kind: FolderIAMMember
metadata:
name: crossplane-preprod
name: lala19
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 use smth like folder-iam-member-example

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

spec:
forProvider:
serviceAccountRef:
name: example-sa
role: editor
folderIdRef:
name: example-folder
folderId: <your-folder-id>
role: storage.editor
member: "serviceAccount:<sa-id>"
providerConfigRef:
name: example
9 changes: 4 additions & 5 deletions examples/iam/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apiVersion: iam.yandex-cloud.jet.crossplane.io/v1alpha1
kind: ServiceAccount
metadata:
name: example-sa
name: kube-prod-1997
spec:
forProvider:
name: example-sa
folderIdRef:
name: example-folder
folderId: <your-folder-id>
name: kube-prod-1997
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
5 changes: 2 additions & 3 deletions examples/kms/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ spec:
description: provider-jet-yc created KMS key
defaultAlgorithm: AES_128
rotationPeriod: 8760h
folderIdRef:
name: example-folder
folderId: <your-folder-id>
providerConfigRef:
name: example
name: example
41 changes: 16 additions & 25 deletions examples/kubernetes/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
apiVersion: kubernetes.yandex-cloud.jet.crossplane.io/v1alpha1
kind: Cluster
metadata:
name: example-cluster
name: kube-prod-new
spec:
forProvider:
name: example-cluster
description: provider-jet-yc cluster
networkIdRef:
name: example-net
clusterIpv4Range: 10.113.0.0/16
folderId: <folder-id>
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
- publicIp: true
regional:
- region: ru-central1
securityGroupIds:
- <sg-id>
version: '1.21'
name: kube-prod-new
networkId: <network-id>
networkPolicyProvider: CALICO
kmsProvider:
- keyIdRef:
name: example-sk
nodeServiceAccountId: <node-sa-id>
releaseChannel: STABLE
serviceAccountId: <sa-id>
serviceIpv4Range: 10.97.0.0/16
providerConfigRef:
name: example
name: example
57 changes: 28 additions & 29 deletions examples/kubernetes/nodegroup.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
apiVersion: kubernetes.yandex-cloud.jet.crossplane.io/v1alpha1
kind: NodeGroup
metadata:
name: example-nodegroup
name: kube-prod-new-nodegroup-0
spec:
forProvider:
clusterIdRef:
name: example-cluster
name: example-cluster
description: provider-jet-yc nodegroup
version: "1.21"
allocationPolicy:
- location:
- zone: ru-central1-a
clusterId: <cluster-id>
instanceTemplate:
- platformId: "standard-v2"
- bootDisk:
- size: 64
type: network-hdd
networkInterface:
- nat: true
subnetIdsRefs:
- name: example-subnet-a
securityGroupIds:
- <sg-id>
subnetIds:
- <subnet-id>
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: kube-prod-nodegroup-0
scalePolicy:
- autoScale:
- initial: 1
max: 5
min: 1
version: '1.21'
providerConfigRef:
name: example
name: example
13 changes: 5 additions & 8 deletions examples/mdb/mongodbcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ spec:
forProvider:
name: example-mongodb
environment: PRESTABLE
networkIdRef:
name: example-net
networkId: <your-network-id>
clusterConfig:
- version: "4.2"
- version: "4.4" # required either [4.4 4.2 4.0 3.6 5.0-enterprise 4.4-enterprise 5.0]
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to provide link on some site where supported versions described. It will always be updated without commits in repo

Copy link
Author

Choose a reason for hiding this comment

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

Unfortunately, I didn't find the appropriate link for it. That's why I deleted these comments.

resources:
- diskSize: 16
diskTypeId: network-hdd
Expand All @@ -38,12 +37,10 @@ spec:
- databaseName: testdb
host:
- zoneId: ru-central1-a
subnetIdRef:
name: example-subnet-a
folderIdRef:
name: example-folder
subnetId: <your-subnet-id>
folderId: <your-folder-id>
providerConfigRef:
name: example
writeConnectionSecretToRef:
name: mongodb-conn
namespace: default
namespace: default
29 changes: 29 additions & 0 deletions examples/mdb/mysql_db_user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: mdb.yandex-cloud.jet.crossplane.io/v1alpha1
kind: MySQLDatabase
metadata:
name: mysql-db
spec:
forProvider:
clusterId: <mysql-cluster-id>
name: mysql-db
providerConfigRef:
name: example

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