Skip to content

Instantly share code, notes, and snippets.

View djkonro's full-sized avatar
🎯
Focusing

Konrad Djimeli djkonro

🎯
Focusing
View GitHub Profile
'''
intro.py
Managing kubernetes objects using common resource operations with the python client
-----------------------------------------------------------------------------------------------
Some of this operations include;
- **`create_xxxx`** : create a resource object. Ex **`create_namespaced_pod`** and **`create_namespaced_deployment`**, for creation of pods and deployments respectively. This performs operations similar to `kubectl create`.
from kubernetes import client, config
config.load_kube_config()
# create an instance of the API class
api_instance = client.CoreV1Api()
service = client.V1Service()
from kubernetes import client, config
config.load_kube_config()
extensions = client.ExtensionsV1beta1Api()
deployment = client.models.extensions_v1beta1_deployment.ExtensionsV1beta1Deployment()
namespace = 'default'
deployment.api_version = 'extensions/v1beta1'
#include <iostream>
using namespace std;
int main(void)
{
for(int i = 1; i <= 100; i++){
if ((i % 3 == 0) && (i % 5 == 0)) {
cout << "CracklePop" << endl;
} else if (i % 3 == 0) {