Skip to content

Commit 2a55bd0

Browse files
fabianvfjmrodri
authored andcommitted
Add proposal for Ansible Operator 4.4 features (#2344)
1 parent 721a850 commit 2a55bd0

File tree

1 file changed

+165
-0
lines changed

1 file changed

+165
-0
lines changed
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
title: Ansible Operator Developer Experience Improvements
3+
authors:
4+
- "@fabianvf"
5+
reviewers:
6+
- TBD
7+
approvers:
8+
- TBD
9+
creation-date: 2019-12-18
10+
last-updated: 2019-12-18
11+
status: implementable
12+
see-also:
13+
- https://github.com/operator-framework/operator-sdk/pull/2048
14+
replaces: []
15+
superseded-by: []
16+
---
17+
18+
# OpenShift 4.4: Ansible Operator Developer Experience Improvements
19+
20+
## Release Signoff Checklist
21+
22+
- \[x\] Enhancement is `implementable`
23+
- \[x\] Design details are appropriately documented from clear requirements
24+
- \[ \] Test plan is defined
25+
- \[ \] Graduation criteria for dev preview, tech preview, GA
26+
- \[ \] User-facing documentation is created in [operator-sdk/doc][operator-sdk-doc]
27+
28+
## Open Questions (optional)
29+
30+
This is where to call out areas of the design that require closure before deciding
31+
to implement the design. For instance,
32+
> 1. This requires exposing previously private resources which contain sensitive
33+
information. Can we do this?
34+
35+
## Summary
36+
37+
During the OpenShift 4.4 development timeframe, we plan to improve the developer
38+
experience, focusing on a few key areas:
39+
40+
1. Ease development/debugging friction by making it easier to debug and test
41+
locally.
42+
2. Allow users to customize the behavior of the proxy, to allow them to work around
43+
APIs that do not follow conventions rather than requiring additional logic in
44+
the Golang controller.
45+
3. Update scaffolding and examples to take new tooling and best practices into
46+
consideration.
47+
48+
## Motivation
49+
50+
The motivation for these changes is to ease development friction and give more
51+
power to the users, shortening the development iteration loop and preventing them
52+
from being blocked by the Golang portion of the Ansible Operator due to
53+
Kubernetes/OpenShift API inconsistencies or operator-sdk bugs/behaviors.
54+
55+
## Goals
56+
57+
1. Allow users to whitelist/blacklist resources to be passed through the cache
58+
2. Update Ansible scaffolding, test scenarios, and examples to make use of newer
59+
Ansible features and best practices, including support for collections and
60+
simpler and more flexible test scenarios.
61+
3. Readable logs without additional dependencies, and ideally without a sidecar
62+
container.
63+
64+
### Non-Goals
65+
66+
- Perfection of the logging. We are trying to get incremental improvement for the
67+
logs of the Ansible Operator, but there will likely be additional changes and
68+
improvements that we make before a 1.0 release.
69+
- Significant changes to the tooling used for tests. We are aiming primarily to
70+
remove/refactor unnecessarily complicated aspects of the scaffolded tests,
71+
while making it easier for the user to get the behavior that they need without
72+
needing to delve into some of the nittier aspects of the testing logic.
73+
74+
## Proposal
75+
76+
This is where we get down to the nitty gritty of what the proposal actually is.
77+
78+
### User Stories
79+
80+
#### Story 1 - Use operator-sdk up local to run the Ansible-based Operator
81+
82+
As a user, I would like to be able to run `operator-sdk up local` to run my
83+
Ansible-based Operator without requiring additional work or options. Although
84+
it is currently possible to use `up local`, there are a variety of limitations
85+
that make the experience inferior to deploying the operator to a real cluster.
86+
87+
1. I would like to be able to run `up local`, and see both the operator logs as
88+
well as the logs from the Ansible stdout. I would like both logs to be useful
89+
and readable.
90+
1. I would like to be able to run `up local` and not need to change my
91+
`watches.yaml` to reflect the different paths of my host vs the operator
92+
container.
93+
94+
#### Story 2 - Use the molecule scenarios to test in a variety of environments
95+
96+
As a user, I would like to be able to use the scaffolded molecule scenarios to
97+
run the same set of tests against Kubernetes clusters in the following scenarios:
98+
99+
1. An ephemeral cluster provisioned by molecule
100+
1. An existing cluster local to my machine
101+
1. An existing cluster in the cloud
102+
1. A cluster with OLM installed
103+
1. A cluster without OLM installed
104+
105+
106+
#### Story 3 - Customize the cache to work around API issues
107+
108+
As a user, if there are issues in the way the proxy/cache handles a certain resource,
109+
I should be able to work around those issues without needing to wait for bugfixes or
110+
features in the operator-sdk, by preventing those resources from being passed through
111+
the cache at all. For example, if I need to access an OpenShift Project resource (which
112+
is not cacheable, because it is not watchable), I should be able to specify that the
113+
Project resource skips the cache in my watches.yaml.
114+
115+
116+
#### Story 4 - Readable logs by default
117+
118+
As a user, I would like to be able to tail the log of the primary operator pod and be
119+
able to see both what the Golang process and the child Ansible processes are doing,
120+
in a human readable way.
121+
122+
123+
### Risks and Mitigations
124+
125+
Because these are primarily UX improvements, there isn't too much risk of breaking
126+
compatibility or hitting unforeseen issues. The primary issue I could see is that
127+
if we begin parsing the event messages that Ansible gives us we become reliant on
128+
their structure, which is not guaranteed to remain static, so it could lead to a
129+
marginally higher maintenance burden when changing Ansible versions.
130+
131+
## Design Details
132+
133+
### Test Plan
134+
135+
1. We will add at least one test for each molecule scenario (when possible).
136+
1. We will add tests that make Ansible emit messages of each type that it supports,
137+
to help ensure that we can easily catch changes to the messag format.
138+
1. We will add a test scenario that uses `up local`.
139+
140+
### Graduation Criteria
141+
142+
N/A
143+
144+
### Upgrade / Downgrade Strategy
145+
146+
N/A
147+
148+
### Version Skew Strategy
149+
150+
N/A
151+
152+
## Implementation History
153+
154+
Major milestones in the life cycle of a proposal should be tracked in `Implementation
155+
History`.
156+
157+
## Drawbacks
158+
159+
None
160+
161+
## Alternatives
162+
163+
None
164+
165+
[operator-sdk-doc]: ../../../doc

0 commit comments

Comments
 (0)