Generate a sample kubernetes

def generate_kubernetes(self):
        """ Generate a sample kubernetes
        """
        example = {}
        example['spec'] = {}
        example['spec']['containers'] = []
        example['spec']['containers'].append({"name": '', "image": '', "env": []})
        for key, value in self.spec.items():
            if value['type'] in (dict, list):
                kvalue = f"\'{json.dumps(value.get('example', ''))}\'"
            else:
                kvalue = f"{value.get('example', '')}"
            entry = {"name": f"{self.env_prefix}_{key.upper()}", "value": kvalue}
            example['spec']['containers'][0]['env'].append(entry)
        print(yaml.dump(example, default_flow_style=False))