
Kopf Sergey Vasilyev Sep 20, 2021 FIRST STEPS: 1 Installation 1 2 Concepts 3 3 Sample Problem 5 3.1 Problem Statement............................................5 3.2 Problem Solution.............................................5 4 Environment Setup 7 5 Custom Resources 9 5.1 Custom Resource Definition.......................................9 5.2 Custom Resource Objects........................................ 10 6 Starting the operator 11 7 Creating the objects 13 8 Updating the objects 15 9 Diffing the fields 19 9.1 Old & New................................................ 19 9.2 Diffs................................................... 20 10 Cascaded deletion 21 11 Cleanup 23 12 Handlers 25 12.1 Events & Causes............................................. 25 12.2 Registering................................................ 25 12.3 Event-watching handlers......................................... 26 12.4 State-changing handlers......................................... 26 12.5 Resuming handlers............................................ 27 12.6 Field handlers.............................................. 28 12.7 Sub-handlers............................................... 28 13 Daemons 31 13.1 Spawning................................................. 31 13.2 Termination................................................ 32 13.3 Timeouts................................................. 32 13.4 Safe sleep................................................. 33 i 13.5 Postponing................................................ 34 13.6 Restarting................................................. 34 13.7 Deletion prevention........................................... 35 13.8 Resource fields access.......................................... 35 13.9 Results delivery............................................. 35 13.10 Error handling.............................................. 36 13.11 Filtering................................................. 36 13.12 System resources............................................. 37 14 Timers 39 14.1 Intervals................................................. 39 14.2 Sharpness................................................. 39 14.3 Idling................................................... 40 14.4 Postponing................................................ 40 14.5 Combined timing............................................. 40 14.6 Errors in timers.............................................. 41 14.7 Results delivery............................................. 41 14.8 Filtering................................................. 42 14.9 System resources............................................. 42 15 Arguments 43 15.1 Forward compatibility kwargs...................................... 43 15.2 Retrying and timing........................................... 43 15.3 Parametrization.............................................. 43 15.4 Operator configuration.......................................... 44 15.5 Resource-related kwargs......................................... 44 15.6 Resource-watching kwargs........................................ 46 15.7 Resource-changing kwargs........................................ 46 15.8 Resource daemon kwargs........................................ 46 15.9 Resource admission kwargs....................................... 47 16 Async/Await 49 17 Loading and importing 51 18 Resource specification 53 19 Filtering 57 19.1 Metadata filters.............................................. 57 19.2 Field filters................................................ 58 19.3 Change filters............................................... 59 19.4 Value callbacks.............................................. 60 19.5 Callback filters.............................................. 60 19.6 Callback helpers............................................. 61 19.7 Stealth mode............................................... 61 20 Results delivery 63 21 Error handling 65 21.1 Temporary errors............................................. 65 21.2 Permanent errors............................................. 66 21.3 Regular errors.............................................. 66 21.4 Timeouts................................................. 66 21.5 Retries.................................................. 67 21.6 Backoff.................................................. 67 ii 22 Scopes 69 22.1 Namespaces............................................... 69 22.2 Cluster-wide............................................... 70 23 In-memory containers 71 23.1 Resource memos............................................. 71 23.2 Operator memos............................................. 71 23.3 Custom memo classes.......................................... 72 23.4 Limitations................................................ 73 24 In-memory indexing 75 24.1 Index declaration............................................. 75 24.2 Index structure.............................................. 76 24.3 Index content............................................... 76 24.4 Recipes.................................................. 77 24.5 Conditional indexing........................................... 80 24.6 Errors in indexing............................................ 80 24.7 Kwargs safety.............................................. 82 24.8 Performance............................................... 82 24.9 Guarantees................................................ 82 24.10 Limitations................................................ 83 25 Admission control 85 25.1 Dependencies............................................... 85 25.2 Validation handlers............................................ 85 25.3 Mutation handlers............................................ 86 25.4 Handler options............................................. 87 25.5 In-memory containers.......................................... 87 25.6 Admission warnings........................................... 88 25.7 Admission errors............................................. 88 25.8 Webhook management.......................................... 89 25.9 Servers and tunnels............................................ 89 25.10 Authenticate apiservers.......................................... 91 25.11 Debugging with SSL........................................... 93 25.12 Custom servers/tunnels.......................................... 94 26 Startup 97 27 Shutdown 99 28 Health-checks 101 28.1 Liveness endpoints............................................ 101 28.2 Kubernetes probing........................................... 101 28.3 Probe handlers.............................................. 102 29 Authentication 103 29.1 Custom authentication.......................................... 103 29.2 Piggybacking............................................... 104 29.3 Credentials lifecycle........................................... 105 30 Configuration 107 30.1 Startup configuration........................................... 107 30.2 Logging formats and levels........................................ 107 30.3 Logging events.............................................. 109 30.4 Synchronous handlers.......................................... 109 iii 30.5 Networking timeouts........................................... 110 30.6 Finalizers................................................. 111 30.7 Handling progress............................................ 111 30.8 Change detection............................................. 113 30.9 Storage transition............................................. 113 30.10 Retrying of API errors.......................................... 114 30.11 Throttling of unexpected errors..................................... 115 31 Peering 117 31.1 Priorities................................................. 117 31.2 Scopes.................................................. 117 31.3 Custom peering.............................................. 118 31.4 Standalone mode............................................. 119 31.5 Automatic peering............................................ 119 31.6 Multi-pod operators........................................... 119 31.7 Stealth keep-alive............................................. 120 32 Command-line options 121 32.1 Scripting options............................................. 121 32.2 Logging options............................................. 121 32.3 Scope options............................................... 121 32.4 Probing options.............................................. 122 32.5 Peering options.............................................. 122 32.6 Development mode............................................ 122 33 Events 123 33.1 Handled objects............................................. 123 33.2 Other objects............................................... 124 33.3 Events for events............................................. 124 34 Hierarchies 125 34.1 Labels.................................................. 125 34.2 Nested labels............................................... 126 34.3 Owner references............................................. 127 34.4 Names.................................................. 127 34.5 Namespaces............................................... 128 34.6 Adopting................................................. 129 34.7 3rd-party libraries............................................ 129 35 Operator testing 131 35.1 Background runner............................................ 131 36 Embedding 133 36.1 Manual orchestration........................................... 133 36.2
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages238 Page
-
File Size-