Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jbw976's full-sized avatar
💭
We're hiring at Upbound! https://upbound.io/jobs

Jared Watts jbw976

💭
We're hiring at Upbound! https://upbound.io/jobs
View GitHub Profile
@jbw976
jbw976 / claim.yaml
Created July 12, 2023 16:57
Composition Connection Details
apiVersion: acme.com/v1
kind: AcmeDatabase
metadata:
name: acme-db-prod
spec:
storageGB: 15
writeConnectionSecretToRef:
name: acme-db-prod-conn
@jbw976
jbw976 / claim.yaml
Last active April 21, 2023 06:44
Composition Function examples for Crossplane Intro/Deep-dive
apiVersion: database.example.org/v1alpha1
kind: AcmeCoDatabase
metadata:
name: example-db
spec:
parameters:
storageGB: 20
compositionRef:
name: example
@jbw976
jbw976 / cloudsqlinstanceclass.yaml
Last active November 18, 2019 08:15
disappearing cloudsqlinstance
> k get cloudsqlinstanceclass cloudsqlinstancepostgresql-standard -o yaml
apiVersion: database.gcp.crossplane.io/v1beta1
kind: CloudSQLInstanceClass
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"database.gcp.crossplane.io/v1beta1","kind":"CloudSQLInstanceClass","metadata":{"annotations":{},"labels":{"gitlab-ad-demo":"true"},"name":"cloudsqlinstancepostgresql-standard"},"specTemplate":{"forProvider":{"databaseVersion":"POSTGRES_9_6","region":"us-west2","settings":{"dataDiskSizeGb":10,"dataDiskType":"PD_SSD","ipConfiguration":{"privateNetwork":"projects/evident-beacon-246323/global/networks/default"},"tier":"db-custom-1-3840"}},"providerRef":{"name":"gcp-provider"},"reclaimPolicy":"Delete","writeConnectionSecretsToNamespace":"gitlab-managed-apps"}}
creationTimestamp: "2019-11-16T03:07:05Z"
generation: 1
labels:
@jbw976
jbw976 / allow cluster scoped CRDs for cluster scoped stacks
Created October 22, 2019 05:37
allow cluster scoped CRDs for cluster scoped stacks
> git diff
diff --git a/pkg/stacks/steps.go b/pkg/stacks/steps.go
index a89ab1ec..31a7a676 100644
--- a/pkg/stacks/steps.go
+++ b/pkg/stacks/steps.go
@@ -81,10 +81,6 @@ func crdStep(sp StackPackager) walker.Step {
return errors.Wrap(err, fmt.Sprintf("invalid crd %q", path))
}
- if (crd.Spec.Scope != apiextensions.NamespaceScoped) && (crd.Spec.Scope != "") {
> k get crd gkeclusters.compute.gcp.crossplane.io -o yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
app.kubernetes.io/managed-by: stack-manager
stacks.crossplane.io/icon-data-uri: data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiB2aWV3Qm94PSIwIDAgMTI4IDEyOCI+CiAgPHRpdGxlPkNvbnRhaW5lciBFbmdpbmU8L3RpdGxlPgogIDxnPgogICAgPHBhdGggZD0iTTEyNi40Nyw1OC4xMmwtMjYuMy00NS43NEExMS41NiwxMS41NiwwLDAsMCw5MC4zMSw2LjVIMzcuN2ExMS41NSwxMS41NSwwLDAsMC05Ljg2LDUuODhMMS41Myw1OGExMS40OCwxMS40OCwwLDAsMCwwLDExLjQ0bDI2LjMsNDZhMTEuNzcsMTEuNzcsMCwwLDAsOS44Niw2LjA5SDkwLjNhMTEuNzMsMTEuNzMsMCwwLDAsOS44Ny02LjA2bDI2LjMtNDUuNzRBMTEuNzMsMTEuNzMsMCwwLDAsMTI2LjQ3LDU4LjEyWiIgc3R5bGU9ImZpbGw6ICM0Mjg1ZjQiLz4KICAgIDxwYXRoIGQ9Ik04OS42Myw0OC40NCw2NCwzNywzOS41LDUwLjMxbC0xLDI5LjMzTDgwLjMzLDEyMS41aDEwYTExLjczLDExLjczLDAsMCwwLDkuODctNi4wNmwyMC42MS0zNS44NVoiIHN0eWxlPSJvcGFjaXR5OiAwLjA3MDAwMDA
> cloc .
5557 text files.
5194 unique files.
736 files ignored.
github.com/AlDanial/cloc v 1.82 T=15.28 s (317.5 files/s, 98937.6 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
Go 4242 116334 171468 1004293
@jbw976
jbw976 / make help output
Last active August 1, 2019 05:41
Crossplane make help output
jared@jared-laptop ~/dev/go/src/github.com/crossplaneio/crossplane
> make help
Usage: make [make-options] <target> [options]
Common Targets:
build Build source code and other artifacts for host platform.
build.all Build source code and other artifacts for all platforms.
clean Remove all files created during the build.
distclean Remove all files created during the build including cached tools.
lint Run lint and code analysis tools.
@jbw976
jbw976 / crossplane standard log package usage
Last active April 11, 2019 22:52
Crossplane standard log package usage
grep -F -R -l --exclude-dir=vendor '"log"' * | xargs grep -F -H 'log.'
pkg/test/envtest.go: log.Fatal(err)
pkg/test/envtest.go: log.Panic(err)
pkg/test/envtest.go: log.Fatal(err)
pkg/test/envtest.go: log.Fatal(err)
pkg/test/envtest.go: log.Fatal(err)
pkg/test/envtest.go: log.Panic(err)
pkg/test/envtest.go: log.Panic(err)
@jbw976
jbw976 / Gopkg.toml
Created March 12, 2019 07:40
Rook Kubernetes package references for 1.13
# Gopkg.toml
#
# Add constraints for packages that are a direct dependency
# of this project (i.e. they are imported by golang source code)
# and you want to ensure that only a specific version is needed.
# if you don't need a specific version don't add the constraint here.
# Constraints are of the form:
#
# [[constraint]]
@jbw976
jbw976 / fedora output
Last active January 15, 2019 23:51
output for k8s-vagrant-multi-node multi_os support
jared@Jareds-MacBook-Pro ~/dev/k8s-vagrant-multi-node ((HEAD detached at upstream/multi_os))
> make up -j 2
vagrant up
NODE=1 vagrant up
Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'master' up with 'virtualbox' provider...
==> master: Box 'generic/fedora29' could not be found. Attempting to find and install...
master: Box Provider: virtualbox
==> node1: Box 'generic/fedora29' could not be found. Attempting to find and install...
master: Box Version: >= 0