Skip to content

Instantly share code, notes, and snippets.

@vrabbi
Created February 5, 2025 16:04
Show Gist options
  • Save vrabbi/ab100630c2b784560f54f66f5ff89f3f to your computer and use it in GitHub Desktop.
Save vrabbi/ab100630c2b784560f54f66f5ff89f3f to your computer and use it in GitHub Desktop.
apiVersion: playtika.com/v1alpha1
kind: StudioInfra
metadata:
name: demo
spec:
networkDomain: example.com
datacenter: site
environment: stage
ldapGroup: demo
kubernetes:
version: 1.31
nodePools:
- name: aerospike
type: nvme-special-crap
count: 3
labels: {}
- name: standard
type: normal
count 5000
labels: {}

Create objects

cloudstack domain cloudstack project cloudstack vpc 2 cloudstack networks 4 vms for dns resolvers ansible for configuration create bastion host vm public ip and port forwarding rule for port 22 to the bastion public ip for k8s + lb rules palette cluster

Env Configs

env configs per dc: cidr blocks dns IPs

Managed Resources

apiVersion: cloudstack.terasky.com/v1alpha1 kind: Domain metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/domain labels: testing.upbound.io/example-name: example name: example spec: forProvider: name: example-domain networkDomain: example.local parentDomainIdSelector: matchLabels: testing.upbound.io/example-name: example


project via ansible or http providers


apiVersion: cloudstack.terasky.com/v1alpha1 kind: Account metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/account labels: testing.upbound.io/example-name: example name: example spec: forProvider: accountType: 1 email: [email protected] firstName: John lastName: Doe password: securepassword roleId: 1234abcd username: jdoe

add ldap roles via ansible to account

get ssh key from vault using eso :

apiVersion: cloudstack.terasky.com/v1alpha1 kind: SSHKeypair metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/sshkeypair labels: testing.upbound.io/example-name: default name: default spec: forProvider: name: myKey project: myProject publicKey: ${file("~/.ssh/id_rsa.pub")}

apiVersion: cloudstack.terasky.com/v1alpha1 kind: VPC metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/vpc labels: testing.upbound.io/example-name: default name: default spec: forProvider: cidr: 10.0.0.0/16 name: test-vpc vpcOffering: Default VPC Offering zoneSelector: matchLabels: testing.upbound.io/example-name: example


apiVersion: cloudstack.terasky.com/v1alpha1 kind: Network metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/network labels: testing.upbound.io/example-name: default name: default spec: forProvider: cidr: 10.0.0.0/16 name: test-network networkOfferingSelector: matchLabels: testing.upbound.io/example-name: example zoneSelector: matchLabels: testing.upbound.io/example-name: example

apiVersion: cloudstack.terasky.com/v1alpha1 kind: Instance metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/instance labels: testing.upbound.io/example-name: web name: web spec: forProvider: name: server-1 networkIdSelector: matchLabels: testing.upbound.io/example-name: example serviceOfferingSelector: matchLabels: testing.upbound.io/example-name: example templateSelector: matchLabels: testing.upbound.io/example-name: example zoneSelector: matchLabels: testing.upbound.io/example-name: example


apiVersion: cloudstack.terasky.com/v1alpha1 kind: IPAddress metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/ipaddress labels: testing.upbound.io/example-name: default name: default spec: forProvider: networkIdSelector: matchLabels: testing.upbound.io/example-name: example

apiVersion: cloudstack.terasky.com/v1alpha1 kind: PortForward metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/portforward labels: testing.upbound.io/example-name: default name: default spec: forProvider: forward: - privatePort: 80 protocol: tcp publicPort: 8080 virtualMachineId: f8141e2f-4e7e-4c63-9362-986c908b7ea7 ipAddressIdSelector: matchLabels: testing.upbound.io/example-name: example

apiVersion: cloudstack.terasky.com/v1alpha1 kind: LoadBalancerRule metadata: annotations: meta.upbound.io/example-id: cloudstack/v1alpha1/loadbalancerrule labels: testing.upbound.io/example-name: default name: default spec: forProvider: algorithm: roundrobin description: Loadbalancer rule 1 ipAddressId: 30b21801-d4b3-4174-852b-0c0f30bdbbfb memberIds: - f8141e2f-4e7e-4c63-9362-986c908b7ea7 name: loadbalancer-rule-1 privatePort: 80 publicPort: 80

apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
name: studioinfras.playtika.com
spec:
group: playtika.com
names:
categories:
- crossplane
kind: StudioInfra
plural: studioinfras
versions:
- name: v1alpha1
referenceable: true
schema:
openAPIV3Schema:
description: StudioInfra is the Schema for the StudioInfra API.
properties:
spec:
description: StudioInfraSpec defines the desired state of StudioInfra.
properties:
datacenter:
type: string
environment:
type: string
kubernetes:
properties:
nodePools:
items:
properties:
count:
type: number
labels:
type: object
name:
type: string
type:
type: string
type: object
type: array
version:
type: number
type: object
ldapGroup:
type: string
networkDomain:
type: string
type: object
status:
description: StudioInfraStatus defines the observed state of StudioInfra.
type: object
required:
- spec
type: object
served: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment