New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
k8s - Service and Deployment #234
Conversation
jenkins/superCI comment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@# use it like this: `make test-in-container TEST_TARGET=tests/integration/test_utils.py`k | ||
docker run --net=host --rm -v /dev:/dev:ro -v /var/lib/docker:/var/lib/docker:ro --security-opt label=disable --cap-add SYS_ADMIN -e KUBECONFIG=/var/lib/origin/openshift.local.config/master/admin.kubeconfig -ti -v /var/run/docker.sock:/var/run/docker.sock -v $(CURDIR):/src -v $(CURDIR)/pytest-container.ini:/src/pytest.ini $(TEST_IMAGE_NAME) /bin/bash -c "oc login 127.0.0.1:8443 -u developer -p developer -n conu --insecure-skip-tls-verify && make exec-test TEST_TARGET=$(TEST_TARGET)" | ||
|
||
test-k8s-minikube: build-test-container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the test-in-container
target also have build-test-container
as dependency ?
conu/backend/k8s/deployment.py
Outdated
""" | ||
|
||
print(self.get_status().replicas) | ||
print(self.get_status().ready_replicas) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftovers ? (there are more)
conu/backend/docker/image.py
Outdated
try: | ||
pod_instance = api.create_namespaced_pod(namespace=namespace, body=pod) | ||
except ApiException as e: | ||
print("Exception when calling CoreV1Api->create_namespaced_pod: %s\n" % e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print
-> logger.exception()
?
requirements.txt
Outdated
@@ -2,6 +2,6 @@ enum34>=1.1.6 ; python_version <= '2.7' | |||
requests | |||
six | |||
docker | |||
openshift | |||
kubernetes == 6.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about kubernetes >= 6.0.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty solid, very nice work!
The only nit I have is the .get_status()
methods: I would prefer if they returned enum defined in conu and not in kubernetes client.
jenkins/superCI comment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🏅
I wasn't able to run it locally - also CI is failing. Can you recognize this error?
Can you add version of kubernetes python library that supports client.AppsV1Api and similar failing? |
This PR contains initial work on Service and Deployment k8s primitives.
Changes included:
minor refactor of
pod.py
- static method
create
for creatingV1Pod
object that we can pass to method creating deploymentminor change in requirements, because of incompatible versions of Kubernetes and Kubernetes python client while creating
AppsV1Api
for deploymentnew target in
Makefile
-test-k8s-minikube
for verifying Kubernetes tests locally until new CI is setup. Just run on host machineminikube start
andmake test-k8s-minikube