I am trying to deploy a resource to a kubernetes cluster via Cloudify UI, however I am getting the below error. Can anyone please help.
This is my blueprint.
tosca_definitions_version: cloudify_dsl_1_3
description: >
This blueprint installs helm client, add repository to it and install
chart(without values file and flags),using kubeconfig file content.
imports:
- http://cloudify.co/spec/cloudify/5.0.5/types.yaml
- plugin:cloudify-helm-plugin
- plugin:cloudify-kubernetes-plugin?version= >=2.13.0
node_templates:
sanity_pod:
type: cloudify.kubernetes.resources.Pod
properties:
client_config:
configuration:
file_content: { get_secret: **configuration_file_content** }
definition:
apiVersion: v1
kind: Pod
metadata:
name: cloudify-nginx-withkubeConfig
spec:
containers:
- name: nginx
image: nginx:stable
The configuration_file_content is the kubeconfig file in yaml format (tried with json also) which has been uploaded to the Resource section in cloudify. During the deployment I am getting the below error.
[
{
"message": "string indices must be integers",
"traceback": "Traceback (most recent call last):\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/decorators.py\", line 285, in wrapper\n authentication_property\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/client.py\", line 127, in __init__\n prepare_api = api_configuration.prepare_api()\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 34, in prepare_api\n api = self._do_prepare_api()\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 172, in _do_prepare_api\n **self.kwargs\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 34, in prepare_api\n api = self._do_prepare_api()\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 109, in _do_prepare_api\n os.path.expanduser(KUBE_CONFIG_DEFAULT_LOCATION)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 199, in __init__\n self.set_active_context(active_context)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 250, in set_active_context\n context_name = self._config['current-context']\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 611, in __getitem__\n v = self.safe_get(key)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 608, in safe_get\n return self.value[key]\nTypeError: string indices must be integers\n",
"type": "TypeError"
},
{
"message": "Error encountered",
"type": "RecoverableError",
"traceback": "Traceback (most recent call last):\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/decorators.py\", line 285, in wrapper\n authentication_property\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/client.py\", line 127, in __init__\n prepare_api = api_configuration.prepare_api()\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 34, in prepare_api\n api = self._do_prepare_api()\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 172, in _do_prepare_api\n **self.kwargs\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 34, in prepare_api\n api = self._do_prepare_api()\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/k8s/config.py\", line 109, in _do_prepare_api\n os.path.expanduser(KUBE_CONFIG_DEFAULT_LOCATION)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 199, in __init__\n self.set_active_context(active_context)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 250, in set_active_context\n context_name = self._config['current-context']\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 611, in __getitem__\n v = self.safe_get(key)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/kubernetes/config/kube_config.py\", line 608, in safe_get\n return self.value[key]\nTypeError: string indices must be integers\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/mgmtworker/env/lib/python3.6/site-packages/cloudify/dispatch.py\", line 411, in main\n payload = handler.handle()\n File \"/opt/mgmtworker/env/lib/python3.6/site-packages/cloudify/dispatch.py\", line 146, in handle\n result = self._run_operation_func(ctx, kwargs)\n File \"/opt/mgmtworker/env/lib/python3.6/site-packages/cloudify/dispatch.py\", line 154, in _run_operation_func\n return self.func(*self.args, **kwargs)\n File \"/opt/mgmtworker/env/plugins/default_tenant/cloudify-kubernetes-plugin/2.13.5/lib/python3.6/site-packages/cloudify_kubernetes/decorators.py\", line 295, in wrapper\n causes=[generate_traceback_exception()]\ncloudify.exceptions.RecoverableError: Error encountered\n"
}
]
Any help would be highly appreciated. Thanks!!