[3J[H[2J☸️ $ kubectl get pods
error: the server doesn't have a resource type "pods"
☸️ $ kubectl api-resources
NAME                          SHORTNAMES   APIVERSION                             NAMESPACED   KIND
configmaps                    cm           v1                                     true         ConfigMap
events                        ev           v1                                     true         Event
limitranges                   limits       v1                                     true         LimitRange
namespaces                    ns           v1                                     false        Namespace
resourcequotas                quota        v1                                     true         ResourceQuota
secrets                                    v1                                     true         Secret
serviceaccounts               sa           v1                                     true         ServiceAccount
customresourcedefinitions     crd,crds     apiextensions.k8s.io/v1                false        CustomResourceDefinition
apiservices                                apiregistration.k8s.io/v1              false        APIService
tokenreviews                               authentication.k8s.io/v1               false        TokenReview
localsubjectaccessreviews                  authorization.k8s.io/v1                true         LocalSubjectAccessReview
selfsubjectaccessreviews                   authorization.k8s.io/v1                false        SelfSubjectAccessReview
selfsubjectrulesreviews                    authorization.k8s.io/v1                false        SelfSubjectRulesReview
subjectaccessreviews                       authorization.k8s.io/v1                false        SubjectAccessReview
certificatesigningrequests    csr          certificates.k8s.io/v1                 false        CertificateSigningRequest
leases                                     coordination.k8s.io/v1                 true         Lease
events                        ev           events.k8s.io/v1                       true         Event
flowschemas                                flowcontrol.apiserver.k8s.io/v1beta1   false        FlowSchema
prioritylevelconfigurations                flowcontrol.apiserver.k8s.io/v1beta1   false        PriorityLevelConfiguration
clusterrolebindings                        rbac.authorization.k8s.io/v1           false        ClusterRoleBinding
clusterroles                               rbac.authorization.k8s.io/v1           false        ClusterRole
rolebindings                               rbac.authorization.k8s.io/v1           true         RoleBinding
roles                                      rbac.authorization.k8s.io/v1           true         Role
☸️ $ kubectl apply -Rf ../contrib/demo/external-integrations/
customresourcedefinition.apiextensions.k8s.io/databases.postgresql.sql.crossplane.io created
customresourcedefinition.apiextensions.k8s.io/databases.postgresql.crossplane.io created
customresourcedefinition.apiextensions.k8s.io/functions.lambda.aws created
customresourcedefinition.apiextensions.k8s.io/topics.pubsub.gcp created
customresourcedefinition.apiextensions.k8s.io/buckets.s3.aws created
customresourcedefinition.apiextensions.k8s.io/repos.github.com created
customresourcedefinition.apiextensions.k8s.io/databases.spanner.gcp created
customresourcedefinition.apiextensions.k8s.io/website.netlify.com created
customresourcedefinition.apiextensions.k8s.io/domainnames.discountdomainnames.biz created
customresourcedefinition.apiextensions.k8s.io/topics.sns.aws created
customresourcedefinition.apiextensions.k8s.io/channels.slack.com created
customresourcedefinition.apiextensions.k8s.io/loadbalancers.multicloud.media created
☸️ $ kubectl explain database
KIND:     Database
VERSION:  postgresql.crossplane.io/v1alpha1

DESCRIPTION:
     A Database represents the declarative state of a PostgreSQL database.

FIELDS:
   apiVersion	<string>
     APIVersion defines the versioned schema of this representation of an
     object. Servers should convert recognized schemas to the latest internal
     value, and may reject unrecognized values. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

   kind	<string>
     Kind is a string value representing the REST resource this object
     represents. Servers may infer this from the endpoint the client submits
     requests to. Cannot be updated. In CamelCase. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

   metadata	<Object>
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

   spec	<Object> -required-
     A DatabaseSpec defines the desired state of a Database.

   status	<Object>
     A DatabaseStatus represents the observed state of a Database.

[3J[H[2J☸️ $ kubectl config view --minify | grep server:
    server: https://127.0.0.1:6443
☸️ $ kubectl config use-context user
Switched to context "user".
☸️ $ kubectl config view --minify | grep server:
    server: https://127.0.0.1:6443/clusters/user
☸️ $ kubectl get databases
error: the server doesn't have a resource type "databases"
☸️ $ kubectl get crds
No resources found
[3J[H[2J☸️ $ kubectl config use-context admin
Switched to context "admin".
☸️ $ kubectl apply -f /home/dfestal/go/src/github.com/kcp-dev/kcp/config
customresourcedefinition.apiextensions.k8s.io/apiresourceimports.apiresource.kcp.io created
customresourcedefinition.apiextensions.k8s.io/negotiatedapiresources.apiresource.kcp.io created
customresourcedefinition.apiextensions.k8s.io/workloadclusters.workload.kcp.io created
☸️ $ head -n 15 ../contrib/demo/clusters/kind/us-west1.yaml
apiVersion: workload.kcp.io/v1alpha1
kind: SyncTarget
metadata:
  name: us-west1
spec:
  kubeconfig: |
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data:  
        server: https://127.0.0.1:46187
      name: kind-us-west1
    contexts:
    - context:
        cluster: kind-us-west1
☸️ $ kubectl apply -f ../contrib/demo/clusters/kind/us-west1.yaml
workloadcluster.workload.kcp.io/us-west1 created
☸️ $ head -n 15 ../contrib/demo/clusters/kind/us-east1.yaml
apiVersion: workload.kcp.io/v1alpha1
kind: SyncTarget
metadata:
  name: us-east1
spec:
  kubeconfig: |
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data:  
        server: https://127.0.0.1:40163
      name: kind-us-east1
    contexts:
    - context:
        cluster: kind-us-east1
☸️ $ kubectl apply -f ../contrib/demo/clusters/kind/us-east1.yaml
cluster.workload.kcp.io/us-east1 created
☸️ $ kubectl wait cluster/us-west1 --for condition=Ready --timeout=60s
workloadcluster.workload.kcp.io/us-west1 condition met
☸️ $ kubectl wait cluster/us-east1 --for condition=Ready --timeout=60s
workloadcluster.workload.kcp.io/us-east1 condition met
☸️ $ kubectl api-resources
NAME                          SHORTNAMES   APIVERSION                              NAMESPACED   KIND
configmaps                    cm           v1                                      true         ConfigMap
events                        ev           v1                                      true         Event
limitranges                   limits       v1                                      true         LimitRange
namespaces                    ns           v1                                      false        Namespace
resourcequotas                quota        v1                                      true         ResourceQuota
secrets                                    v1                                      true         Secret
serviceaccounts               sa           v1                                      true         ServiceAccount
customresourcedefinitions     crd,crds     apiextensions.k8s.io/v1                 false        CustomResourceDefinition
apiservices                                apiregistration.k8s.io/v1               false        APIService
apiresourceimports                         apiresource.kcp.io/v1alpha1            false        APIResourceImport
negotiatedapiresources                     apiresource.kcp.io/v1alpha1            false        NegotiatedAPIResource
deployments                   deploy       apps/v1                                 true         Deployment
tokenreviews                               authentication.k8s.io/v1                false        TokenReview
localsubjectaccessreviews                  authorization.k8s.io/v1                 true         LocalSubjectAccessReview
selfsubjectaccessreviews                   authorization.k8s.io/v1                 false        SelfSubjectAccessReview
selfsubjectrulesreviews                    authorization.k8s.io/v1                 false        SelfSubjectRulesReview
subjectaccessreviews                       authorization.k8s.io/v1                 false        SubjectAccessReview
certificatesigningrequests    csr          certificates.k8s.io/v1                  false        CertificateSigningRequest
clusters                                   workload.kcp.io/v1alpha1               false        SyncTarget
leases                                     coordination.k8s.io/v1                  true         Lease
domainnames                                discountdomainnames.biz/v1alpha1        false        DomainName
events                        ev           events.k8s.io/v1                        true         Event
flowschemas                                flowcontrol.apiserver.k8s.io/v1beta1    false        FlowSchema
prioritylevelconfigurations                flowcontrol.apiserver.k8s.io/v1beta1    false        PriorityLevelConfiguration
repos                                      github.com/v1alpha1                     false        Repo
functions                                  lambda.aws/v1alpha1                     false        LambdaFunction
loadbalancers                              multicloud.media/v1alpha1               false        LoadBalancer
website                                    netlify.com/v1alpha1                    false        Website
databases                                  postgresql.crossplane.io/v1alpha1       false        Database
databases                                  postgresql.sql.crossplane.io/v1alpha1   false        Database
topics                                     pubsub.gcp/v1alpha1                     false        PubSubTopic
clusterrolebindings                        rbac.authorization.k8s.io/v1            false        ClusterRoleBinding
clusterroles                               rbac.authorization.k8s.io/v1            false        ClusterRole
rolebindings                               rbac.authorization.k8s.io/v1            true         RoleBinding
roles                                      rbac.authorization.k8s.io/v1            true         Role
buckets                                    s3.aws/v1alpha1                         false        Bucket
channels                                   slack.com/v1alpha1                      false        Channel
topics                                     sns.aws/v1alpha1                        false        Topic
databases                                  spanner.gcp/v1alpha1                    false        Database
☸️ $ kubectl create namespace demo
namespace/demo created
☸️ $ cat ../contrib/demo/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment
spec:
  replicas: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
  selector:
    matchLabels:
      app.kubernetes.io/name: app
  template:
    metadata:
      labels:
        app.kubernetes.io/name: app
    spec:
      containers:
      - name: nginx
        image: nginx

☸️ $ kubectl apply -f ../contrib/demo/deployment.yaml -n demo
deployment.apps/my-deployment created
☸️ $ kubectl get deployments -n demo
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
my-deployment             0/10    10           0           3s
my-deployment--us-east1   0/5     5            0           3s
my-deployment--us-west1   0/5     5            0           2s
☸️ $ kubectl wait deployments --all -n demo --for=condition=Available --timeout=120s
deployment.apps/my-deployment condition met
deployment.apps/my-deployment--us-east1 condition met
deployment.apps/my-deployment--us-west1 condition met
☸️ $ kubectl get deployments -n demo
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
my-deployment             10/10   10           10          35s
my-deployment--us-east1   5/5     5            5           22s
my-deployment--us-west1   5/5     5            5           22s
☸️ $ kubectl get pods
error: the server doesn't have a resource type "pods"
