A Twisted implementation of Kubernetes
import base64
from twisted.internet import defer, task
import txk8s
@defer.inlineCallbacks
def main(reactor):
txcli = txk8s.TxKubernetesClient()
# let's create and store a secret
sec_b64 = base64.b64encode("oh this should definitely not be hardcoded")
meta = txcli.V1ObjectMeta(name='mysecret')
body = txcli.V1Secret(data={'myuser': sec_b64}, metadata=meta)
res = yield txcli.call(txcli.coreV1.create_namespaced_secret, 'default', body)
print 'Create and store: %r: %r\n' % (res.metadata.self_link, res.data)
# now let's get the same secret back out
retrieved_secret = yield txcli.call(txcli.coreV1.read_namespaced_secret, 'mysecret', 'default')
print 'Retrieve:', retrieved_secret.data
defer.returnValue(retrieved_secret)
task.react(main)
- Increment
__version__
in_version.py
. - Update the Change Log below.
- Run the following:
python setup.py sdist bdist_wheel
twine upload dist/*<version>*
- No longer output errors to stdout (#7)
0.1.2 - 2018-01-04
- tests fixed from lambdification
0.1.1 - 2017-12-28
- doc/ dir and first doc on module!
- Removed a response parameter to many funcs & converted to lambda function
0.1.0 - 2017-12-27
- Version incremented to 0.1.0 and is no longer pre-alpha!!
- Fixed version import in init
Older - 2017-12-27
- v1
- Example usage for secret creation/retrieval
- Coverage report for tox tests
- Test fixtures from previous internal project
- Project code reviewed for first public release!
- Loosened requirements for dependencies in setup AND requirements
- Fixed module self-dependency nonsense
- Testing approach altered significantly