Skip to content

Instantly share code, notes, and snippets.

@shovanmaity
Created April 7, 2021 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shovanmaity/40f5f558700c42e691d01aea67d7a226 to your computer and use it in GitHub Desktop.
Save shovanmaity/40f5f558700c42e691d01aea67d7a226 to your computer and use it in GitHub Desktop.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: hellos.hello.k8s.io
annotations:
api-approved.kubernetes.io: unapproved
spec:
group: hello.k8s.io
names:
kind: Hello
listKind: HelloList
plural: hellos
singular: hello
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Hello is a specification for a Hello resource
properties:
apiVersion:
description: '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'
type: string
kind:
description: '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'
type: string
spec:
description: HelloSpec is the spec for a Hello resource
properties:
fileContents:
type: string
fileName:
type: string
required:
- fileContents
- fileName
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: v1
kind: Namespace
metadata:
name: hello
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hello-account
namespace: hello
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hello-role
rules:
- apiGroups: [""]
resources: [persistentvolumes]
verbs: [get, list, watch, patch]
- apiGroups: [""]
resources: [persistentvolumeclaims]
verbs: [get, list, watch, patch, create, delete]
- apiGroups: [""]
resources: [pods]
verbs: [get, list, watch, create, delete]
- apiGroups: [storage.k8s.io]
resources: [storageclasses]
verbs: [get, list, watch]
- apiGroups: [hello.k8s.io]
resources: [hellos]
verbs: [get, list, watch]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hello-binding
subjects:
- kind: ServiceAccount
name: hello-account
namespace: hello
roleRef:
kind: ClusterRole
name: hello-role
apiGroup: rbac.authorization.k8s.io
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: hello-populator
namespace: hello
spec:
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
serviceAccount: hello-account
containers:
- name: hello
image: shovan1995/hello-populator:latest
imagePullPolicy: Always
args:
- --mode=controller
- --image-name=shovan1995/hello-populator:latest
---
kind: VolumePopulator
apiVersion: populator.storage.k8s.io/v1alpha1
metadata:
name: hello-populator
sourceKind:
group: hello.k8s.io
kind: Hello
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment