Skip to content

Instantly share code, notes, and snippets.

@gree-gorey
Last active March 28, 2019 13:25
Show Gist options
  • Save gree-gorey/ad6afecd089cc6d236eb6a206d6a346e to your computer and use it in GitHub Desktop.
Save gree-gorey/ad6afecd089cc6d236eb6a206d6a346e to your computer and use it in GitHub Desktop.

Emoji in CR

$ kubectl create -f crd.yaml
customresourcedefinition.apiextensions.k8s.io/emojis.emoji.local created
$  kubectl create -f cr.yaml 
emoji.emoji.local/example-emoji created
$ kubectl get emoji example-emoji -o json
{
    "apiVersion": "emoji.local/v1alpha1",
    "kind": "Emoji",
    "metadata": {
        "name": "example-emoji",
        "namespace": "test"
    },
    "spec": {
        "πŸ“": "πŸš€πŸš€πŸš€"
    }
}
apiVersion: emoji.local/v1alpha1
kind: Emoji
metadata:
name: example-emoji
spec:
# aka "size": 3
πŸ“: πŸš€πŸš€πŸš€
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: emojis.emoji.local
spec:
group: emoji.local
names:
kind: Emoji
listKind: EmojiList
plural: emojis
singular: emoji
scope: Namespaced
version: v1alpha1
subresources:
status: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment