Skip to content

Instantly share code, notes, and snippets.

@rhuss
Created April 5, 2019 21:46
Show Gist options
  • Save rhuss/909f1ea65ae2a526be953110fd18c57e to your computer and use it in GitHub Desktop.
Save rhuss/909f1ea65ae2a526be953110fd18c57e to your computer and use it in GitHub Desktop.
CRDs with multiple version on OpenShift
$ kubectl get crd | grep crontab
crontabs.example.com                                                     2019-04-05T21:33:36Z

$ kubectl get crontab
NAME      AGE
new-tab   6m
old-tab   5m

$ kubectl get crontab old-tab -o yaml
apiVersion: example.com/v1
kind: CronTab
metadata:
  creationTimestamp: "2019-04-05T21:39:26Z"
  generation: 1
  name: old-tab
  namespace: myproject
  resourceVersion: "72559"
  selfLink: /apis/example.com/v1/namespaces/myproject/crontabs/old-tab
  uid: 48e28ce5-57eb-11e9-8d23-962951681228
spec:
  host: localhost
  port: 8080
  
$ kubectl get crontab new-tab -o yaml
apiVersion: example.com/v1
kind: CronTab
metadata:
  creationTimestamp: "2019-04-05T21:38:35Z"
  generation: 1
  name: new-tab
  namespace: myproject
  resourceVersion: "72162"
  selfLink: /apis/example.com/v1/namespaces/myproject/crontabs/new-tab
  uid: 2ac6df7b-57eb-11e9-8d23-962951681228
spec:
  hostPort: localhost:8080
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: crontabs.example.com
spec:
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
properties:
hostPort:
type: string
- name: v1
served: true
storage: false
schema:
openAPIV3Schema:
properties:
host:
type: string
port:
type: string
conversion:
# No conversion
strategy: None
scope: Namespaced
names:
plural: crontabs
singular: crontab
kind: CronTab
apiVersion: example.com/v1beta1
kind: CronTab
metadata:
name: new-tab
spec:
hostPort: localhost:8080
apiVersion: example.com/v1
kind: CronTab
metadata:
name: old-tab
spec:
host: localhost
port: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment