ADD: added setting of namespace in to KubePod class
This commit is contained in:
@@ -22,8 +22,8 @@ namespace kubecontrol
|
||||
|
||||
|
||||
|
||||
KubePod::KubePod(std::string Owner, std::string Uuid, std::string ContainerImage):Owner_(Utils::to_lower(Owner)),Uuid_(Utils::to_lower(Uuid)),
|
||||
ContainerImage_(ContainerImage),EnvirmonentVars_()
|
||||
KubePod::KubePod(std::string Owner, std::string Uuid, std::string ContainerImage,std::string Namespace):Owner_(Utils::to_lower(Owner)),Uuid_(Utils::to_lower(Uuid)),
|
||||
ContainerImage_(ContainerImage),Namespace_(Namespace),EnvirmonentVars_()
|
||||
{
|
||||
ContainerRegistry_ = "kmaster.ti.unibw-hamburg.de:30808";
|
||||
EnvirmonentVars_ = std::map<std::string, std::string>();
|
||||
@@ -42,8 +42,8 @@ namespace kubecontrol
|
||||
}
|
||||
|
||||
|
||||
KubePod::KubePod(std::string Owner, std::string Uuid, std::string Component, std::string ContainerImage):Owner_(Utils::to_lower(Owner)),
|
||||
Uuid_(Utils::to_lower(Uuid)),Component_(Utils::to_lower(Component)), ContainerImage_(ContainerImage),EnvirmonentVars_()
|
||||
KubePod::KubePod(std::string Owner, std::string Uuid, std::string Component, std::string ContainerImage,std::string Namespace):Owner_(Utils::to_lower(Owner)),
|
||||
Uuid_(Utils::to_lower(Uuid)),Component_(Utils::to_lower(Component)), ContainerImage_(ContainerImage),Namespace_(Namespace),EnvirmonentVars_()
|
||||
{
|
||||
ContainerRegistry_ = "kmaster.ti.unibw-hamburg.de:30808";
|
||||
EnvirmonentVars_ = std::map<std::string, std::string>();
|
||||
@@ -133,6 +133,7 @@ namespace kubecontrol
|
||||
node["apiVersion"] = "v1";
|
||||
node["kind"] = "Pod";
|
||||
node["metadata"]["name"] = this->Uuid_;
|
||||
node["metadata"]["namespace"] = this->Namespace_;
|
||||
node["metadata"]["labels"]["app.kubernetes.io/name"] = this->Uuid_;
|
||||
|
||||
node["metadata"]["labels"]["app.kubernetes.io/part-of"] = this->Owner_;
|
||||
@@ -143,6 +144,8 @@ namespace kubecontrol
|
||||
node["spec"]["containers"][0]["name"] = this->Uuid_+"-container";
|
||||
node["spec"]["containers"][0]["image"] = this->ContainerRegistry_ + "/" + this->ContainerImage_;
|
||||
node["spec"]["containers"][0]["imagePullPolicy"] = "Always";
|
||||
node["spec"]["containers"][0]["ports"][0]["containerPort"] = 10000;
|
||||
node["spec"]["containers"][0]["ports"][0]["protocol"] = "UDP";
|
||||
|
||||
int i = 0;
|
||||
for (auto item :EnvirmonentVars_) {
|
||||
|
||||
Reference in New Issue
Block a user