*: move crd definition out of operator.yaml into crd.yaml#223
Merged
fanminshi merged 2 commits intooperator-framework:masterfrom May 4, 2018
Merged
*: move crd definition out of operator.yaml into crd.yaml#223fanminshi merged 2 commits intooperator-framework:masterfrom
fanminshi merged 2 commits intooperator-framework:masterfrom
Conversation
Contributor
Author
|
Manual Test: $ operator-sdk new app-operator --api-version=app.example.com/v1alpha1 --kind=App
$ cd app-operator
$ cat deploy/crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: apps.app.example.com
spec:
group: app.example.com
names:
kind: App
listKind: AppList
plural: apps
singular: app
scope: Namespaced
version: v1alpha1
$ cat deploy/operator.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-operator
spec:
replicas: 1
selector:
matchLabels:
name: app-operator
template:
metadata:
labels:
name: app-operator
spec:
containers:
- name: app-operator
image: quay.io/fanminshi/example:app-operator
command:
- app-operator
imagePullPolicy: Always
$ kubectl create -f deploy/rbac.yaml
role "app-operator" created
$ kubectl create -f deploy/crd.yaml
customresourcedefinition "apps.app.example.com" created
$ operator-sdk build quay.io/fanminshi/example:app-operator
$ docker push quay.io/fanminshi/example:app-operator
The push refers to a repository [quay.io/fanminshi/example]
$ kubectl create -f deploy/operator.yaml
deployment "app-operator" created
$ kubectl create -f deploy/cr.yaml
app "example" created
$ kubectl get po
NAME READY STATUS RESTARTS AGE
app-operator-867fb9f787-bh8nf 1/1 Running 0 8m
busy-box 1/1 Running 0 7m |
hasbro17
reviewed
May 3, 2018
|
|
||
| // renderCRDYaml generates deploy/crd.yaml | ||
| func renderCRDYaml(w io.Writer, kind, apiVersion string) error { | ||
| t := template.New(crTmplName) |
Contributor
There was a problem hiding this comment.
I know the template name doesn't actually matter but this should be crdTmplName.
Contributor
Author
There was a problem hiding this comment.
@hasbro17 yeah, the name doens't matter. just for formality i guess. good catch on this one.
d1b68aa to
aa96f4f
Compare
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #76
cc/ @hasbro17 @spahl