Skip to content

Commit eaa67ab

Browse files
committed
INITIAL COMMIT
0 parents  commit eaa67ab

27 files changed

+635
-0
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sudo: required
2+
services: docker
3+
language: python
4+
install:
5+
- pip install docker molecule openshift
6+
script:
7+
- molecule test -s test-local

build/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM quay.io/operator-framework/ansible-operator:v0.5.0
2+
3+
COPY roles/ ${HOME}/roles/
4+
COPY watches.yaml ${HOME}/watches.yaml
5+
COPY playbook.yml ${HOME}/playbook.yml

build/test-framework/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ARG BASEIMAGE
2+
FROM ${BASEIMAGE}
3+
USER 0
4+
RUN yum install -y python-devel gcc libffi-devel && pip install molecule
5+
ARG NAMESPACEDMAN
6+
ADD $NAMESPACEDMAN /namespaced.yaml
7+
ADD build/test-framework/ansible-test.sh /ansible-test.sh
8+
RUN chmod +x /ansible-test.sh
9+
USER 1001
10+
ADD . /opt/ansible/project

build/test-framework/ansible-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
export WATCH_NAMESPACE=${TEST_NAMESPACE}
3+
(/usr/local/bin/entrypoint)&
4+
trap "kill $!" SIGINT SIGTERM EXIT
5+
6+
cd ${HOME}/project
7+
exec molecule test -s test-cluster
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: bench.example.com/v1alpha1
2+
kind: Bench
3+
metadata:
4+
name: example-bench
5+
spec:
6+
# Add fields here
7+
size: 3
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
creationTimestamp: null
5+
name: benches.bench.example.com
6+
spec:
7+
group: bench.example.com
8+
names:
9+
kind: Bench
10+
listKind: BenchList
11+
plural: benches
12+
singular: bench
13+
scope: Namespaced
14+
subresources:
15+
status: {}
16+
version: v1alpha1
17+
versions:
18+
- name: v1alpha1
19+
served: true
20+
storage: true

deploy/operator.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: benchmark-operator
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
name: benchmark-operator
10+
template:
11+
metadata:
12+
labels:
13+
name: benchmark-operator
14+
spec:
15+
serviceAccountName: benchmark-operator
16+
containers:
17+
- name: benchmark-operator
18+
# Replace this with the built image name
19+
image: "{{ REPLACE_IMAGE }}"
20+
imagePullPolicy: "{{ pull_policy|default('Always') }}"
21+
env:
22+
- name: WATCH_NAMESPACE
23+
valueFrom:
24+
fieldRef:
25+
fieldPath: metadata.namespace
26+
- name: POD_NAME
27+
valueFrom:
28+
fieldRef:
29+
fieldPath: metadata.name
30+
- name: OPERATOR_NAME
31+
value: "benchmark-operator"

deploy/role.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
creationTimestamp: null
5+
name: benchmark-operator
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- pods
11+
- services
12+
- endpoints
13+
- persistentvolumeclaims
14+
- events
15+
- configmaps
16+
- secrets
17+
verbs:
18+
- '*'
19+
- apiGroups:
20+
- ""
21+
resources:
22+
- namespaces
23+
verbs:
24+
- get
25+
- apiGroups:
26+
- apps
27+
resources:
28+
- deployments
29+
- daemonsets
30+
- replicasets
31+
- statefulsets
32+
verbs:
33+
- '*'
34+
- apiGroups:
35+
- monitoring.coreos.com
36+
resources:
37+
- servicemonitors
38+
verbs:
39+
- get
40+
- create
41+
- apiGroups:
42+
- bench.example.com
43+
resources:
44+
- '*'
45+
verbs:
46+
- '*'

deploy/role_binding.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
kind: RoleBinding
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
metadata:
4+
name: benchmark-operator
5+
subjects:
6+
- kind: ServiceAccount
7+
name: benchmark-operator
8+
roleRef:
9+
kind: Role
10+
name: benchmark-operator
11+
apiGroup: rbac.authorization.k8s.io

deploy/service_account.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: benchmark-operator

0 commit comments

Comments
 (0)