Skip to content

Commit

Permalink
Web Page Sample Skeleton
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Mészáros <[email protected]>
  • Loading branch information
csviri committed Jan 24, 2024
1 parent 868a066 commit db9ad59
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
82 changes: 82 additions & 0 deletions src/test/resources/samples/webpage/web-page-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: io.csviri.operator.resourceflow/v1beta1
kind: ResourceFlowOperator
metadata:
name: rfo1
spec:
parent:
apiVersion: resourceflow.sample/v1
kind: WebPage
resources:
- name: html-config-map
resource:
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{parent.metadata.name}}"
data:
index.html: "{{{parent.spec.html}}}"
- name: deployment
resource:
apiVersion: apps/v1 #
kind: Deployment
metadata:
name: "{{parent.metadata.name}}"
spec:
selector:
matchLabels:
app: "{{parent.metadata.name}}"
replicas: 1
template:
metadata:
labels:
app: "{{parent.metadata.name}}"
spec:
containers:
- name: nginx
image: nginx:1.17.0
ports:
- containerPort: 80
volumeMounts:
- name: html-volume
mountPath: /usr/share/nginx/html
volumes:
- name: html-volume
configMap:
name: "{{parent.metadata.name}}"
- name: service
resource:
apiVersion: v1
kind: Service
metadata:
name: "{{parent.metadata.name}}"
spec:
selector:
app: "{{parent.metadata.name}}"
ports:
- protocol: TCP
port: 80
targetPort: 80
type: NodePort
- name: ingress
condition:
type: JSCondition
script: |
parent.spec.exposed == "true";
resource:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "{{parent.metadata.name}}"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: "{{parent.metadata.name}}"
port:
number: 80
34 changes: 34 additions & 0 deletions src/test/resources/samples/webpage/webpages.crd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Fabric8 CRDGenerator, manual edits might get overwritten!
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: resourceflow.sample.webpage
spec:
group: resourceflow.sample
names:
kind: WebPage
plural: webpages
singular: webpage
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
spec:
properties:
exposed:
type: boolean
html:
type: string
type: object
status:
properties:
observedGeneration:
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}

0 comments on commit db9ad59

Please sign in to comment.