-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add GCP Compute Engine & Kubernetes Integration #90
base: humble
Are you sure you want to change the base?
Conversation
user = subprocess.check_output('whoami', shell=True).decode().strip() | ||
|
||
# Username | ||
self._username = (open(f'/home/{user}/.ssh/google_compute_engine.pub'). |
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.
It would be nice to break this up into more separate steps, as it is tough to parse what is going on currently.
pod_config: dict = json.loads(open(f'{kube_wd}/pod.json').read()) | ||
|
||
# Configure the pod | ||
pod_config['spec']['containers'][0]["image"] = self.container_image |
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.
Perhaps change the quotations around "image" to be ' to match the rest of the strings.
|
||
# Configure the pod | ||
pod_config['spec']['containers'][0]["image"] = self.container_image | ||
pod_config['spec']['containers'][0]["name"] = self._name |
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.
Perhaps change the quotations around "name" to be ' to match the rest of the strings.
pod_config['spec']['containers'][0]["image"] = self.container_image | ||
pod_config['spec']['containers'][0]["name"] = self._name | ||
pod_config['spec']['containers'][0]['resources']['requests']['memory'] = str(self._mmb) + 'Mi' | ||
pod_config['spec']['containers'][0]['resources']['requests']['cpu'] = str(self._mcpu) + "m" |
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 suppose for some of these, the string quotations aren't consistent across the board, and it would be great if they could be unified.
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.
Overall, I think it looks good! One question I have is if there are requirements (gcloud?) you could add to the requirements.txt or package.xml.
This PR adds full support for GCP and Kubernetes.
GCP Usage:
Kubernetes Usage
Requires gcloud CLI and/or kubectl on local host
Changes to review:
ip
property and now avpn_ip
property. Kubernetes has separate addresses for the two services so a modification was also made to the VPN classubuntu
username inClouldInstance
Known Issues: