Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
6adec196
Commit
6adec196
authored
Mar 11, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ranamed ARTICONF.docker.Orchestrator.Kubernetes
parent
1f895cbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
3 deletions
+66
-3
example_ansible_output.out
ansible_playbooks/example_ansible_output.out
+64
-1
tosca.py
deployer/service/tosca.py
+2
-2
No files found.
ansible_playbooks/example_ansible_output.out
View file @
6adec196
\nPLAY [k8-master] ***************************************************************\n\nTASK [Gathering Facts] *********************************************************\nok: [54.93.250.84]\n\nTASK [install pip modules] *****************************************************\nchanged: [54.93.250.84]\n\nTASK [copy task src: /home/alogo/workspace/DRIP/deployer/k8s/dashboard.yaml dest: /tmp/dashboard.yaml] ***\nok: [54.93.250.84]\n\nTASK [create_dashboard] ********************************************************\nchanged: [54.93.250.84]\n\nTASK [create_admin_dashboard] **************************************************\nok: [54.93.250.84]\n\nTASK [create_admin_cluster_role_binding] ***************************************\nok: [54.93.250.84]\n\nTASK [get token] ***************************************************************\nchanged: [54.93.250.84]\n\nTASK [print token] *************************************************************\nok: [54.93.250.84] => {\n "dashboard_token": {\n "changed": true, \n "cmd": "kubectl describe secret $(kubectl get secret | grep admin-user | awk \'{print $1}\')", \n "delta": "0:00:00.149191", \n "end": "2020-02-05 11:12:17.981963", \n "failed": false, \n "rc": 0, \n "start": "2020-02-05 11:12:17.832772", \n "stderr": "", \n "stderr_lines": [], \n "stdout": "Name: admin-user-token-dpmgw\\nNamespace: default\\nLabels: <none>\\nAnnotations: kubernetes.io/service-account.name: admin-user\\n kubernetes.io/service-account.uid: bc04be40-3782-422a-bca2-032be8596fb0\\n\\nType: kubernetes.io/service-account-token\\n\\nData\\n====\\ntoken: eyJhbGciOiJSUzI1NiIsImtpZCI6InduMVZmamRqODRTZXg1eDktVTRCTnlLQ1FHQm85RDgzSU1mYnZHQVRPeWsifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImFkbWluLXVzZXItdG9rZW4tZHBtZ3ciLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiYWRtaW4tdXNlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImJjMDRiZTQwLTM3ODItNDIyYS1iY2EyLTAzMmJlODU5NmZiMCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmFkbWluLXVzZXIifQ.W1xXAuMcJe1zbs4gaqtEbwer8Wc20Wm1hrPtJdCB6LTSWL7UFNl8Xjq5dXPrfOr8TsoDwvBpoLc6HEXb7MDMVX5TC_2lXEy0t3pHEu3uOsvm7Y5sRMaKOmEcw4jpsAz5UuVWO0MP3qSDXdf28Wq-zVf57tRKOr8WcSLv23oKVt_eeqQgroqA6E2PThFXvTnyGzXAPn7wmpWcAY7MIa-pntJEorwRsTRAwt8o0KcmiNMOKkJiRz3vp-Lq3lITT6lXazfXwG4nWGlLmFA8tosBdH2EXqai3d_0LJfQ2Or6Vn0Tqti6Z47xOJlJOiy1GM810dc0cZ1J-tuHbVdJt08Eig\\nca.crt: 1025 bytes\\nnamespace: 7 bytes", \n "stdout_lines": [\n "Name: admin-user-token-dpmgw", \n "Namespace: default", \n "Labels: <none>", \n "Annotations: kubernetes.io/service-account.name: admin-user", \n " kubernetes.io/service-account.uid: bc04be40-3782-422a-bca2-032be8596fb0", \n "", \n "Type: kubernetes.io/service-account-token", \n "", \n "Data", \n "====", \n "token: eyJhbGciOiJSUzI1NiIsImtpZCI6InduMVZmamRqODRTZXg1eDktVTRCTnlLQ1FHQm85RDgzSU1mYnZHQVRPeWsifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImFkbWluLXVzZXItdG9rZW4tZHBtZ3ciLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiYWRtaW4tdXNlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImJjMDRiZTQwLTM3ODItNDIyYS1iY2EyLTAzMmJlODU5NmZiMCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmFkbWluLXVzZXIifQ.W1xXAuMcJe1zbs4gaqtEbwer8Wc20Wm1hrPtJdCB6LTSWL7UFNl8Xjq5dXPrfOr8TsoDwvBpoLc6HEXb7MDMVX5TC_2lXEy0t3pHEu3uOsvm7Y5sRMaKOmEcw4jpsAz5UuVWO0MP3qSDXdf28Wq-zVf57tRKOr8WcSLv23oKVt_eeqQgroqA6E2PThFXvTnyGzXAPn7wmpWcAY7MIa-pntJEorwRsTRAwt8o0KcmiNMOKkJiRz3vp-Lq3lITT6lXazfXwG4nWGlLmFA8tosBdH2EXqai3d_0LJfQ2Or6Vn0Tqti6Z47xOJlJOiy1GM810dc0cZ1J-tuHbVdJt08Eig", \n "ca.crt: 1025 bytes", \n "namespace: 7 bytes"\n ]\n }\n}\n\nTASK [Create a Service object0] ************************************************\nfatal: [54.93.250.84]: FAILED! => {"changed": false, "error": 422, "msg": "Failed to patch object: {\\"kind\\":\\"Status\\",\\"apiVersion\\":\\"v1\\",\\"metadata\\":{},\\"status\\":\\"Failure\\",\\"message\\":\\"Service \\\\\\"logspout\\\\\\" is invalid: spec.ports[0].nodePort: Invalid value: 8000: provided port is not in the valid range. The range of valid ports is 30000-32767\\",\\"reason\\":\\"Invalid\\",\\"details\\":{\\"name\\":\\"logspout\\",\\"kind\\":\\"Service\\",\\"causes\\":[{\\"reason\\":\\"FieldValueInvalid\\",\\"message\\":\\"Invalid value: 8000: provided port is not in the valid range. The range of valid ports is 30000-32767\\",\\"field\\":\\"spec.ports[0].nodePort\\"}]},\\"code\\":422}\\n", "reason": "Unprocessable Entity", "status": 422}\n\nPLAY RECAP *********************************************************************\n54.93.250.84 : ok=8 changed=3 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 \n\n
PLAY [k8-master] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [145.100.133.173]
TASK [install pip modules] *****************************************************
changed: [145.100.133.173]
TASK [copy task src: /home/alogo/workspace/DRIP/deployer/k8s/dashboard.yaml dest: /tmp/dashboard.yaml] ***
ok: [145.100.133.173]
TASK [create_dashboard] ********************************************************
changed: [145.100.133.173]
TASK [create_admin_dashboard] **************************************************
ok: [145.100.133.173]
TASK [create_admin_cluster_role_binding] ***************************************
ok: [145.100.133.173]
TASK [get token] ***************************************************************
changed: [145.100.133.173]
TASK [print token] *************************************************************
ok: [145.100.133.173] => {
"dashboard_token": {
"changed": true,
"cmd": "kubectl describe secret $(kubectl get secret | grep admin-user | awk '{print $1}')",
"delta": "0:00:00.492453",
"end": "2020-03-11 17:26:29.268296",
"failed": false,
"rc": 0,
"start": "2020-03-11 17:26:28.775843",
"stderr": "",
"stderr_lines": [],
"stdout": "Name: admin-user-token-c857d\nNamespace: default\nLabels: <none>\nAnnotations: kubernetes.io/service-account.name: admin-user\n kubernetes.io/service-account.uid: 78b17dda-d38c-4ea3-b98e-e6413a81e9ae\n\nType: kubernetes.io/service-account-token\n\nData\n====\nca.crt: 1025 bytes\nnamespace: 7 bytes\ntoken: eyJhbGciOiJSUzI1NiIsImtpZCI6IjRwT3AyYVlJWjJRNm90dGlZUUJLVU5kOGo0N1ZXSXptSnFfS2pWeWJndU0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImFkbWluLXVzZXItdG9rZW4tYzg1N2QiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiYWRtaW4tdXNlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6Ijc4YjE3ZGRhLWQzOGMtNGVhMy1iOThlLWU2NDEzYTgxZTlhZSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmFkbWluLXVzZXIifQ.JG3DLoGbow-9WQkMl26fX-tD_ppt86Bavz5VE4eW_9oHiZoIdr5-ePEWMAuOP1QEiXMex4wTBxnNv1D4AFQdvdvrsWua6EoiCGioeYeMwV2Bxz5nzq6Qo0y7D9ZO5zyIoQ7eZeOptm9CdsAepABP9cvmNZZydKWh_KRl_0uaGL008-1FLqBSqIh5LHseR9YPQYkIj9e8mlUIUaT-2WshilSzVBl1YjmJcbm9VJkH0GCBzzbhCcszsyMk9V50mfg_ZNtMms_7D2ExZaCYqd-aamug0ku8e5JsXuaKq9Jr3qIXRizZT8_QEM48o--O0e25KZtCqEVwe1g58YbJ5I3obQ",
"stdout_lines": [
"Name: admin-user-token-c857d",
"Namespace: default",
"Labels: <none>",
"Annotations: kubernetes.io/service-account.name: admin-user",
" kubernetes.io/service-account.uid: 78b17dda-d38c-4ea3-b98e-e6413a81e9ae",
"",
"Type: kubernetes.io/service-account-token",
"",
"Data",
"====",
"ca.crt: 1025 bytes",
"namespace: 7 bytes",
"token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjRwT3AyYVlJWjJRNm90dGlZUUJLVU5kOGo0N1ZXSXptSnFfS2pWeWJndU0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImFkbWluLXVzZXItdG9rZW4tYzg1N2QiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiYWRtaW4tdXNlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6Ijc4YjE3ZGRhLWQzOGMtNGVhMy1iOThlLWU2NDEzYTgxZTlhZSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmFkbWluLXVzZXIifQ.JG3DLoGbow-9WQkMl26fX-tD_ppt86Bavz5VE4eW_9oHiZoIdr5-ePEWMAuOP1QEiXMex4wTBxnNv1D4AFQdvdvrsWua6EoiCGioeYeMwV2Bxz5nzq6Qo0y7D9ZO5zyIoQ7eZeOptm9CdsAepABP9cvmNZZydKWh_KRl_0uaGL008-1FLqBSqIh5LHseR9YPQYkIj9e8mlUIUaT-2WshilSzVBl1YjmJcbm9VJkH0GCBzzbhCcszsyMk9V50mfg_ZNtMms_7D2ExZaCYqd-aamug0ku8e5JsXuaKq9Jr3qIXRizZT8_QEM48o--O0e25KZtCqEVwe1g58YbJ5I3obQ"
]
}
}
TASK [Create a Service object0] ************************************************
ok: [145.100.133.173]
TASK [Create a deployment object0] *********************************************
ok: [145.100.133.173]
PLAY RECAP *********************************************************************
145.100.133.173 : ok=10 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
deployer/service/tosca.py
View file @
6adec196
...
@@ -24,7 +24,7 @@ def get_vms(tosca_template_json):
...
@@ -24,7 +24,7 @@ def get_vms(tosca_template_json):
def
add_tokens
(
tokens
,
tosca_template_dict
):
def
add_tokens
(
tokens
,
tosca_template_dict
):
node_templates
=
tosca_template_dict
[
'topology_template'
][
'node_templates'
]
node_templates
=
tosca_template_dict
[
'topology_template'
][
'node_templates'
]
for
node_name
in
node_templates
:
for
node_name
in
node_templates
:
if
node_templates
[
node_name
][
'type'
]
==
'tosca.nodes.ARTICONF.Orchestrator.Kubernetes'
:
if
node_templates
[
node_name
][
'type'
]
==
'tosca.nodes.ARTICONF.
docker.
Orchestrator.Kubernetes'
:
creds
=
[]
creds
=
[]
for
token_name
in
tokens
:
for
token_name
in
tokens
:
cred
=
{
'token_type'
:
'k8s_token'
,
'token'
:
tokens
[
token_name
],
'user'
:
token_name
}
cred
=
{
'token_type'
:
'k8s_token'
,
'token'
:
tokens
[
token_name
],
'user'
:
token_name
}
...
@@ -39,7 +39,7 @@ def add_tokens(tokens, tosca_template_dict):
...
@@ -39,7 +39,7 @@ def add_tokens(tokens, tosca_template_dict):
def
add_dashboard_url
(
dashboard_url
,
tosca_template_dict
):
def
add_dashboard_url
(
dashboard_url
,
tosca_template_dict
):
node_templates
=
tosca_template_dict
[
'topology_template'
][
'node_templates'
]
node_templates
=
tosca_template_dict
[
'topology_template'
][
'node_templates'
]
for
node_name
in
node_templates
:
for
node_name
in
node_templates
:
if
node_templates
[
node_name
][
'type'
]
==
'tosca.nodes.ARTICONF.Orchestrator.Kubernetes'
:
if
node_templates
[
node_name
][
'type'
]
==
'tosca.nodes.ARTICONF.
docker.
Orchestrator.Kubernetes'
:
if
'attributes'
not
in
node_templates
[
node_name
]:
if
'attributes'
not
in
node_templates
[
node_name
]:
node_templates
[
node_name
][
'attributes'
]
=
{}
node_templates
[
node_name
][
'attributes'
]
=
{}
attributes
=
node_templates
[
node_name
][
'attributes'
]
attributes
=
node_templates
[
node_name
][
'attributes'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment